Posts

Showing posts from May, 2013

javascript - Multiple tbodys and scroll inside the 1st & column width issue -

im'm trying scrollable first tbody inside table fixed header, divided in 4 tbodies witch : http://scr.hu/0ei9/k2tqx here's fiddle https://jsfiddle.net/yb5sob07/ (sorry html it's lot of code generated angular , difficult clean fiddle...) in short looks : <table class="planning shifts"> <thead> <!-- les jours du mois--> <tr class="bg-active"> <th>coursier|jour</th> <th class="monthday">days 1 31 </th> </tr> </thead> <tbody id="shiftstable"> <tr> <td class="coursiertd"> <a href="#">{{user.name}}</a> </td> <td>user/day </td> </tr> </tbody> <tbody ng-repeat="city in cities"> <tr class="citymanquesheader"> <th colspan="{{cal...

websphere - Deploying ear file to IBM WEBSPHERE8 with wsadmin.sh -

i new websphere , found many answers *.ear file deployment. of them use format similar " ./wsadmin.sh -host vmllkb056933n.myspace.com -port 5000 -c '$adminapp> install /apps/test-app.ear' i getting errors like: wasx8011w: admintask object not available. wasx7015e: exception running command: "$adminapp install /apps/cdm-fi.ear"; exception information: com.ibm.ws.scripting.scriptingexception: wasx7206w: application management service not running. application management commands not run. i in rhel 6 environment , runing ibm websphere 8.5.5.3 what easiest way deploy ear file ibm websphere 8.5.5 make sure using deployment manager wsadmin.sh , dmgr process running. port reference should soap_connector_address of dmgr. referencing cluster or server name in federated environment tells dmgr put code, in 2 examples below. $adminapp install "myapp.ear" {-cluster clustername} or $adminapp install app_server_root/installab...

access singleton and inner classes each other in javascript -

i'm kind of new javascript. i'm confused javascript objects!! my code skeleton bellow... var jcanvas = new function(){ this.init = function(canvasid){ ... }; var drawingmanager = new function(){ drawinfos = []; // drawinfo objects pushed this.mousestate = mousestate.released; ... }; function drawinfo(bm, cl, id, x, y){ ... } function point(x, y){ ... } var mousestate = new function(){ ... }; var color = new function(){ ... }; var brushmode = new function(){ ... }; }; i want jcanvas singleton class object. in jcanvas object, there many singleton classes such drawingmanager, mousestate, color, brushmode. , 2 more classes not singleton classes(point, drawinfo) what want that, in drawingmanager, want access other classes , singleton class objects. problem browser gives error "mousestate undefined". i think i'm famili...

memory management - Java, what is the cost if I pass a heavy object as argument to some function -

suppose have object classroom, in classroom there many student object (50 objects) more 20 properties, many teacher object (10 objects) more 20. classroom has other properties classno, seatcapacity, etc. is pass object of classroom object argument method. suppose need 3-4 properties of classroom , 1-2 properties of each students. if bad cost passing heavy object. in java passing a reference object . , there's no cost difference when pass string instance or complex class instance, classroom class.

java - PircBotX Private Message -

when user executes command, send output user, not channel. i'm using pircbotx framework. my code: public void onmessage(messageevent<pircbotx> event) { if (event.getmessage().equalsignorecase("!test")){ event.respond("test successful."); }else if (event.getmessage().split(" ")[1].equalsignorecase("!test2")){ event.getchannel().send().message("this response works"); event.respond("this response works"); event.getuser().send().message("but not work"); } } according documentation , event.getuser().send().message("xyz"); should private message. the documentation states bot.sendmessage should private message, doesn't work either. for both of these, console output looks normal. one thought have origin of issue: i'm building twitch.tv chat bot. possible (although their api page not mention this) private messages disabled. ...

Android service stop working after I run another app/game -

do have idea can bee root cause of android app service stop working when run random app/game? i not have code available, need causes. thank you. service runs in app process. if app garbage collected, service stop until: you start service in new process via manifest file declaration you make service sticky (recommended). go ahead , research above 2 , let me know if more explanation or code update if see official documentation of service , google explains why , when service destroyed. useful in scenario: a started service can use startforeground(int, notification) api put service in foreground state, system considers user actively aware of , not candidate killing when low on memory. (it still theoretically possible service killed under extreme memory pressure current foreground application, in practice should not concern.) using startforeground ensure service keeps running in same process. pointers: a service attached client not destroyed on low mem...

Where do the Android app Crazy Stone (Go playing program) store saved games? -

i guess rather specific question bit outside programming spectrum of stack overflow, have been thinking developing game parser/viewer games in sgf (there few already, in java midlet, android) , in format used crazy stone app. however, when try locate files created app, can't find them. have searched thru both sd-card , internal memory of phone without finding files. i tried google this, not find answer. the app itself, there no mistake, developed unbalance: https://play.google.com/store/apps/details?id=jp.co.unbalance.android.igoen&hl=en could point me in right direction?

python - How to handle an exhausted iterator? -

while searching python documentation found equivalent python implementation of pythons build-in zip() function . instead of catching stopiteration exception signals there no further items produced iterator the author(s) use if statement check if returned default value form next() equals object() (" sentinel ") , stop generator: def zip(*iterables): # zip('abcd', 'xy') --> ax sentinel = object() iterators = [iter(it) in iterables] while iterators: result = [] in iterators: elem = next(it, sentinel) if elem sentinel: return result.append(elem) yield tuple(result) i wonder if there any difference between exception catching or if statement used python docs? or better, @hiro protagonist pointed out: what's wrong using try statement considering eafp (easier ask forgiveness permission) in python? def zip(*iterables): # zip('abcd...

c++ - Sorting 64-bit structs using AVX? -

i have 64-bit struct represents several pieces of data, 1 of floating point value: struct mystruct{ uint16_t a; uint16_t b; float f; }; and have 4 of these structs in, lets std::array<mystruct, 4> is possible use avx sort array, in terms of float member mystruct::f ? sorry answer messy; didn't written @ once , i'm lazy. there duplication. i have 4 separate ideas: normal sorting, moving struct 64bit unit vectorized insertion-sort building block qsort sorting networks, comparator implementation using cmpps / blendvpd instead of minps / maxps . overhead might kill speedup, though. sorting networks: load structs, shuffle/blend registers of floats , registers of payload. use timothy furtak's technique of doing normal minps / maxps comparator , cmpeqps min,orig -> masked xor-swap on payload. sorts twice data per comparator, require matching shuffles on 2 registers between comparators. requires re-interleaving when you'...

How do you animate a UIWebView in swift? -

i'm looking in swift, don't know how write in swift: webview.frame = cgrectmake(somex, self.view.frame.size.height, somewidth, someheight); webview.hidden = no; [uiview animatewithduration:1.0 animations:^{ webview.frame = cgrectmake(somex, self.view.frame.size.height/2, somewidth, someheight); }]; here swift code above obj-c code: webview.frame = cgrectmake(somex, somey, somewidth, someheight) webview.hidden = false uiview.animatewithduration(duration, delay: 0.0, options: uiviewanimationoptions(animationcurve), animations: { () -> void in webview.frame = cgrectmake(somex, someothery, somewidth, someheight) }, completion: {(finished) -> () in // can leave empty }) that should in swift.

node.js - How to use AngularJS custom elements with jade? -

i having problem cannot tell jade render custom elements of angularjs origin (directives), want know if there way escape tags maybe @ least rendered instead of going jade pre-processor, or maybe way tell jade render custom element somehow. the current code looks : html head link(href='/main.css', rel='stylesheet') script(src='/lib.js') script(src='/main.js') title!= "neuron@l" meta(charset="utf-8") link(rel="icon",href="/images/neuronal.png") body(ng-app="app",ng-view) "<top:bar></top:bar>" "<left:bar></left:bar>" if problem it's top:bar , left:bar here solution: html head link(href='/main.css', rel='stylesheet') script(src='/lib.js') script(src='/main.js') title!= "neuron@l" meta(charset="utf-8") link(rel="icon",hr...

java - Not able to create any portlet on Liferay 6.2 CE GA4 Offline without internet -

i have created fresh liferay 6.2 ce ga4 using pre-downloaded sdk/tomcat/lr source. have created server in eclipse , when try create portlet first time try download " gradle-2.2.1-bin.zip " internet. i have downloaded same gradle " https://downloads.gradle.org/distributions/gradle-2.2.1-bin.zip " , placed inside "liferay-plugins-sdk-6.2\tools\gradle\gradle\wrapper". still shows same error below: `downloading https://services.gradle.org/distributions/gradle-2.2.1-bin.zip exception in thread "main" java.net.connectexception: connection timed out: connect @ java.net.plainsocketimpl.socketconnect(native method) @ java.net.plainsocketimpl.doconnect(unknown source) @ java.net.plainsocketimpl.connecttoaddress(unknown source) @ java.net.plainsocketimpl.connect(unknown source) @ java.net.sockssocketimpl.connect(unknown source) @ java.net.socket.connect(unknown source) @ com.sun.net.ssl.internal.ssl.sslsocketimpl.conne...

sql - Select query taking much time to execute - query optimisation -

i have table called cps_case_history 1 column named 'notes' of data type varchar2 (1800 char) i need fetch 10 15 records cps_case_history table notes 'account tfr ufss' . i have used below 2 queries it's taking time execute, can 1 suggest way optimise below query can fetch 10 or 15 records quickly first query : select * cps_case_history (dbms_lob.instr(notes, 'account tfr ufss') > 1) second query: select * cps_case_history notes '%account tfr ufss%' thanks in advance. as name suggest history table cps_case_history. may case table contain huge amount of data. getting query result fast table should have partitioning or index .

Where is the Alfresco audit log? -

curl -u id:pw "http://localhost:8080/alfresco/service/api/audit/query/testapp?verbose=true&limit=200&forward=false" where alfresco audit log run above command stored? thought somewhere in database couldn't find it. as mentioned in http://wiki.alfresco.com/wiki/auditing_(from_v3.4) : alf_audit_model : audit configuration files recorded here. alf_audit_application : entry each logical application. there may several audit applications defined in single audit model. alf_audit_entry : each call auditcomponent.recordauditvalues result in entry here. there reference property.

javascript - MEAN Stack, Why does express keep routing with a # in the url -

trying used end stuff. started off following thinkster guide on express. wondering if clear stuff me. firstly, understand front-end , back-end routing different. understanding front end routing user experience (going page page), , end routing (e.g router.get(~~~)) used api calls , interacting database stuff. why router.get('/', function(req, res, next) { res.render('index'); }); is whats loading first page? secondly, front end routing looks this app.config([ '$stateprovider', '$urlrouterprovider', function($stateprovider, $urlrouterprovider) { $stateprovider .state('home', { url: '/', templateurl: '/home.html', controller: 'mainctrl' }) $urlrouterprovider.otherwise('home'); } ]); however, whenever run server , go localhost:3000, automatically puts me localhost:3000/#/ , serves content there. know thinkster guide uses inline templates tr...

javascript - Bootstrap-Datepicker Ajax+Json change date -

i have bootstrap-datepicker , want change date, using ajax+json, it's not working, date changes format , when select calendar box not assume date in input field. datepicker input have this: <div class="form-group"> <label class="control-label col-md-3">data de carregamento</label> <div class="col-md-3"> <div class="input-group input-medium date date-picker" data-date-format="yyyy-mm-dd"> <input type="text" class="form-control" name="h_data" id="h_data" value=""> <span class="input-group-btn"> <button class="btn default" type="button"><i class="fa fa-calendar"></i> </button> </span> </div> </div> </div> datepicker initialization: var handledatepickers = function () { if (jquery().datepicker)...

c++ - How to allow a member function that's defined inside the class declaration to be called by constant objects of said class -

i have book class within namespace literature , following declaration implementation pair doesn't work: namespace literature { class book{ public: //getter method condition check(){return status;} const bool operator==(const book&); bool operator!=(const book&); } } the logical overload's declaration: namespace literature{ bool book::operator==(const book& right) {return true;} bool book::operator!=(const book& right) {return false;} } for reason, implementation operator != works while 1 == doesn't , instead states prototype == overload returns const bool instead of bool although answer j.alvaro.t shows done overcome problem. answer text misleading. main issue line of code: condition check() {return status;} const is grammatically malformed. intention make method const method , const keyword should appear before function body. characters after function body not parsed...

memory - php type casting usability for minimization -

is there difference in php 5.* between 1. $variable = (int) 1111; vs. 2. $variable = '1111'; in terms of physical resources eg. memory usage. please ideas. if take consideration following page says: it should clear structures above variable can of 1 type, variable data represented appropriate field in zval_value union. that means answer question is: yes . there difference in amount of memory used based on variable really represented internally. the comments under question tackling other issues, such viability etc. refrain dealing that.

parse.com - Parse Query skip more than 10,000 results -

i'm running parse query parse4j , have limit results set @ 1000 , , loop through, incrementing skip more thousand results. my problem have more 10k object need return , parse raises exception skips greater 10k . parseexception [code=154, error=skips larger 10000 not allowed] is there workaround? according parse, common question, , have detailed list of options work around error. check out @ parse.com - paging through more 10,000 results

java - How can I read from the next line of a text file, and pause, allowing me to read from the line after that later? -

i wrote program generates random numbers 2 text files , random letters third according 2 constant files. need read each text file, line line, , put them together. program suggestion found here doesn't situation. when try approach reads lines until it's done without allowing me option pause it, go different file, etc. ideally find way read next line, , later go line after that. maybe kind of variable hold place in reading or something. public static void mergeproductcodestofile(string prefixfile, string inlinefile, string suffixfile, string productfile) throws ioexception { try (bufferedreader br = new bufferedreader(new filereader(prefixfile))) { string line; while ((line = br.readline()) != null) { try (printwriter out = new printwriter(new bufferedwriter(new filewriter(productfile, true...

javascript - Casper: Getting error Cannot dispatch mousedown event on nonexistent selector -

trying click on link using below code. getting error @ code this.click('/login') me solve able click on link struck. i output : fail cannot dispatch mousedown event on nonexistent selector: /login # type: uncaughterror # file: loki1.js:1355 here code: casper.test.begin('signin loki',1,function(test){ casper.start('http://localhost:3000'); casper.evaluate(function() { __utils__.echo("hello world!"); }); casper.wait(100,function(){ casper.echo("debuging"); casper.echo("this:"+this); casper.echo("done"); if (this.exists('headerwrap')) { casper.echo('the heading exists'); } this.click('/login'); ////this not working this.fill('#loginform', { 'login' : 'divya', 'password' : '********' }, false); this html what selector should use click on href=/login <div class="...

pushing into arrays in javascript -

my script (is meant to) grab text page (which works fine) , splits by newline (\n) , puts each splitted string array called "dnasequence"; there loops through each element in array , if string contains character ">" assigns string "var header_name", else pushes other lines new array called "dnasubseq". original text looks this: >header_1 gctagctagc cgcgagcgagc >header_2 gcgcatgcgac when execute code fails alert on anything. here code: function loadermy() { var dnasubseq = []; var dnasequence = []; var header_name = ""; var splittedlines = document.getelementbyid("page-wrapper").innertext; dnasequence = splittedlines.split('\n'); (var = 0; < dnasequence.length; i++) { if (dnasequence[i].match(/>/)) { header_name = dnasequence[i]; alert(header_name); } else { dnasubseq.pushvalues(dnasequence[i]); } alert(dnasubseq); } } change dnasubseq.pus...

javascript - How to get second column value of invoked row in table? -

in below context menu example .. how value of second column invoked it? refer link tried $(this).find('td:second').text() didnt work. :p how this? no need write such long code here. assign class name each <tr> row add click event listener this: $(".row").click(function () { var txt = $(this).children().eq(1).text(); alert(txt); }); jsfiddle

c# - Syncronization of async EF Tasks -

i working on application processes company resources. have ms sql database , working entityframework 6.1.3 , .net4.5. dbcontext has async methods example protected task<int> savechangesasync(); i know dbcontext not thread safe , dont want call async operations intend executed parallel. need free gui thread while polling database. normally go , programm await keywords , "just carefull" not call 2 async operations @ same time application supposed up-to-date. therefor have server connection. everytime other user updates database polling command sent applications working on database. polling command anytime , therefor racecondition user initiated async polling of database. what want queue each task after previous one. dont know how or if idea. far tried working task.continuewith() noticed tasks never starting , therefor wait forever. here code far (_lastrunningtask declared in dbcontext inhereting class , initialized in constructor : _lastrunningtask = task...

java - Why is my code telling me to initialize a variable that is already initialized? -

i have below code: public string palindrome(string str) { string str, reverse = ""; scanner in = new scanner(system.in); int length = str.length(); ( int = length - 1; >= 0; i-- ) reverse = reverse + str.charat(i); if (str.equals(reverse)) system.out.println("entered string palindrome."); else system.out.println("entered string not palindrome."); return ""; } it has init() method calls when character 'p' typed , check whether current string palindromic or not. however ,when compile states there error in line: string str, reverse = ""; the error states variable may not have been initialized. however, when initialize error message comes stating str has been initialized. you have str duplicated, once parameter , once local variable. besides that... string str, reverse = ""; ...does initialize reverse "", not str : string str...

android - jsonObject parsing issue "org.json.JSONException: No value for thumbnails" -

i've got little problem parsing json android app. want thumbnail url , videoid shows no value thumbnails jsonexception , same happens videoid how can do? please this how json file , fragment activity looks like: request url : https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelid=uc_x5xg1ov2p6uzz5fsm9ttw&maxresults=1&key={your_api_key} json response : { "kind": "youtube#playlistlistresponse", "etag": "\"idqj1j7zks4x3o3zsflbowgwahu/qndwmfxnha--i54ealcsqnwg2ok\"", "nextpagetoken": "caeqaa", "pageinfo": { "totalresults": 291, "resultsperpage": 1 }, "items": [ { "kind": "youtube#playlist", "etag":"\"idqj1j7zks4x3o3zsflbowgwahu/ib0xo8j78ybzzvhqq59q2y8wofi\"", "id": ...

java - Swing GUI Builder Intellij IDEA -

i can't seem run form on intellij gui builder exception in thread "main" java.awt.illegalcomponentstateexception: contentpane cannot set null. i assume code initialize views auto generated. right have jpanel , somehow not auto-initialized thought it's visible on designer. it's gradle project , i've chosen run generated main function. what have working? public class myform { private jpanel jpanel; public static void main(string[] args) { jframe frame = new jframe("myform"); frame.setcontentpane(new myform().jpanel); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.pack(); frame.setvisible(true); } } by default, intellij idea ui designer works generating bytecode, unfortunately not supported gradle builds. can change generate source code in settings | editor | gui designer.

powershell - Pin program to taskbar using PS in Windows 10 -

Image
i trying pin program taskbar in windows 10 (rtm) using code: $shell = new-object -com "shell.application" $folder = $shell.namespace((join-path $env:systemroot system32\windowspowershell\v1.0)) $item = $folder.parsename('powershell_ise.exe') $item.invokeverb('taskbarpin'); this worked on windows 8.1, no longer works on windows 10. if execute $item.verbs() , these: application parent name ----------- ------ ---- &open run &administrator &pin start restore previous &versions cu&t &copy create &shortcut &delete rena&me p&roperties as can see, there no verb pinning taskbar. if right click specific file, however, option there: questions: missing something? there new way in windows 10 pin program taskbar? i h...

javascript - How to disable past dates from Bootstrap Datepaginator -

how disable past dates bootstrap datepaginator, want show pagination current date , disable past dates take @ documentation - https://github.com/jonmiles/bootstrap-datepaginator . looks want use startdate option. var options = { startdate: '2015-07-30' } $('#paginator').datepaginator(options); the option either take string (as in example), or moment object ( http://momentjs.com/ ). suggest using moment makes working date objects super easy, , in general addition project works dates. moment() return todays date, re-write above example follows; var options = { startdate: moment() } $('#paginator').datepaginator(options);

javascript - Getting the class name of selector clicked in JQuery ContextMenu -

i using jquery's contextmenu. so have following code: $.contextmenu({ selector: '.item-context, .nitem-context', callback: function(key, options) { // cm.inventorydetails.context_action(key, options); im.events.attach(im.events.events_const.item_context_action,key,options); }, items: { "view": {name: "view", icon: 'view'}, "remove": {name : "remove", icon: 'delete'}, } }); my question is, how can know classname of selector triggered event? your responses appreciated. thanks. try in callback function: var classname = options.items[key].$node[0].classname; hope helps. regards

output - How to replace phpunit assertion message? -

how replace assertion error message? if call $this->asserttrue(false, 'message') , display both string "message" , message stating false not true. how only output message chose? possible? code-crutch comes mind when faced same problem: public function asserttrue($condition, $message = '') { if (!$condition) $this->fail($message); }

r - Assign values to an "offset" diagonal in a matrix -

if have matrix x of arbitrary dimensions, example: [,1] [,2] [,3] [,4] [,5] [1,] 0 0 0 0 0 [2,] 0 0 0 0 0 [3,] 0 0 0 0 0 [4,] 0 0 0 0 0 [5,] 0 0 0 0 0 and want change 0s 1s starting column , moving 1 down , 1 right until end last column. if start column [,3] change result in [,1] [,2] [,3] [,4] [,5] [1,] 0 0 1 0 0 [2,] 0 0 0 1 0 [3,] 0 0 0 0 1 [4,] 0 0 0 0 0 [5,] 0 0 0 0 0 i thought maybe x[,3:ncol(x)][1:ncol(x)] <- 1 gave me [,1] [,2] [,3] [,4] [,5] [1,] 0 0 1 0 0 [2,] 0 0 1 0 0 [3,] 0 0 1 0 0 [4,] 0 0 1 0 0 [5,] 0 0 1 0 0 we use row/column indexing. suppose if arbitrary column start 'n', create sequence column last column ('n1'), cbind sequence of 'n1', use subsetting 'x' , replace val...

ios - Connect external Twitter account Xcode -

hi ios app connect external twitter account (not own). don't have twitter account , therefore cannot connect through settings in simulator. want users view , post external one. possible. instance possible view , tweet bbc twitter feed. advice , url settings appreciated. well, viewing list easy: add uiwebview , load url: https://mobile.twitter.com/bbc or one: https://mobile.twitter.com/hashtag/bbc if want search hashtags. i wouldn't recommend tweeting external account. if possible, bet attract lots of spam.

node.js - MongoDB insert operation returns WriteResult instead of inserted doc -

i want '_id' of newly inserted document in mongodb. finding solution get _id of inserted document in mongo database in nodejs tried simple code in mongo shell: var order = { number: 2, completed: false }; db.orders.insert(order, function(err,docsinserted){ console.log(docsinserted); }); but next: writeresult({ "ninserted" : 1 }) what wrong here? the answer/method trying utilise referring api mongodb driver node.js . equivalent expression in mongo shell return write result (the callback won't work in shell). to review inserted document in shell, still need make use of find suggested here in docs.

Android: enable copy in Textview -

i have linearlayout lot of textviews, need enable copy clipboard. need copy layout don't know how?? i tried use android:textisselectable . in textview getting error message: 01-06 16:58:18.976: d/androidruntime(2991): shutting down vm 01-06 16:58:18.976: w/dalvikvm(2991): threadid=1: thread exiting uncaught exception (group=0x2b542210) 01-06 16:58:18.986: e/androidruntime(2991): fatal exception: main 01-06 16:58:18.986: e/androidruntime(2991): java.lang.runtimeexception: unable start activity componentinfo{com.quraan.tajweed/com.quraan.tajweed.esti3azah}: android.view.inflateexception: binary xml file line #34: error inflating class <unknown> 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.performlaunchactivity(activitythread.java:1967) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1992) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.acc...

Selenium Automation Testing -

i have webpage textbox field. calender icon near it. when click on calender icon calender view displayed. angularjs datepicker. can provide example automate type of date pickers. (while automation proceeds reaches calender opens calender , automation cannot proceeded.) try pass value directly input box in date picker value store after selecting date in date picker <input type="text" name="deliverydate" value="30/07/2015"> if text box taking date , if u click on text box open date picker, insted of clicking on text box try pass value directly below webdriver.findelement(by.name("deliverydate")).sendkeys("30/07/2015");

javascript - XPages events onStart and onComplete in conjunction with dojo.connect -

i use xp:eventhandler events onstart , oncomplete in conjunction dojo.connect . take @ code snippet: <xp:scriptblock id="scriptblock1"> <xp:this.value><![cdata[ dojo.connect(dojo.byid("#{id:btnsubmit}"), "onclick", callbackonclick); dojo.connect(dojo.byid("#{id:btnsubmit}"), "oncomplete", callbackoncomplete); function callbackonclick() { alert("onclick works!!!"); } function callbackoncomplete() { alert("oncomplete works!!!"); } ]]></xp:this.value> </xp:scriptblock> <xp:button value="submit" id="btnsubmit"> <xp:eventhandler event="onclick" submit="true" refreshmode="norefresh"> <xp:this.action><![cdata[#{javascript:// on server side}]]></xp:this.action> <!-- <xp:this.oncomplete><![cdata[alert("oncomplete");]]>...

javascript - How is the array syntax supposed to work with Angular's $routeParams service? -

i'm learning javascript. in course, there following task: inject routeparams service notesshowcontroller access id in url. i wrote code: angular.module('notewrangler') .controller('notesshowcontroller', [function($http, $routeparams) { var controller = this; $http({method:'get', url:'/notes/' + $routeparams.id}) .success(function(data){ controller.note = data; }); }]); but error - teaching system says make sure you're injecting $routeparams service correctly array syntax. what's wrong $routeparams injection? you need update .controller('notesshowcontroller', [function($http, $routeparams) { to .controller('notesshowcontroller', ['$http', '$routeparams', function($http, $routeparams) {

playframework - Typesafe subscription confuse -

i started learn reactive platform , research tutorial templates. basic tutorial started normally. then began research reactive-maps tutorial , activator says need free trial subscribtion within learning , should pay production subscription. confused. should pay? should pay production of project growth basic template reactive-maps functionality? can prevent me move functionality 1 basic template? pay - parts of reactive opensource? see this . just obtain free trial subscription , create typesafe.properties subscription id in.

paypal php credit card payment returns 401 -

i'm trying make credit card payment via paypal rest api services, can grab access token, every time try make credit card payment 401. my sample works perfect on .net not on php. please advice $json = '{"intent":"sale","redirect_urls":{"return_url":"","cancel_url":""},"payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"4417119669820331","type":"visa","expire_month":11,"expire_year":2018,"cvv2":"874","first_name":"betsy","last_name":"buyer","billing_address":{"line1":"111 first street","city":"saratoga","state":"ca","postal_code":"95070","country_code":"us"}}}]},"transactions":[{...

laravel - Query a relationship with where - let result affect parent? -

i query relationship: return user::with(array('product' => function($q){ $q->where('published', 1); }))->get(); if product not published, relationship null. if product not published, want not return user. for example, query should users have published product. if user not have published product, not return them. is possible? or have checking on view , not output user if product null? so if understand correctly want return users have product published? if you're looking wherehas() function, allows return results of parent model based on parameters of relation. return user::wherehas('product', function($query) { $query->where('published', true); })->get();

how to construct properties list with defaults in java? -

this code: import java.util.properties; public class p { public static void main(string[] args) { properties defaultproperties=new properties(); defaultproperties.put("a",1); system.out.println("default: "+defaultproperties); properties properties=new properties(defaultproperties); system.out.println("other: "+properties); } } prints: default: {a=1} other: {} using java 8 in eclipse luna. how should 1 construct properties list defaults? the 2 problems code. the default properties don't work when use get() , put() . you instead need setproperty() , 'getproperty()`. when print properties file, wont include default properties. tostring() method not sophesticated. use instead: properties defaultproperties=new properties(); defaultproperties.setproperty("a","s"); system.out.println("default: "+defaultproperties); properties properties=ne...

c# - Quartz.net Schedular working on local host but not working on shared hosting -

i using quartz scheduling tasks in web site project. jobs getting executed when run locally visual studio , when upload website on shared hosting doesn't work. can 1 tell me reason behind ? public class jobschedular { private static ischeduler scheduler = stdschedulerfactory.getdefaultscheduler(); public static void start() { scheduler.start(); ijobdetail sendweeklymailjob = jobbuilder.create<sendweeklymailjob>().build(); ijobdetail sendquartermailjob = jobbuilder.create<sendquarterlymailjob>().build(); //itrigger sendweeklymailjobtrigger = triggerbuilder.create() // .withidentity("sendweeklymailjob", "sendweeklymailjobtrigger") // .withschedule(cronschedulebuilder // .weeklyondayandhourandminute(dayofweek.monday, 5, 15)) // .build(); itrigger sendquartermailjobtrigger = triggerbuilder.create() .withidentity("sendquartermailjob...

javascript - Tabs in Angular Bootstrap -

Image
i'm trying display couple of tabs using angular bootstrap, cannot see content displayed. see blank white page. where wrong? html- <html ng-app = 'myapp'> <head> <title>chat</title> </head> <body> <div ng-controller="tabs"> <tabset> <tab heading="static title">static content</tab> <tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active"> {{tab.content}} </tab> </tabset> </div> <script src="node_modules/angular/angular.js"></script> <script src="node_modules/angular-bootstrap/ui-bootstrap.js"></script> <script src="app.js"></script> </body> </html> app.js: controller here var myapp = angular.module('myapp',['ui.bootstrap']); myapp.controller('...

c# - Why was the web service task canceled and how do I find out? -

when i'm trying log in website using online web service wrote, don't see happening @ all... i should point out works 100% when run localhost. in login: private async task dologin(string emailaddress, string password) { using (var client = new httpclient()) { client.baseaddress = new uri(serviceurl); client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); user u = new user() { emailaddress = emailaddress, password = password }; httpresponsemessage response = await client.postasjsonasync("api/user/login", u); if (response.issuccessstatuscode) { u = await response.content.readasasync<user>(); if (u.role.rolename == "admin") { generatecookie(u); } ...