Posts

Showing posts from 2013

html5 - String / Array error on PHP form -

i'm finishing project can't seem see went wrong on php form. me correct yet i'm getting error. warning: mail() expects parameter 4 string, array given in /customers/f/a/b/webpx.be/httpd.www/sendemail.php on line 15 my php form: <?php $name = @trim(stripslashes($_post['name'])); $email = @trim(stripslashes($_post['email'])); $message = @trim(stripslashes($_post['message'])); $to = 'email@email.com';//replace email $headers = array(); $headers[] = "mime-version: 1.0"; $headers[] = "content-type: text/plain; charset=iso-8859-1"; $headers[] = "from: {$name} <{$from}>"; $headers[] = "reply-to: <{$from}>"; $headers[] = "subject: {$subject}"; $headers[] = "x-mailer: php/".phpversion(); mail($to, $subject, $message, $headers); die; ?> <?php if ($_post['submit']) { if (mail($to, $subject, $message, $headers)) { ...

php - SQL joining other table with condition -

i have query: select * `classes` join `classes_students` on `classes`.`id` = `classes_students`.`class` and need add condition selecting classes, in not logged student (user id not in classes_students connected class id) , count how many students in class. table structure: classes: id, name, etc classes_students: class_id, user_id, etc table data: classes: 1 | test 2 | test2 3 | test3 classes_students: 1 | 1 1 | 2 2 | 3 3 | 4 3 | 5 expected output if im user id 1: classes names (with number of students in): 2 (1 student) 3 (2 students) all in 1 query. possible? if yes, how? select classid, count(*) class left join student on student.classid = class.classid group classid glad you

for loop - R - use function n times on the same data set -

what efficient way apply function repetitively on same data set , give end result without using loop? e.g. set.seed(123) # create arbitrary data frame mydf <- data.frame(a = rbinom(10, 5, .5), b = rbinom(10, 8, .5)) # silly function foo <- function(df) { df <- df * (1 + rnorm(1,0, .1)) df <- df + 5 df } # repeat function 5 times in row on same data frame (i in c(1:5)) { mydf <- foo(mydf) mydf } answered @nrussel; example given, using recall() gives elegant code. speed-wise, similar for loop. dofoo <- function(df, n) { if (n == 0) return(df) recall(foo(df), n - 1) } dofoo(mydf, 5)

azure - How do I move files from one blob storage container to another blob storage container using powershell -

how move files in azure 1 storage container storage container. have far come across options copying blob nothing comes move. have tried azcopy no switch there moving files. tried start-azurestorageblobcopy thanks moving same copy , delete. why not copy blobs , delete them on original location? making general move command needs type of distributed transaction, not easy implement. writing own lot easier, because blobstorage accounts own.

swagger-php having different documentations from the same code -

we using slim framework , swagger-php dynamically generate swagger documentation. have special methods in api should not publicly documentated. (/doc now) there way can have second documentation url (/doc2) can secret methods , params documentated? (without having make documentation hand, using annotations in php code). thanks. as per latest version of swagger-php can indicate list of files and/or directories exclude scanning when building documentation. see scan function's docblock on github details. a solution problem separate public , private methods different files. create 2 documentation generation methods/functions each excluding other's files. example: $privateoptions = array( 'exclude' => array('app/api/public') ); $privatedoc = swagger\scan("app/", $privateoptions); ... $publicoptions = array( 'exclude' => array('app/api/private') ); $publicdoc = swagger\scan("app/", $publicoptions...

rdf - how to exclude one instance from SPARQL query result -

i have query similar instances specific instance, owbes:dies_irae instance. query: construct { ?recommendable0 ?predicate0 ?similarity0 } { ?recommendable0 ?predicate0 ?object0. owbes:dies_irae ?predicate0 ?object0. ?predicate0 owbes:hassimilarityvalue ?similarity0. ?recommendable0 rdf:type ?sometype. ?sometype rdfs:subclassof owbes:recommendable. } it works fine, in results i'm supposed to. however, same instance owbes:dies_irae . there way exclude result? well, i'm sure there is. tried search, found there filter, tried use it, no succeed. filter apply filter (?recmmendable0 != owbes:dies_irae) i tried check if both of them have same rdf:about didn't work. here go result: <http://www.welovethesemanticweb.com/recommendation-systems#requiem:_sequentia> recommendation-systems:hasartist "0.4"^^xsd:double . recommendation-systems:le_nozze_di_figaro recommendation-systems:hasartist ...

reporting services - How to repeat subreport in each page? -

Image
i have 2 .rdl files (a.rdl , b_subreport.rdl), a.rdl calling b.subreport.rdl using subreport control , have tablix separate subreport. tablix header repeating in pages, want subreport repeat tablix header not working. pls guide me how repeat subreport in page tablix header? thanks. you can achieve adding tablix header row tablix. make sure row has 1 column , replace textbox of cell rectangle . now can place subreport tablix header , repeated on every page if repeatrowheaders set true. edit : added image visual help.

Difference between replace entire node and replace node contents in OSB -

i have started using osb , came across feature "replace entire node or replace node contents". me in listing out difference between 2 examples. basic question started learning osb , wanted right. thanks in advance. cheers.. ok, let's assume have variable, $body . proxy has done stuff, , has $body set, , want run through xquery transform before return it. $body like <soap:body xmlns:soap="etc"> <ns0:response xmlns:ns0="etc2"> <ns0:item> <!-- etc etc --> </ns0:item> </ns0:response> </soap:body> if replace entire node, must replace <soap:body> . (i mean, could replace different, you'll encounter error somewhere because osb expects $body type) if replace node contents, may replace anything: perhaps transformed <ns0:response> , it's common replace totally different elements. either way, <soap:body> element unaffected, , insides scooped out , repl...

`xor` function in R -

i'm trying work through code in bootstrap simulation on this post 2 major hurdles. first, few times have played bootstrapping, have done without using {boot} package, , relying on functions replicate , or loops. , second, , main object of question, don't know function xor takes in inputs, , does: n <- 1000 dat <- c("a", rep("b", n-1)) indicator <- function(x, ndx) xor("a"%in%x[ndx], true) i see assesses whether "a" in x , returns false if in it. issue comes input ndx . stands "index", , connected bootstrapping follows: p_hat <- function(dat, m=1e3){ foo <- boot(data=dat, statistic=indicator, r=m) 1/mean(foo$t) } reps <- replicate(100, p_hat(dat)) but how? in last chunk of code feeds ndx in first chunk?

In what scenario , the No-VPC option available while creating a DB-Instance Through Amazon RDS. Under Network and Security Option -

this available vpc drop down options. according aws documentation, there 3 kind of vpc *1. default-vpc user defined vpc no-vpc* what possible scenarios can no-vpc in drop down. no vpc option available in ec2 classic accounts - ie., accounts created few years when vpc option. no longer case now. new accounts have choose vpc. if no vpc option not appear you, have 2 options: default , user defined.

javascript - UK postcodes with SimpleMaps -

i'm using simple maps plugin on site i'm building http://simplemap-plugin.com/demo/ it's based on google maps api. have zip (in uk postcode) input visible has used base search. search functionality works fine if use full postcode example w1u *pz if type w1 end getting result road in algeria. know if there away in gmaps api search postcodes , exclude roads, typing start of postcode (the area code) give desired result. perhaps simplest way limit results specific country, in case i'm presuming uk. https://developers.google.com/maps/documentation/geocoding/#regioncodes the problem you're going have such query how decide result return, querying 'w1' going return series of arbitrary addresses postcodes contain 'w1' example nw1. may best specifying minimum length?

publish subscribe - How to inform client about new messages on the server -

i created web application jhipster (java, spring boot, angularjs,..) , want implement messaging system users of app. want reach is, show message user in client, if has received new message other user. e.g. "hello xyz, have 3 new messages". what best approach reach goal? i think have these possibilities: client polls server (call service), if there new messages in database. some publish/subscribe mechanism: client subscribes server , gets informed new messages use permanent connection web sockets. what think , want know... is not idea if app has lot of users (creates lot of traffic) what possibilities implement publish/subscribe system spring? is idea use web sockets , create lot of permanent connections, if system has lot of users? e.g. >1000000 user or so are there other possibilities?

twitter bootstrap - Get Collapsible div on the same line as <li> -

on 1 of company's websites have copyright notice @ bottom , want put pipe character collapsible div our refund policy. works refund policy collapsible div keeps showing below copyright. how can on same line? code: <section id="footer"> <div class="container inline-block"> <ul class="copyright"> <li>&copy; @datetime.now.year.tostring() securities training corporation. rights reserved. | <div class="panel-group"> <div class="panel panel-default"> <div class="panel-title"> <a data-toggle="collapse" href="#collapse1">refund policy</a> </div> <div id="collapse1" class="panel-collapse collapse"> <table border="0" cellpadding=...

c# - About Encapsulation : properties -

case : class example { private int roll; public int roll { { return roll; } set{ if (value > 0) { roll = value; } } } //public example() //{ // roll = 500; //} } class practice_4 { static void main(string[] args) { example abc = new example(); console.writeline(abc.roll = -1); console.readline(); } } output : -1 i have set business logic not contain illegal value , gives me default value "0".. case ii: class example { private byte roll; public byte roll { { return roll; } set{ if (value > 0) { roll = value; } } } //public example() //{ // roll = 500; //} } class practice_4 { static void main(string[] args) { example abc = new example(); console.writeline(abc.roll = -1); console.readline(); } } a...

Convert MongoDB BasicDBList to Java short[] Array -

i have inserted 1d short[] array mongodb. easy.now trying retreive same array. returns basicdblist.i want manipulation on elements of list. hence, want convert java short[] back. how can ? following code: /* insert 1darray*/ db db = (new mongoclient("localhost",27017)).getdb("test1darray"); dbcollection dbcollection = db.getcollection("test1darray"); basicdbobject aisdocument = new basicdbobject(); aisdocument.append("tdarray",out1d); dbcollection.insert(aisdocument); /* fetch 1darray*/ objectid mlmatrixobjectsid = (objectid)aisdocument.get( "_id" ); system.out.println(mlmatrixobjectsid); basicdbobject fields = new basicdbobject(); fields.put("_id", mlmatrixobjectsid); dbcollection dbcollectionfetch = db.getcollection("test1darray"); dbcursor cursor = dbcollectionfetch.find(fields); basicdblist odarr=null; while (cursor.hasnext()) { odarr = (...

spring security - How to use cached ticket with KerberosRestTemplate? -

i want implement integration test spring security kerberos authentication. there kerberosresttemplate ( reference ) purpose. kerberosresttemplate has got default constructor description "leave keytablocation , userprincipal empty if want use cached ticket". for research wrote trivial class: public static void main(string[] args) { kerberosresttemplate krt = new kerberosresttemplate(); string result = krt.getforobject("http://testserver.testad.local:8080/", string.class); system.out.println(result); } when run it, exception has thrown: exception in thread "main" org.springframework.web.client.restclientexception: error running rest call; nested exception java.lang.illegalargumentexception: null name not allowed @ org.springframework.security.kerberos.client.kerberosresttemplate.doexecute(kerberosrestt emplate.java:196) @ org.springframework.web.client.resttemplate.execute(resttemplate.java:530) ...

Dymanic PickList Applet is empty Siebel -

can me, please? i've created dynamic picklist , pick applet, when it's displayed there no records. i've created joins (i join s_contact on row_id take last , first names), pick map specified picklist field. think missed link between picklist , pick applet, i'm not sure , don't know how solve it. if new siebel, may point out siebel tools has wizards can make things easier. add dynamic picklist on field, right click on field in siebel tools, , choose 'add picklist'. follow onscreen instructions, configure pick applet. try re-creating dynamic picklist using wizard. if not want try this, have spool sql logs sql point issue. searhspec issue on picklist/picklist bus comp/pick applet. buscomp visibility issue (salesrep, org). check pop-up visibility buscomps, , see if there other constrains on pickmap.

mongodb - Using Mongoose with a rich document? -

i'm working on prototype used reporting (read only) record rich set of objects embedded single document. document structure (edited brevity): { "_id": objectid("56b3af6f84ef45c8903acc51"), "id": "7815dd97-e895-46e5-b6c9-45184c6eae89", "survey": { "id": "1fb21c69-6a5c-4805-b1cf-fabef7a5d0e6", "type": "survey", "data": { "description": "testing reporting , data ouput", "id": "1fb21c69-6a5c-4805-b1cf-fabef7a5d0e6", "start_date": "2016-02-04t11:12:46z", "questions": [ { "sequence": 1, "modified_at": "2016-02-04t16:11:04.505849+00:00", "id": "2a77921b-6853-463b-80e7-5713c82c51ca", "previous_question": null, "created_at": "2016-02-04t16:1...

android - Custom GcmListenerService not working -

this manifest file <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="be.customapp" > <uses-permission android:name="android.permission.internet" /> <!-- gcm: keep device awake while receiving notification --> <uses-permission android:name="android.permission.wake_lock"/> <!-- gcm: receive push notifications --> <permission android:name="be.customapp.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="be.customapp.permission.c2d_message" /> <uses-permission android:name="com.google.android.c2dm.permission.receive"/> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name...

javascript - Holy grail for determining whether or not local iframe has loaded -

firstly, see question asked few times no answers seem satisfactory. looking able call script @ anytime , determine whether or not iframe has loaded - , not limit script require being added iframe tag in onload property. here's background: have been working on unobtrusive script try , determine whether or not local iframes in dom have loaded, because 1 of our clients includes forms on website in iframes , many of them open in lightboxes - dynamically add iframes dom @ time. can attach open event of lightbox, hit or miss whether can "catch" iframe before has loaded. let me explain little more. in testing i've determined onload event fire once - , if bound before iframe loads. example: page should alert "added iframe tag" , listener attached afterward not fire - me makes sense. (i'm using iframe onload property simple example). https://jsfiddle.net/g1bkd3u1/2/ <script> function loaded () { alert ("added iframe tag...

c# - How do i get a relative path of a file when running my code in debug for coded ui -

i'm trying not hard code path, have not been able figure our way xml file have included in project under folder labeled datasource. here latest code have tried still doesn't work. public static string myassemblydirectory { { string codebase = assembly.getexecutingassembly().codebase; uribuilder uri = new uribuilder(codebase); string path = uri.unescapedatastring(uri.path); return path.getdirectoryname(path); } } string filename = xmlfilename; string path = path.combine(myassemblydirectory, @"datasource\" + filename); xmldocument xdoc = new xmldocument(); xdoc.load(path); here output path i'm getting putting in test results output folder. "c:\myautomation\automated_test_projects\automationprojects\miserreleasetestsuites\testresults\marcw_isd2005m 2016-02-05 10_15_17\out\datasource\miser_login_dts.xml" if possible i...

javascript - renderEnd not firing on Horizontal Bar Chart [nvd3] -

let me preface saying have bar, pie , line charts renderend works fine. i'm trying modify styling on horizontal bar chart, can fine either in callback or renderend , results can seen in browser. problem occurs when resizing window, custom styling removed , chart resets. testing render end simple console.log on other charts, log fires each time window resized, far understand renderend should, on horizontal bar chart isn't case , gets fired when page loads. here's 2 plunker's of horizontal bar chart , vertical bar chart, if open console , watch height (on horizontal) , width (on vertical) can see renderend fires on load on horizontal chart fires on load , each time window resized on vertical chart. if me out i'd appreciate it! horizontal bar chart: http://embed.plnkr.co/ua2igvshet2zzeyrtza2/ vertical bar chart: http://embed.plnkr.co/ems2abmdegs8harklkdy/ thanks.

php - Joomla Custom Component - Error loading form file -

currently, i've been trying familiar programming custom components joomla 3.4.8. therefore i've installed new joomla website on raspberry pi 2 test purposes. working schould. then started ' developing mvc component ' tutorial provided joomla itself. worked fine until point 7 ' using database '. although point talks database, problem field types work. i.e. when want add new menu item (in administrator part), , select custom menu item type, error states "error loading form file". i've been trying find error several days, without success. went far track code line inside joomla framework throws error. code line inside /libraries/legacy/model/form.php (line 192). @ line can see $this->preprocessform($form, $data); . somehow code not enter method, throws exception. i compared $form , $data variable ones normal run adding following statement (found here ) before line 192: echo "<pre>"; print_r($arr); echo "</pr...

bigtop - Flume Agent not Receiving Data but no Error -

i've got problem flume. trying big data , hence working tutorial 'for dummies' books. other stuff far has more or less worked, there problem flume agent. here tutorial working with. when according tutorial, terminal output followed: 16/02/05 17:19:33 info conf.flumeconfiguration: post-validation flume configuration contains configuration agents: [shaman] 16/02/05 17:19:33 info node.abstractconfigurationprovider: creating channels 16/02/05 17:19:33 info channel.defaultchannelfactory: creating instance of channel in-mem_c1 type memory 16/02/05 17:19:33 info node.abstractconfigurationprovider: created channel in-mem_c1 16/02/05 17:19:33 info source.defaultsourcefactory: creating instance of source netcat_s1, type netcat 16/02/05 17:19:33 info node.abstractconfigurationprovider: channel in-mem_c1 connected [netcat_s1] 16/02/05 17:19:33 info node.application: starting new configuration:{ sourcerunners:{netcat_s1=eventdrivensourcerunner: { source:org.apache.flume...

bash - prevent "dotting" a shell to execute it ( exit in a function killing the terminal vs exiting the shell ) -

this question has answer here: how detect if script being sourced 14 answers if launching script exit statement in it, have launch child process. if launch inside current shell of started terminal session (using . ./<scriptname> exit close main shell, 1 started along terminal session. die () { echo "error: $*. aborting." >&2 exit 1 } [ -s "$1" ] || die "empty file" echo "this should not reached if $1 not nonempty file" i aware of situation. write prevent shell being run way: . shell.ksh params if run way should error out message. how done? thanks per the excellent answer related question given dennis williamson : #!/bin/ksh if [ "$_" != "$0" ]; echo "this script may not sourced" >&2 return fi : ...do other things here...

java - Error - not a statement when I have already defined the variable I use -

it's giving me error "not statement" , can't understand why. here's error telling me: coolnumbers.java:17: error: not statement for(num; num <= meme; num++){ ^ here's (now updated) code: import static java.lang.system.*; public class coolnumbers { int num = 6; int iscoolnum; int meme; public int meth(int meme){ for(num; num <= meme; num++){ if (num % 3 == 1 && num % 4 == 1 && num % 5 == 1 && num % 6 == 1){ iscoolnum++; } } return iscoolnum; } } your loop: for(num; num <= meme; num++){ should be: for(; num <= meme; num++){ i assume num not need initial value (since gave 1 when declared it). if does, need like: for(num = 0; num <= meme; num++){

java: I want to know the primitive datatype of input which is stored in String variable -

string x; x=scanner.nextline(); i entered 1 or 6.66. should give output int or double / float . whatever necessary. instead of parsing result of scanner.nextline() returns string , should instead use convenience methods of scanner class hasnextint() , hasnextfloat() . for example following code should expect : if (scanner.hasnextfloat()) { system.out.println("float"); float myvalue = scanner.nextfloat(); // float myvalue }else if (scanner.hasnextint()) { system.out.println("int") int myvalue = scanner.nextint(); // int myvalue } else { // fallback on string string myvalue = scanner.next(); // string myvalue }

angular - AngularJS 2 - Can't load component -

Image
i'm trying import component inside 'app.component.ts' main component run on application start. here simplified piece of code of app.component.ts. import {component} 'angular2/core'; import {contactlistcomponent} './contacts/contact-list.component'; @component({ selector: 'my-app', template: `hello`, directives: [contactlistcomponent], }) export class appcomponent {} i error on second import, when go browser console see error: my index.html looks this: <html> <head> <title>angular 2 application</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 1. load libraries --> <!-- ie required polyfills, in exact order --> <script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/systemjs/dist/system-polyfills.js"></scri...

Python to java expressions in python 3 -

i have write program can determine rather python expression or java expression. having bit of trouble. have tried serval ways , not working. there couple of ways determine this. example can check position of expressions used in other ways in java in python. ":" , ";" or words "public", "void" etc

php - Behat scenario failing if run with other scenarios -

i have rather odd 1 here today... i have behat feature file contains several scenarios. each of scenarios pass if run individually, if run feature file in it's entirety, 1 of tests fails, error... notice: undefined index: 00000000070885f90000000106598262 in /project/vendor/doctrine/orm/lib/doctrine/orm/unitofwork.php line 2058 ... (shown below) the scenarios load fixtures, , navigates around pages using information in fixture entity, , check page urls correct. the weird thing second test fails, if first 1 run before it. if it's not, context manages store fixture entity property, , use entitymanager::merge() , entitymanager::refresh() reload entity it's current state. when first test run before it, context still fetching , storing fixture entity in same way, when attempts merge , refresh, reason entity manager unit of work seems have forgotten it. before each scenario d/b cleared, , fixtures reloaded, using code shown below. i've made sure i've ca...

ios - listviewcontroller leaving room for two tabbars at the bottom when loading the VC programmatically -

when load scene through normal segues, tabbar @ bottom , nice , clean. when come via code, loading tabbarcontroller, nav bar custom vc. loads perfect theres x amount of pixels tabbar, additional x amount of pixels blank between custom vc , tab bar. counting 2 tab bars. override func prepareforsegue(segue:uistoryboardsegue, sender: anyobject!) { if (segue.identifier == "searchsegue") { let nav = segue.destinationviewcontroller as! uitabbarcontroller let navcontroller = nav.viewcontrollers![0] as! uinavigationcontroller let listcontroller = navcontroller.topviewcontroller as! recipelistviewcontroller listcontroller.ingredientsearch = (self.ingredids string); } } messed list view

maven - Why is mvn clean install -U not working: Non-resolvable parent POM -

i have cloned the repository github , issues mvn clean install -u reason getting: [info] scanning projects... [error] [error] problems encountered while processing poms: [fatal] non-resolvable parent pom com.github.gwtmaterialdesign:gwt-material-addins:[unknown-version]: not find artifact com.github.gwtmaterialdesign:gwt-material-parent:pom:1.5.0-snapshot , 'parent.relativepath' points @ wrong local pom @ line 3, column 13 @ [error] build not read 1 project -> [help 1] [error] [error] project com.github.gwtmaterialdesign:gwt-material-addins:[unknown-version] (e:\java\gwt-material\gwt-material-addins\pom.xml) has 1 error [error] non-resolvable parent pom com.github.gwtmaterialdesign:gwt-material-addins:[unknown-version]: not find artifact com.github.gwtmaterialdesign:gwt-material-parent:pom:1.5.0-snapshot , 'parent.relativepath' points @ wrong local pom @ line 3, column 13 -> [help 2] [error] [error] see full stack trace of errors, re-run maven ...

javascript - Create An Array Dynamically, Then Loop Through Another Array To Compare If Data Exist -

what trying achieve create array dynamically , use array compare array if data exist. what happening right code compare arrays executing before array finish creating. comparing data empty array. what technique can use make code execute code a when code a finished execute code b ? var awayteamplayersplayedarray = []; vm.awayteamplayers = $firebasearray(awayteamplayersquery); // add data awayteamplayersplayedarray angular.foreach(vm.awayteamplayersplayed, function(value, key) { var awayteamplayerref = new firebase(firebase_url + 'players/' + key); var awayteamplayer = $firebaseobject(awayteamplayerref); awayteamplayer.$loaded().then(function() { awayteamplayersplayedarray.push(awayteamplayer.name); console.log(awayteamplayersplayedarray) }); }); // loop through vm.awayteamplayers see if exist in awayteamplayersplayedarray angular.foreach(vm.awayteamplayers, function(value, key) { if(awayteamplayersplayedarray.indexof(value.name) ...

python - Threading with Twisted with Tkinter -

i working on battleship game project (for learning purposes) uses tkinter ui and, because want program able run on 2 computers multiplayer, twisted data transfer. first time using twisted have used tkinter many times. i know both twisted , tkinter run in loops not possible have these running in same thread. found out there's 2 ways around this: tksupport , running twisted's reactor in separate thread. however, tried import tksupport twisted.internet said didn't exist. checked twisted folder in site-packages sure , indeed not there, twisted docs claim is. assuming because running python 3.5 , tksupport hasn't been ported on yet, if not case, please let me know. also, solution threading, discovered there's controversy on putting twisted's reactor in it's own thread. is ok put reactor in own thread, and, if so, precautions should take? thanks. i took @ source code twisted.internet.tksupport , appears has not been ported support pytho...

processbuilder - Using process builder to open a file in internet explorer Java -

i have program have written java @ work takes xml , allows users view xml in table form, make changes, save table new xml. everything finished except 1 small detail. once user saves table data of course parsed new xml. want dialog appear tells user save location , asks if open file. if user clicks yes want xml open in internet explorer. had implemented similar approach processbuilder in program in case file needed open notepad worked perfectly. now issue i'm having while internetexplorer open file not open, browser stay on home page. i'll post code below if can me i'd appreciate it! location = "//camt54revised"+date+".xml"; location = fhandling.savefile.getselectedfile()+location; transformerfactory transformerfactory = transformerfactory.newinstance(); transformer transformer = transformerfactory.newtransformer(); domsource source = new domsource(doc); streamresult result = new str...

Kill all instances of a process except oldest (1st) instance (vbscript) -

i'm creating code aid in bigger process i've developed. piece me automate it. assuming have opened @ least 2 ie windows, first section below finds time 1st opened , set variable "strreturn". time colons removed. removed colons easier number comparison. since seems loop through these in order, have exit statement since first care about. then, second statement, built kill instances of process, attempted modify kill 1 matches time in variable. however, nothing... i'm sure i'm implementing incorrectly. i've bolded parts i've modified original..well, attempted bold - you'll see asterisks...haha. clear i'm going wrong? tia '============================================================= 'finds time first instance of iexplore process started strcomputer = "." set objwmiservice = getobject("winmgmts:\\" & strcomputer & "\root\cimv2") set colprocesslist = objwmiservice.execquery _ (...

numpy - Python pandas groupby agg function on datetime columns -

there bogus behaviour @ .agg() function in pandas 0.17.1 , numpy 1.10.1. problem can found in datatype conversion. here example dataframe: import datetime dt df_data = [[1,1,2] , ['foo', 'bar', 'bar'], [1,2,3] , [dt.date(2015,1,5), dt.date(2015,1,3), dt.date(2015,1,15)] , [dt.datetime(2015,1,5,23,16,59), dt.datetime(2015,1,5,21,16,59) , dt.datetime(2015,1,5,20,16,59)] , [dt.timedelta(minutes=60), dt.timedelta(minutes=120), dt.timedelta(minutes=12)]] df_cols = ['gb', 'a_string', 'a_int', 'a_date', 'a_datetime', 'a_timedelta'] df = pd.dataframe({i:j i,j in zip(df_cols, df_data)}) print(df[df_cols]) the result is: gb a_string a_int a_date a_datetime a_timedelta 0 1 foo 1 2015-01-05 2015-01-05 23:16:59 01:00:00 1 1 bar 2 2015-01-03 2015-01-05 21:16:59 02:00:00 2 2 bar 3 2015-01-15 2015-01-05 20:16:59 00:12:00 i wa...

Javascript-Jquery Geolocation and locationpicker -

$(function() { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(showposition); } else { $('#us2').locationpicker({ location: { latitude: 41.0918692, longitude: 29.0602068 }, radius: 0, scrollwheel: false, inputbinding: { latitudeinput: $('#us2-lat'), longitudeinput: $('#us2-lon'), radiusinput: $('#us2-radius'), locationnameinput: $('#us2-address') } }); } function showposition(position) { var lat = position.coords.latitude; var lon = position.coords.longitude; // binding ui widget $('#us2').locationpicker({ location: { latitude: lat, longitude: lon }, radius: 0, scrollwheel: false, ...

javascript - Asynchronously function returns undefined with $q deferred -

i calling data api through factory looks this: app.factory('service', ['$http', function ($http) { var urlbase = 'http://localhost:50476/api'; var service = {}; service.getcomp = function () { return $http.get(urlbase + '/complaints') }; return service; }]); then use controller use directive: getcomp(); $scope.comp = []; function getcomp() { var deferred = $q.defer(); service.getcomp() .success(function (comp) { console.log('comp', comp); //returns array data $scope.comp = comp.data; deferred.resolve(comp); }) .error(function (error) { $scope.error = 'error' + error.message; }); return deferred.promise; } $scope.index = 0; $scope.complaints = $scope.comp[0]; console.log($scope.complaints); //undefined console.log($scope.comp); //array of 0 when try access items outside of function undefined. tried resolutions using $q still not displaying data. when added ...

Repeat objects in list in R -

i have 2 list files , b: a<-list(1,5,8,2,6,4,9,5) b<-list(2,2,3,2,4,1,3,1) i want every object in list repeat "matched objects of b" times, respectively. expected result follows: [[1]] [1] 1 1 [[2]] [1] 5 5 [[3]] [1] 8 8 8 [[4]] [1] 2 2 [[5]] [1] 6 6 6 6 [[6]] [1] 4 [[7]] [1] 9 9 9 [[8]] [1] 5 i use code: lapply(1:length(a), function(x) {rep(a[[x]],b[[x]])}) but want explore other ways. thank help! you can use map ! map(rep, a, b)

java - TIme-based Notification Architecture -

i designing notification service (server). can have 2 kinds of notifications: 1 delivered immediately, , other delivered @ time in future. is there framework handle future notifications? i know can write background worker can example sample db notification needs sent, sure millions tried solve problem , i'd prefer reuse proven solution. i didn't decide yet on framework / db. thinking should use either vertx.io or jetty (websockets) push notification. not sure regarding db because wanted support future notifications. update: how recommend should save data in db "live" notifications (notifications exists in users inbox) , future notifications? update : thinking of using either: jetty + spring websocket & sockjs + quartz vertx.io (supports websocket , sockjs) any recommendation? one approach deliver notifications scheduling component. scheduling component consumes notifications, stores , checks regularly see if notification due sent out...

html - How to ignore rule for a href using CSS -

i have simple rule form <a> : a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: underline; } but don't want apply <img> inside <a> : <a href="link"> <img class="myclass" src="smile.png" alt="this image link example"> </a> how can ignore this? you need add set of classes after first, targeting img, img:hover, etc. however, img element doesn't support text-decoration. trying avoid image?

Firebase permissions based on user's role -

in application supposed have three kinds of roles: store: can whatever kind of reads , writes on bellow owned key; customers: can create chat keys underneath designated store; once chat created can push message child, on own chats; attendants: can update chats designated them, , insert under messages tag. the database similar to: "$store_id": { "owner": store_id, "chats": { ... "$chat_id": { "owner": costumer, "attendant": attendant, "messages": { "$message_id": { "owner": customer_id } } } ... } } i can't figure out how can achieve behavior because: if permission applied top level node, children can't override it; if crack database valid credentials (i.e.: customers') , can assume whatever role want; how kind of ...