Posts

Showing posts from August, 2014

angularjs - How to pass dropdown data with other object in Angular js -

i need pass select list data other forms value . there problem when passing there 2 objects how pass values . can solve angular code var app = angular.module('projectmdl', []); app.controller('projectcontroller', function ($scope, projectservice) { $scope.action = 'add'; getcustomer(); loadprojects(); function getcustomer() { projectservice.getcustomerdetails().then(function (d) { $scope.customers = d.data; }, function () { alert("error loading customer details"); }); } function loadprojects() { projectservice.loadproject().then(function (d) { $scope.prjects = d.data; }, function () { alert("error loading project details"); }); } $scope.saveproject = function () { var r = confirm("are sure want insert ?") if (r == true) { if ($scope.action == 'add') {

java - Spring Data Jpa Query dsl with fetch join -

is possible specify join fetch when using querydsl , spring data repository? no, there's no keyword in spring data jpa trigger fetch. can write custom repository , implement query using querydsl there.

Kotlin, high-order function trouble -

i have following ho function on matrixstack inline infix fun run(block: matrixstack.() -> any): matrixstack { push() block() pop() return } and somewhere else, have method trying return intermediate result calculated in block() fun getsphereorbitpos(modelmatrix: matrixstack, orbitcenter: vec3, orbitaxis: vec3, orbitradius: float, orbitalpha: float): vec3 { modelmatrix run { translate(orbitcenter) rotate(orbitaxis, 360.0f * orbitalpha) var offsetdir = orbitaxis cross vec3(0.0f, 1.0f, 0.0f) if (offsetdir.length() < 0.001f) offsetdir = orbitaxis cross vec3(1.0f, 0.0f, 0.0f) offsetdir.normalize_() translate(offsetdir * orbitradius) // i'd return, top() = matrixstack.top() return (top() * vec4(0.0f, 0.0f, 0.0f, 1.0f)).tovec3() } } // return error if declare external variable fun getsphereorbitpos(..): vec3 { var result = vec3() modelmatrix run {

Is it possible to subscribe to JMS queue on Universal Messaging webmethods enterprise server 8.2 using Hermes JMS -

i have found detail version 8.2 not have universal messaging...is there way of doing it? http://serviceorientedarchitect.com/how-to-test-jms-processing-in-webmethodsterracotta-universal-messaging-and-integration-server-with-soapui-and-hermesjms/ universal messaging supports & provides apis connect universal messaging jms server different platforms. these can leveraged connect webmethods 8.2 universal messaging jms servers. check below link details. universal messaging developer guide

c# - Pass generated HTML to a view and replace links with Url.Action -

i have requirement display webpages stored in database part of mvc project. lets have index page (stored in db) link points page1.html (also stored in db) <a href="page1.html"> . have controller (call webpagegenerator) takes page name argument, retrieves html database, manipulation , passes resulting string view. view nothing more <div class="generatedpage"> @html.raw(viewbag.pagedata) </div> (yes i've realised shouldnt use viewbag etc etc i'll deal later unless of course somehow cause of problems...) if pass along html example index page, link page1 not work. if instead somehow pointed localhost:port/myproject/webpagegenerator/page1.html work. i've spent last day struggling different variations of url.action pass view, nothing working. my controller looks following [httpget, actionname("index")] public actionresult webpagegenerator(string id) { stringbuilder pagetext = gethtmlfromdb(id); string linkname

php - tokenize multiselect searched text not cleared after select particular element -

Image
please on attached image clear question <select multiple="multiple" class="tokenize-sample" name="state_live[]" id="state_live"> <option value="">select category</option> <?php $que = $this->db->query("select * state "); foreach($que->result_array() $row_val) { ?> <option value="<?php echo $row_val['id'];?>"<?php if(isset($row_about['state_live']) && in_array($row_val['state_name'],explode(",",$row_about['state_live']))){echo "selected";}?>><?php echo $row_val['state_name'];?></option> <?php } ?> </select>[enter image description here][1]

javascript - UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeEr ror: Cannot read property 'map' of null -

so i'm creating bot using discord.js-commando. everything's working fine until try , sendembed, error (node:25390) unhandledpromiserejectionwarning: unhandled promise rejection (rejection id: 2): typeer ror: cannot read property 'map' of null (node:25390) deprecationwarning: unhandled promise rejections deprecated. in future, promise rejections not handled terminate node.js process non-zero exit code. i tried add .then , .catch, no luck far. because have no clue how make promises work. >_> i use following code bot i'm working on seems getting issue. const commando = require("discord.js-commando"); const modulestuff = module class test extends commando.command { constructor(client) { super(client, { name: 'test', aliases: ['testing'], group: 'random', membername: 'test', description: 'testing', examples: [ 'test' ] }); } async run(mes

Php & Angularjs Ajax : What is the proper way to retrieve data from ajax request to php? -

just wan't ask how can retrieve data ajax request php api when coded : controller : $scope.addcustomer= function() { indexservice.addcustomer($scope.persons) .then(function(response) { console.debug('response :', response); }).catch(function(error) { console.debug('error :', error); }); } service : function addcustomer(data) { return $http({ method:'post', url: 'php/api/customer.php', data: data, datatype: 'json', contenttype: 'applications/json' }); } i tried php file telling me undefined index 'data' $data = $_post['data'] question : proper way retrieve data ajax call going php file? thank you

TupleWindow Start/End Time in Apache Storm -

i have been developing profilling application works on cdr(call detail record) data in apache storm. application's main purpose extracting of caller totalcallcount , totalcallduration during specified time block(in every window). profilling want use slidingwindow technique. to understand can @ following image slidingwindow image for profilling need know when tuplewindow started , ended . mean timestamp of tuplewindow or timestamp of slidingwindow start , end. even if looked implementation of storm, couldn't find that. me how can figure out? thank much if using 1.x release of apache storm, information not directly accessible via tuplewindow. have manually calculate this. e.g. public class mybolt extends basewindowedbolt { ... long slidinginterval; @override public basewindowedbolt withwindow(duration windowlength, duration slidinginterval) { this.slidinginterval = slidinginterval.value; return super.withwindow(windowlength, slidingi

angular - Routing from one child route to another and then back to 1st child route -

in application there scenario route 'createcontrol' route 'createform' route (which sibling of 'createcontrol'). works expected , 'createform' screen loaded. if condition met route 'createcontrol' route not working. happens when 'createform' route routed 'createcontrol'. is there issue route sibling routed in first place? definition routes { path: 'projects/learningconsole', component: learningconsolecomponent, children: [ { path: 'createdocument', component: createdocumentcomponent, outlet: 'r1' }, { path: 'createform', component: createformcomponent, outlet: 'r1' }, { path: 'editform', component: editformcomponent, outlet: 'r1' }, { path: 'createcontrol', component: createcontrolcomponent, outlet: 'r1' } ] } also note no error in console. screen remains , url doesn't change indicate r1:create

gnuplot cuts off fractional digits -

i want plot stockpile data. data located in csv-file , got accurate plot, reading file isn't problem. set terminal pdf set output "gnuplot/".matnum."-2012.pdf" set datafile separator ";" stats 'stock-2012.csv' every ::4::18 using matnum nooutput set border 3 set tics nomirror set xzeroaxis set xrange[0:14] set xtics 1,1,13 set xtics rotate 90 set ylabel matunit maxplot = sprintf("amount max:\n%.2f ".matunit, stats_max) plot 'stock-2012.csv' every ::4::18 using ($0+1):matnum:xticlabels(2) linespoints title "amount", stats_max lines lc rgb 'blue' title maxplot where matnum , matunit commandline arguments, representing materialnumber (which columntitle in datafile) , unit in material measured. the x-values in datafile decimals, gnuplot seems cut off fractional digits. example 12,98 (commata used decimal separator, because it's german stockpile) results in datapoint @ y=12. i'm not sure

php - apache rewrite rule with multiple parameters -

i'm new .htaccess things, i'm trying make that. localhost/easyapy/?tablename=%tablename% => localhost/easyapi/%tablename% localhost/easyapy/?tablename=%tablename%&action=get&id=%id% => localhost/easyapi/%tablename%/get/%id% localhost/easyapy/?tablename=%tablename%&action=delete&id=%id% => localhost/easyapi/%tablename%/delete/%id% localhost/easyapy/?tablename=%tablename%&action=update&id=%id% => localhost/easyapi/%tablename%/update/%id% localhost/easyapy/?tablename=%tablename%&action=add => localhost/easyapi/%tablename%/add thanks! :) you looking that: rewriteengine on rewriterule ^/?easyapi/(\w+)/get/(\d+)/?$ /easyapi/index.php/?tablename=$1&action=get&id=$2 [l] rewriterule ^/?easyapi/(\w+)/delete/(\d+)/?$ /easyapi/index.php/?tablename=$1&action=delete&id=$2 [l] rewriterule ^/?easyapi/(\w+)/update/(\d+)/?$ /easyapi/index.php/?tablename=$1&action=update&id=$2 [l] rewriterule ^/?easyapi/(\w+)

php - How can I keep the URL id on submit? -

when click submit, data submitted database url id of book disappears ---- book.php i want url go id of page e.g. ----book.php?id=3 is possible keep first line action="<?php echo htmlspecialchars($_server["php_self"]);?>" , add value="<?php echo $book_id ?>" ? <form method="post" action="<?php echo htmlspecialchars($_server["php_self"]);?>"> <input type="hidden" value="<?php echo $book_id ?>" name="book_id" /> <p>author: <input type="text" value="<?php echo $_session['author']; ?>" name="author" id="author" readonly /></p> <p>summary: <input type="text" name="summary" value="<?php echo $summary;?>" /></p> <p><input type="submit" name="submit" value="submit" /></p>

java - RxJava. Correct way to generate ViewObject by few sources -

i have 2 entity classes, stores in sqlite : userentity , sessioninfoentity : public class userentity{ private long id; private string username; // .... } public class sessioninfoentity{ private long id; private date beginsessiondate; private date endsessiondate; // .... } user can have many sessions (one-to-many relation). i have repository, provides necessary methods data (rxjava observables) sqlite database: public class myrepository{ public observable<list<userentity>> getallusers(){/* ... */} public observable<sessioninfoentity> getlastsessioninfoforuser(long userid){/* ... */} // returns info of last session user id=userid } i need generate next viewobject each user, using myrepository 's methods , rxjava : public class userviewobject { private string username; private integer lastsessiondurationinhours; // .... } in turns out need call getlastsessioninfoforuser() each user in order create

php - How to get the contents of a specific page from controller in CodeIgniter? -

i want create dynamic page using codeigniter framework. when click link, creates link depends on id. didn't show contents in page. showed "object not found." how can connect controller , view here? $route['report/:any/:num'] = "home/reportcard"; here code: controller: public function index(){ $this->load->model("item_model"); $data['records'] = $this->item_model->getallitems(); $this->load->view('home',$data); } function reportcard(){ $this->load->view('main'); } view created link depends on id: <div class="row"> <ul class="home-grid"> <?php foreach ($query->result() $row): ?> <li> <a href="<?php echo base_url() ?>report/<?=$row->item ?>/<?=$row->id ?>" class="btn btn-lg btn-warning view-re

swift - How to use MTLBlitCommandEncoder for copying interlaced video fields into a MTLBuffer -

we working interlaced hd video. metal color attachment use rendering has dimensions of 1 field (1920*540 rgba). when try copy 2 rendered fields same mtlbuffer has size of 1920*1080*4 = 8294400 bytes works if destination offset zero. let commandbuffer = commandqueue.makecommandbuffer() let blitencoder = commandbuffer.makeblitcommandencoder() blitencoder.copy(from: attachmenttexture, sourceslice: 0, sourcelevel: 0, sourceorigin: mtloriginmake(0, 0, 0), sourcesize: mtlsizemake(attachmenttexture.width, attachmenttexture.height, 1), to: destinationbuffer, destinationoffset: 1920*4, destinationbytesperrow: 1920*4*2, destinationbytesperimage: destinationbuffer.length) blitencoder.endencoding() commandbuffer.commit() for first field destination offset 0 function works well. destination buffer filled every second row. but when want write second field

single sign on - SSO CAS : Session Expiry -

i bit confused whats ideal way of single sign out. in our application use cas central authentication. have 2 applications(app1,2) user logged in. assuming timeout apps 30 mins,and user continues working on app1 , keeps app2 idle 30 mins. after 30 mins - should app1 , app2 both logged out cas(initiated app2 probably) or should app2 considered active same logged in user still using app1?

javascript - How to apply cdnjs css or external css to nodemailer html template using jade & express -

i'm trying send mail using node mailer. getting html mark jade template through external file.external file html compiled using file stream , rendering whereas style whichever inserted through maxcdn or cdnjs not reflecting in case how apply css or there other alternate way achieve scenario. jade template doctype html html head title application confirmation link(rel='stylesheet', type='text/css', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css') body .container .row .col-md-4 p thank registering applucation submitted succesfully .row .col-md-4 p thanks, p snapcode team node server code var nodemailer = require('nodemailer'); var config_urls = require("../configfile"); var fs = require('fs'); var jade = require('jade'); function readfile() { var template = process.cwd() + '/public/mailtemplate/confir

vb.net - Full recordset copy from sql to excel using vbscript -

experts please clarify doubt. i have vb script copy 65 columns of resultset of stored procedure call (which returns 68 columns) excel sheet. my stored procedure query returns complete recordset, couldn't complete resultset using vbscript. tried specify every column want, tried counting columns alone 50 columns getting excel, not full recordset. and why first 50 columns, not whole set? thanks in advance. i tried display headers in excel (only 50 fields displayed) for = 1 rstcostbase.fields.count worksheet.cells(i, 1).value = rstcostbase.fields(i).name next looping through individual row , column got 50 columns data. assumption : either 1) you're working activex data objects (adodb) or 2) recordsets in vb work similarly... some time ago found approach on web extract recordsets string in standard .csv formatting. have go , see if helps out. function recordsettocsv(rsdata adodb.recordset, optional showcolumnnames boole

curl - How can I delete multiple data in specific index in elasticsearch -

i need delete multiple record in specified index/type. follow document stil have same issue i need delete documents in gvisitor type in g_visitor index, follow below command curl -xdelete http://10.1.2.10:9200/g_visitor/gvisitor its throw below error no handler found uri [/g_visitor/gvisitor] , method [delete] then follow install delete query plugin , try remove documents , curl -xdelete 'http://10.1.2.10:9200/g_visitor/gvisitor/_delete_by_query?conflicts=proceed' -d '{ "query" : { "match_all" : {} } }' its throw below error: { "found":false, "_index":"g_visitor", "_type":"gvisitor", "_id":"_delete_by_query", "_version":1, "_shards":{ "total":2, "successful":1, "failed":0 } } suggeset me, how can delete multiple or documents in

Laravel 5.4 Error 500 on all but Front Page -

i have functioning laravel app developed locally. moved onto server via ftp (just show feedback). i changed app_url in .env subdomain pointing /public folder. changed database information. else left is. i can access front page without problem. else (e.g. /login or ajax other controller) results in server error 500 leaves no trace in server error logs. when assign different routes / displayed. can show pages pull data database, not issue. both local development , server run apache on linux. any pointers? update: thank suggestions far. cannot access server via ssh (not server). i'm working on getting set , try solutions can. make sure web-server has read , write permissions following folders public bootstrap/cache storage if web-server not have these permissions cannot compile views, store session data, write log files or store uploaded files. set webserver owner: assuming www-data webserver user. sudo chown -r www-data:www-data /path/to/directory

php mongodb findandmodify not working -

i using php , mongodb. want use findandmodify. field { "_id" : objectid("58d37e612d4ffa498b99c2d4"), "userid" : "1234", "active_time" : "hai" } i want modify active_time. example change value "hai" "1234" i using mongodb\driver\manager. try { $mng = new mongodb\driver\manager("mongodb://username:password@localhost:27017/db"); $userid = '1234'; $retval = $mng->findandmodify( array("userid" => $userid), // searchquery array('$set' => array('active_time' => "kkk")) // updatequery ); $command = new mongodb\driver\command($retval); $cursor = $manager->executecommand('db.online', $command); } catch (mongodb\driver\exception\exception $e) { $filename = basename(__file__); echo "the $filename script has experienced error.\n"; echo "it fail

java - Too many mq connections for a server connection channel which are not created by queue -

as per our configuration, have version 8.5.5.11, ibm mq version 7.5.0.3. using 2 channels connect wmq, 1 maxinst set 250 , 1 500. sharecnv set 10 both. have upper limit of making maximum 2000 connections in queue manager end crossing limit after 3-4 days of continuous running of server. after doing analysis can see @ point of time have 120-160 active connections. dis conn command gives shows lot of connections objname, objtype empty , astate "none". these connections made our server ip seems not created queues objtype not queue these connections. these connections keep on growing on period of time , reach our limit of 2000 connections. can in identifying why these connections getting created , make sure closed normal idle connections. how connection made , closed in application: have abstrack bean class extended mdb's. @messagedriven(activationconfig = { @activationconfigproperty(propertyname = "acknowledgemode", propertyvalue = "auto-acknowledge&qu

xero api - Get all journals for Demo UK -

i'm attempting read journals associated demo uk company repeatedly end same data. i'm calling journals endpoint multiple times seem end same data. api documentation: a maximum of 100 journals returned in response. use offset or if-modified-since filters (see below) multiple api calls retrieve larger sets of journals code snippet use journals seen below - reckon beginner mistake help/guidance appreciated. list<journal> batchjournals; list<journal> alljournals = new list<journal>(); int skip = 0; var journalsendpoint = m_api.journals.offset(skip); while((batchjournals = journalsendpoint.find().tolist()).count > 0) { alljournals.addrange(batchjournals); skip += batchjournals.count; journalsendpoint = journalsendpoint.offset(skip); //get next 100 journals } just came across , noticed nobody had answered. you've figured out now. journal numbers on demo company may not start @ 0 depending on first journal number same data each

html - How to remove this horizontal scrollbar in Bootstrap 3 -

i've got irritating horizontal scroll on bootstrap page. can't figure out making behave or it? jsfiddle link: http://jsfiddle.net/fatalbert/cd1syrd9/2/ html: <body> <div class="wrapper"> <div class="row"> <div class="header"> <div class="container"> <!-- navigation--> <nav class="navbar navbar-default"> <div class="container-fluid"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">meny</button> <a class="navbar-brand" href="#"><img src="xxx" /></a> <div class="collapse navbar-co

.net - c# Getting runtime error. Why? -

hey im trying solve problem kattis says runtime error means uncaught exception. https://open.kattis.com/problems/fizzbuzz is there ive missed in code crashes app? public static void main(string[] args) { string line = ""; while ((line = console.readline()) != "0") { var numbers = line.split(' ').select(int.parse).tolist(); int x = numbers[0]; int y = numbers[1]; int n = numbers[2]; for(int = 1; <= n; i++) { bool found = false; bool found2 = false; if(i % x == 0) { if(i % y==0) { console.writeline("fizzbuzz"); found2 = true; } else { console.writeline("fizz"); found = true; } } if(i % y == 0 &&

r - "Error: Aesthetics must be either length 1 or the same as the data (1148) ...." Why? -

Image
wickham (2009: 164-6) gives example of plotting multiple time series simultaneously. following code replicates example: range01 <- function(x) { rng <- range(x, na.rm = true) (x - rng[1])/diff(rng) } emp <- subset(economics_long, variable %in% c("uempmed", "unemploy")) emp2 <- ddply(emp, .(variable), transform, value = range01(value)) qplot(date, value, data = emp2, geom = "line", color = variable, linetype = variable) # produces plot looks 1 on p. 166 of ggplot2 book. here range01 used recode variables values within [0,1] series different orders of magnitude can plotted on identical scales. wickham's original starts employment data provided ggplot2 , melts long form, here i've taken shortcut of starting employment_long version. but wickham (p. 27) points out tapping "full power" of ggplot2 requires manual construction of plots layers, using ggplot() function. here example again using

asp.net - I have deleted app_data folder accidentally -

i have deleted app_data folder accidentally project in visual studio 2015. generated automatically , database files there in it. want folder back,so can me how in project. i'm leaning on more positive side, assume you've removed folder vs project solution explorer. you add clicking on show file button show file and include app_data folder.

javascript - Invalid regular expression in HTML5 input pattern -

i need use regular expression in html input (taken regular expression list of items separated comma or comma , space ): [^,\s][^\,]*[^,\s]* so set in input: <input type="text" class="form-control" id="input" name="input" data-ng-model="mymodel" pattern="[^,\s][^\,]*[^,\s]*"> but error in console: pattern attribute value [^,\s][^\,]*[^,\s]* not valid regular expression: uncaught syntaxerror: invalid regular expression: /[^,\s][^\,]*[^,\s]*/: invalid escape what wrong regex? i'm using angular 1.5 btw. you need remove escaping backslash before comma , use pattern="[^,\s][^,]*[^,\s]*" it necessary since ff , chrome compile pattern regex using es6 regex syntax specifications, , use /u modifier when compiling regexp object. lays restrictions on pattern. in case, regular symbol, not special metacharacter, comma, escaped inside character class. thus, removing escape solves issue.

qt - rounded buttons of QMessageBox -

Image
i using qmessagebox ask if user wants close application. void mainwindow::closeevent (qcloseevent *event) { qmessagebox::standardbutton reply; reply = qmessagebox::question(this, "exit", "are sure want exit?", qmessagebox::yes|qmessagebox::no); if (reply == qmessagebox::yes) { event->accept(); } else { event->ignore(); } } i trying round yes/no buttons changing stylesheet to qmessagebox qpushbutton{ border: 1px solid black; border-radius: 10px; } however piece of code changes to how make rounded buttons more proper size? you have not given definite size in css rule; have define width , height of buttons or you add padding dimensions adjust relatively .

excel vba - VBA script for managing inventory levels -

Image
i have been trying quite time make interactive worksheet tracks inventory levels , kicks in production when drops set lower bound value. for example, given on 24 hours consumption rate 10 items per hour starting inventory of 100 , minimum stock level of 20. hits 20, want excel automatically kick in production mode , produce @ specific rate (formula) {example: @ rate of 20 items/hour). during time consuming, net increase in stock 10 items/ hour. reach upper bound should stop production , continue downwards count. i have production color coded blue , consumption red. vba script reads font color , determines how many people need produce @ given hour (sum of cells blue text). i have different production rules, example, small job produced 6 hours , repeated after 22 hours. based on consumption rate. need vba can automatically fill in schedule based on set rules. currently, fill in cells according these rules while manually keeping total production hours below given constant (sum