Posts

Showing posts from July, 2013

angularjs - How to fire fluent Validation only on Reject Button Click -

i using simple angular form fluent validations. having 2 button. 1 save , reject , below have reject reason textbox. in fluent validations using validate reject reason if empty. but problem getting save button click validating reject reason empty. want validate when click reject reason button. rulefor(i => i.rejectreason) .notempty() .withmessage("reject reason required")); what tried having flag when button clicked making flag true can validate message problem after enter reject reason , hit reject button flag still true , validating me message. correct way or how shall validate below have tried rulefor(i => i.rejectreason) .notempty() .when((i) => { return i.showrejectreason; }) .withmessage("reject reason required");

python - Accessing Firebase DB from Google App Engine -

i having trouble accessing firebase db gae app. works fine when running locally, deployed gae (*.appspot.com) unauthorized error firebase. there obvious thing missed... this _get_http() function use. works fine (after doing gcloud beta auth application-default login ) def _get_http(): _firebase_scopes = [ 'https://www.googleapis.com/auth/firebase.database', #'https://www.googleapis.com/auth/userinfo.email' ] """provides authed http object.""" http = httplib2.http() # use application default credentials make firebase calls # https://firebase.google.com/docs/reference/rest/database/user-auth creds = googlecredentials.get_application_default().create_scoped(_firebase_scopes) creds.authorize(http) return http the error firebase is: {u'error': u'unauthorized request.'} the log gae looks includes this: 11:14:43.835 attempting refresh obtain initial access_token 11:14:

r - Error in `colnames<-`(`*tmp*`, value = "0") : attempt to set 'colnames' on an object with less than two dimensions -

i new r , having trouble error. data: datekey horseno winner draw winodds age 65529 1 0 1 10.34 7 65529 2 0 6 22.15 7 65529 3 0 2 53.13 8 65529 5 0 8 9.71 4 65529 6 0 9 2.74 4 65529 7 1 12 9.92 5 65529 8 0 5 150.81 6 65529 9 0 4 6.58 4 65529 11 0 3 16.19 6 65529 12 0 10 61.64 4 65529 13 0 11 31.03 4 65529 14 0 7 919.51 7 65598 1 1 1 2.65 7 65598 2 0 2 8.62 7 65598 3 0 6 26.3 8 65598 5 0 7 7.58 4 65598 6 0 9 97.64 4 65598 7 0 5 271.17 5 65598 8 0 11 97.64 6 65598 9 0 3 13.96 4 65598 11 0 4 54.56 6 65598 12 0 8 6.34 4 65598 13 0 10 91.23 4 65598 14 0 12 18.74 7 > library(rodbc) > library(mlogit) > z<-odbcconnectexcel("c:\\users\\andrewc\\desktop\\test4.xls") > y<-sqlfetch(z,"sheet2") > x<-mlogit.data(y,ch

ember.js - Difference between Controller and Route in emberjs -

this has been confusing me since started using ember js. using ember js 2.11 (as shown in package.json "ember-cli": "2.11.1" ) i trying emit onclick action component route , got error "an action named 'getdetails' not found in generated controller" when had action named getdetails in route. i have read ember 2.0+ controller has been deprecated , route made same purpose. please clarify. controllers not yet deprecated. use them as documented , once become deprecated, there clear , painless upgrade path. when send action {{action "getdetails"}} template not component's template, controller default action handler. phrase generated controller in error tells didn't create one, ember did work creating anonymous controller. definition, has no actions, properties or anything. create controller, if want handle action. or, if want handle action on route (or 1 of parent routes), use ember-route-action-helper addon.

openstack kilo vnc mouse can not use leftclick -

everyone: openstack kilo,vmware vcenter6.0,and feature ok. in instance console, found ,mouse can move ,but can not use leftclick,but can use rightclick mouse fixed on icon:"compuetr". , nova.conf vnc configs : novncproxy_base_url=http://192.168.0.24:6080/vnc_auto.html xvpvncproxy_base_url=http://192.168.0.24:6081/console xvpvncproxy_host=192.168.0.24 xvpvncproxy_port=6081 novncproxy_host=192.168.0.24 novncproxy_port=6080 vncserver_listen=192.168.0.24 vncserver_proxyclient_address=192.168.0.24 vnc_enabled=true vnc_keymap=en-us memcached_servers=localhost:11211 so how ? can not find in google confused can canyone give advice , thank very !!!

Javascript constructor functions different patterns -

this question has answer here: javascript why wrap variable or constructor in iife? 2 answers what's difference between 2 code snippets below. understand second 1 uses iife, unable understand what's benefit of 1 on other. can please explain. //first******* var student=function student(name) { this.name = name; } student.prototype.printmessage = function () { console.log(this.name); }; var st = new student("test"); st.printmessage(); //second** var student = (function () { function student(name) { this.name = name; } student.prototype.printmessage = function () { console.log(this.name); }; return student; }()); var st = new student("test"); st.printmessage(); in simple example, there no advantage using iife. purpose of such construction if had variables other student didn't want expose global scope.

angular - Implementing "Someone is typing..." functionality in chat application using firebase cloud pub/sub -

i have ported web version of friendlychat example angular 4 suite. can see mine live over here , appears working okay... shall publish opensource shortly. now want implement feature such when user starts typing in realtime, user b should see "user typing...." message. , when user stops typing message should disappear. obviously, user shouldn't see message if himself typing. i considering having object in db so: { "istyping":true, "fromdevicetoken": "xxxx" } ... , altering istyping field using firebase realtime. any better ideas how can achieve this? comments/improvements? my main question is, can firebase cloud pub/sub trigger used without persisting typing state in db .. if so, how? you try this: this.messageinput.onkeyup = function(){ when user starts typing update database , set istyping true. dont forget check if istyping set true not update every time user presses key } sample got her

android - Java Regex Extract String between two Strings -

the problem i have pattern "nom ? oscars" or "nom 2 golden globes. nom ? oscars. 30 wins 18 nominations" , want determine ? regex, amount of oscars. what tried it seems there corresponding questions: extract string between 2 strings in java , how find value between 2 strings? tried pattern: final pattern pattern = pattern.compile("for(.*?)oscar"); next tried following question: java - best way grab strings between 2 strings? (regex?) final pattern pattern = pattern.compile(pattern.quote("nom") +"(.*?)"+ pattern.quote("oscar")); the rest of code: final matcher matcher = pattern.matcher("nom 3 oscar"); while(matcher.find()){ } log.d("test", matcher.group(1)); all of these pattern result in exception: java.lang.illegalstateexception: no successful match far i think oversee simple. can guys me ? edit so problem call matcher.group(1) after loop. missundersto

javascript - Set multiple states in setState - React.js ES6 -

how add name const second setstate method? in order increment currentcompany must include prevstate. when attempt add name const not work. const name = company.word; this.setstate({ name }); this.setstate(prevstate => ({ currentcompany: (prevstate.currentcompany + 1) })); thank :) you can write also: this.setstate({ name , currentcompany: this.state.currentcompany + 1 }) multiple setstate within function not idea, try calculation use setstate once after that.

In Android, Build CTS vs Download CTS. What is the difference? -

we shortly begin testing our android port custom target board. part of test, plan execute cts. when researching cts, came across this page on android provides cts test suite download. comes script run test scripts. whereas, there plenty of tutorials out there , so threads discuss how build cts source. my question if cts can downloaded directly android site, in scenarios need build cts source code? just clarify, i'm not looking instructions on how build cts. need understand when use downloaded cts , when build it.

c# - Adding search function to an invoice application -

i'm new programming , know basic of c#. i'm doing invoice application in visual studio can store customer name, contact number, address, costs, date of purchase. i want add search function invoice application retrieve customer there name. these code. please help namespace invoice_application_final { public partial class main : form { public main() { initializecomponent(); //listview properties listview.view = view.details; listview.fullrowselect = true; //add column listview listview.columns.add("customer number", 100); listview.columns.add("customer name", 150); listview.columns.add("address", 200); listview.columns.add("invoice number", 100); listview.columns.add("contact number ", 100); listview.columns.add("description", 200); listview.columns.add("costs", 100); listview.c

ios - Explicitly declare getter '-newRelationship' with '__attribute__((objc_method_family(none)))' to return an 'unowned' object mogenerator -

i'm getting error explicitly declare getter '-newrelationship' ' attribute ((objc_method_family(none)))' return 'unowned' object when attempting access property @property (nonatomic, strong) nsstring* newborntyperawvalue; in extension on subclass. i'm using coredata , mogenerator. superclass generated mogenerator, in swift extension on subclass have following code extension subclassname { var newborntype: differenttype? { { willaccessvalue(forkey: "newborntyperawvalue") let storedstringop = primitivenewborntyperawvalue() didaccessvalue(forkey: "newborntyperawvalue") if let storedstring = storedstringop { return differenttype(storedstring) } else { return nil } } set { guard let newvalue = newvalue else { willaccessvalue(forkey: "newborntyperawvalu

scheme - I would like to understand each line how this code removes duplicates in a list , so this is the list (a b a a a c c) gives (a b) -

here code , working fine on scheme lisp (define (rdup ls) (let loop ((ls ls) (current #f)) (cond ((null? ls) ()) ((null? (cdr ls)) (if (eq? (car ls) current) () ls)) ((eq? (car ls) (cadr ls)) (loop (cdr ls) (car ls))) ((eq? (car ls) current) (loop (cdr ls) current)) (else (cons (car ls) (loop (cdr ls) (car ls)))) ))) and here tried (rdup '(a b a c c)) and got (a b) i want know how each line of code works i've added line numbers , fixed indentation make easier explain: 01 (define (rdup ls) 02 (let loop ((ls ls) 03 (current #f)) 04 (cond 05 ((null? ls) '()) 06 ((null? (cdr ls)) 07 (if (eq? (car ls) current) '() ls)) 08 ((eq? (car ls) (cadr ls)) 09 (loop (cdr ls) (car ls))) 10 ((eq? (car ls) current) 11 (loop (cdr ls) current)) 12 (else (cons (car ls) 13 (loop (cdr ls) (car ls))))))) line 02: using special form of

List of dict unique combination Python -

i have big data visualization purpose, example list of dict as, input : a = [{'e1': 'a','e2': 'b'}, {'e1': 'b','e2': 'a'}, {'e1': 'a','e2': 'c'} ] output : a = [{'e1': 'a','e2': 'b'}, {'e1': 'a','e2': 'c'}] detail: if {'e1': 'a','e2': 'b'} , {'e1': 'b','e2': 'a'} pointing each others value want unique {'e1': 'a','e2': 'b'} . so e1 source , e2 target. if connection exists between source , target should unique. here connected b should not consider b connected a. you may try 1 from itertools import groupby [j.next() , j in groupby(a, lambda x: sorted(x.values())) output: [{'e1': 'a', 'e2': 'b'}, {'e1': 'a', 'e2': 'c'}]

simplexml - DOMDocument saveHTML is not returning correct HTML Standards for "IMG", "INPUT" -

i'm big fan of php library phpquery content parser (because quite jquery , while using php domdocument extract markup) i've noticed bug specific elements quick closing event <img /> instead of <div></div> i've noticed bug occurs in domdocument phpquery . i've written simple class phpcontentdocument dump simple html document. require_once "../phpquery_lib/phpquery.php"; require_once "phpcontentdocument.class.php"; $sample_document = new phpcontentdocument('sample document'); $sample_document->addelement('text element', "<span class='text_element'>this sample text</span>"); $sample_document->addelement('image element', "<img src='png_file.png' alt='png_file' id='png_file' />"); $sample_document_string = $sample_document->get_string(); the results expect ... <!doctype html> <html> <head> <ti

Shifting values in datetimeindex of pandas dataframe -

i have df datetimeindex of 30 minute intervals on long period (> 1 year), >17520 rows. reasons related daylight savings, 2 of index values repeated in index , 2 values missing. duplicated values are: in[1]: df[df.index.duplicated('first')] out[2]: b c timestamp 2012-10-07 01:00:00 nan nan nan 2012-10-07 01:30:00 nan nan nan 2013-10-06 01:00:00 nan nan nan 2013-10-06 01:30:00 nan nan nan i want change these missing values, 1 hour later: in[3]: df[df.index.duplicated('first')].shift(1,freq="h") out[4]: b c timestamp 2012-10-07 02:00:00 nan nan nan 2012-10-07 02:30:00 nan n

php - Default User model and Relatinship - Laravel 5.4 -

i use default user model , have created userstatus model: user class user extends authenticatable { use notifiable; /** * attributes mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; /** * attributes should hidden arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; public function status() { return $this->belongsto('app\userstatus'); } } userstatus namespace app; use illuminate\database\eloquent\model; class userstatus extends model { public $timestamps = false; public function users() { return $this->hasmany('app\user'); } } i cant access related model attribute because $user->status null: $users = user::all(); foreach ($users $user) { var_dump($user->status->name); } what best practice/solution? thanks! your query cause n+1 query problem. try efficient $users = user::with(

Unable to access Jenkins -

when tried access jenkins using localhost:8080/jenkins following error. http error 404 problem accessing /jenkins/. reason: not found how solve this? check webserver running, if use apache turn on apache server going right path check out, apache web server route http , https traffic jenkins. helps too 1.use urls lack pesky port tag 2.receive external port 80 or 443 traffic

ios - how can store custom objects in NSUserDefaults -

i apologize duplicate question . new in ios . want store custom objects in userdefaults. using objective-c . thanks in advance first create custom class below. customobject.h #import <foundation/foundation.h> @interface customobject : nsobject<nscoding> @property(strong,nonatomic)nsstring *name; @end customobject.m #import "customobject.h" @implementation customobject - (void)encodewithcoder:(nscoder *)encoder { //encode properties, other class variables, etc [encoder encodeobject:self.name forkey:@"name"]; } - (id)initwithcoder:(nscoder *)decoder { if((self = [super init])) { //decode properties, other class vars self.name = [decoder decodeobjectforkey:@"name"]; } return self; } then create customobject class object , store in nsuserdefaults stored object this customobject *object =[customobject new]; object.name = @"test"; nsmutablearray *arr = [[nsmutablea

plot - Plotting nonlinear Diff equation in Matlab -

Image
here 3 nonlinear diff equation : how possible plot equation in matlab. take @ differential equation solver in matlab, ode45 . f1 = @(t,y)[-y(2)^3 - y(1)^3; y(1)*y(3) - y(2)^3; -y(3) + y(1)^2]; [time,y] = ode45(f1,[0 10],zeros(3,1)) plot(time,y)

java - Object is null set in Defalut add Card in Arraylist -

i create default class see list cart in app public class default extends application { public arraylist<card> listcard; public arraylist<card> getlistcard() { return listcard; } public void setlistcard(arraylist<card> listcard) { this.listcard = listcard; } } next when public class scanqrcodeactivity extends appcompatactivity { private arraylist<card> cardlist; .... if (hotpvalue.equals(passwordhotp)) { card card = new card(path3, base32, namecard, intervaltotp, passwordhotp, getdate(), expirationdate, hotpvalue); default app = (default) getapplicationcontext(); cardlist = app.getlistcard(); cardlist.add(card); // show error line code app.setlistcard(cardlist); cardlist = new arraylist<card>();

how to identify selected notification from multiple Notification android? -

here myfirebasemessagingservice using generate notification in application. class myfirebasemessagingservice extends firebasemessagingservice { private final string tag = this.getclass().getsimplename(); @override public void onmessagereceived(remotemessage remotemessage) { //displaying data in log log.d(tag, "from: " + remotemessage.getfrom()); log.d(tag, "notification message body: " + remotemessage.getnotification().getbody()); log.d(tag, "onmessagereceived: " + remotemessage.getnotification().gettag()); //calling method generate notification sendnotification(remotemessage.getnotification().getbody(),remotemessage.getnotification().gettitle()); } //this method generating push notification //it same did in earlier posts private void sendnotification(string messagebody, string title) { intent intent = new intent(this, notificationdetailactivity.class); intent.putextra(appconstant.notification, messagebody);

Visual Studio 2017 C# launching powershell script -

hope right place ask new site :) i created gui in visual studio new user creation. part of code calls powershell script have been using user creation. so gui works can add users csv file creates , launches powershell script. the problem part of powershell script loads exchange 2007 snapin. reason when running script via gui have created comes error saying unable find plugin. so code launching powershell follows. not coder @ going wrong way , might bit of mess hehe :) process p = new process(); p.outputdatareceived += new datareceivedeventhandler(outputhandler); // redirect output stream of child process. p.startinfo.createnowindow = false; (false testing) p.startinfo.useshellexecute = false; p.startinfo.redirectstandardinput = false; //(false testing) p.startinfo.redirectstandardoutput = false; //(false testing) p.startinfo.redirectstandarderror = false; //(false testing) p.startinfo.loaduserprofile = true; p.startinfo.filename = "this points file on network share&

css - @media screen doesn't work -

@media screen , (min-width: 501px) , (max-width: 769px) the code between media query taken if size of window 1920px ! look @ code : .row-contact{ .col-xs-12:first-child { margin-top: 0; } } @media screen , (min-width: 501px) , (max-width: 769px){ .row-contact { padding: 0 !important; .col-xs-12:first-child { margin-top: 12%; } } } in full screen have margin-top: 12% , however, must margin-top: 0 ! why isn't working ? edit found solution ! closed media query before writing scss instruction thanks ! :d .row-contact{ .col-xs-12:first-child { margin-top: 0; } } @media screen , (min-width: 501px) , (max-width: 769px){ .row-contact { padding: 0 !important; } .col-xs-12:first-child { margin-top: 12%; } } try way because nesting not working if not using less or scss

Jquery-ui append template on drop and make appended templates child as droppable(nested) -

how append template while dropping , dropped template's child droppable(nested). $template=$("<div class="static">box1</div><div class="droppable-box-nested">box2</div>"); need append above code below fiddle while dropping , box2 droppable. jsfiddle you have syntax issues in $template , should like: var $template = $("<div class='static'>box 1</div><div class='droppable-box-nested'>box 2</div>"); the use of " breaks out of string , should use ' . working example: https://jsfiddle.net/twisty/vwyd9cz1/1/ javascript $(function() { var $template = $("<div class='static'>box 1</div><div class='droppable-box-nested'>box 2</div>"); $('.dragitem').draggable({ helper: 'clone', connecttosortable: "#column2,#column2 div" }); $('.dragitem').sortable({

Linking HTML files in a folder with one another using python -

i have folder full of html files follows: aaa.html bbb.html ccc.html .... ...... ......... zzz.html all these htmls created using python script, , hence follow same template. now, want link these html files, have placeholders in html follows: <nav> <ul class="pager"> <li class="previous"><a href="#">previous</a></li> <li class="next"><a href="#">next</a></li> </ul> </nav> i want fill these placeholders filenames in folder. example, bbb.html have <nav> <ul class="pager"> <li class="previous"><a href="aaa.html">previous</a></li> <li class="next"><a href="ccc.html">next</a></li> </ul> </nav> and ccc.html file contain: <nav> <ul class="pager"> <

Database Connectivity with java to any database by single configuration file -

how can configure database java through configuration file. means can switch any database java through configuration file. code configure mysql database <?xml version="1.0" encoding="utf-8"?> <config> <jdbc> <url>jdbc:mysql://localhost:3306/javabase</url> <driver>com.mysql.jdbc.driver</driver> <username>java</username> <password>d$7hf_r!9y</password> </jdbc> </config> like want configure database like(oracle, sqlserver) java single configuration file. can possible ? , how call in java application is possible? within bounds, yes. bounds must restrict using sql of databases want use can understand. can problem, because different databases use non-standard syntax, non-standard extensions, support different sets of data types have different languages stored procedures, triggers , on. the problem more databases support smaller set of sq

nest - How can I convert class properties into uppercase and rename few without Attribute in elasticsearch with c# -

i using elasticsearch in c# put data elasticsearch. have kept c# class & properties per database (pascalcase). however, requirement convert properties uppercase , change name of few name. same should possible class name well. i not want achieve via data annotations. there way can made generic c# classes? i using nest 5.x version. for example, class foo { public string thismessage {get; set; } public string anothermessage {get; set; } } should convert into class fooabc { public string thismessage {get; set; } public string {get; set; } } it's possible both nest without using attributes: to change casing of poco property names when serialized , sent elasticsearch, use defaultfieldnameinferrer(func<string, string>) to change name of type , rename properties, use infermappingfor<t>() typename() , rename() here's example void main() { var pool = new singlenodeconnectionpool(new uri("http://localhost:9200

wpf DataGrid Scroll with mouseclick scrollBar Error when Row Drag and Drop -

i wrote dodragdrop in datagrid. however, can't click , drag scroll bar on datagrid because drag error occurred. but can scroll mouse wheel. how can fix it? here part of code. .cs file private void datagrid_mousemove(object sender, mouseeventargs e) { if (e.leftbutton == mousebuttonstate.pressed) { point currentposition = e.getposition(incidentlist); object selecteditem = datagrid.selecteditem; if (selecteditem != null) { datagridrow container = (datagridrow)datagrid.itemcontainergenerator.containerfromitem(selecteditem); var dataobj = new dataobject(); dataobj.setdata("dragsource", container); if (container != null) { dragdrop.dodragdrop(container, dataobj, dragdropeffects.copy); } } } } .xaml file <datagrid x:name="datagrid&qu

c++ - Iteration on Quick Sort -

i trying implement quick sort now. but, have problem loop part below for (int current = 0; current <= high - 1; current++) when initialize 'current' statement 0, show nothing on screen when run it. then, try replace 'low' argument in implementation provided , run appropriately. what want ask is, why doesn't work when initialize loop statement 0, same value assigned 'low' parameter? have tried initialize new variable 0 , use variable loop, give same result when directly assign loop statement 0. answer. here code: int partition(int arr[], int low, int high) { int pivot = arr[high]; int index = (low - 1); (int current = low; current <= high - 1; current++) { if (arr[current] <= pivot) { index++; swap(arr[index], arr[current]); } } swap(arr[index+1], arr[high]); return (index + 1); } void quicksort(int arr[], int low, int high) { if (low < high) {

composer php - Updating laravel on live server -

i have updated laravel install locally, using cache busting https://github.com/themonkeys/laravel-cachebuster what best way on live server? a) run composer update on live? b) pull updated version git? thanks. continuous integration best way deploy on live server. check these links more information https://en.wikipedia.org/wiki/continuous_integration https://github.com/integrations/feature/continuous-integration https://circleci.com/integrations/bitbucket/ https://about.gitlab.com/gitlab-ci/ or if want simple , easy can create packages on local example .deb packages on ubuntu , upload them extract on server

python - How do I shift my pandas dataframe structure? -

suppose have data this: item | date | status 12-01 e 12-02 e 12-03 b 12-04 b b 12-01 e b 12-02 b b 12-03 s b 12-04 s c 12-03 e c 12-04 e now want make data below: item | 12-01 | 12-02 | 12-03 | 12-04 e e b b b e b s s c e e so in summary, want make each row item's history. heard called 'pivot', i'm not sure doing "easily" pandas. can me this?! you can use pivot : df = df.pivot(index='item', columns='date', values='status') print (df) date 12-01 12-02 12-03 12-04 item e e b b b e b s s c none none e e if duplicates in item date use pivot_table aggregate function ','.join or sum : print (df) item date status 0 12-01 e

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

i trying put lock on table while writing on table , if happened in between roll-back . trying convert below code lock table test_g1 read; lock table test_g write; -- begin; start transaction; insert test_g1 values(143); insert test_g values(145); select * test_g1; select * test_g; rollback; select * test_g; unlock tables; how convert above code @transactional spring jdbctemplate code? @transactional(rollbackfor={dataaccessexception.class}) public void test(){ jdbctemplate.execute("insert test1 (id, nam) values (4, 'a')"); throw new dataaccessexception("error") { }; } here trying throw error, insert statement should rollback it's not happening . thanks edit-1 attaching code , doing in jdbcdaoimpl.java , mentioned problem comment above test() . app.java package com.cgiri.javabrains.spring4; import org.springframework.beans.factory.annotation.autowired; import org.springframework.context.applic

angularjs - Unknown provider: $scopeProvider <- $scope -

i trying make small test work validates wether controller defined. the error receiving is: myapp.orders module order controller should .... failed error: [$injector:unpr] unknown provider: $scopeprovider <- $scope <- ordersctrl reading similar errors has dependencies, don't know what's wrong. controller: 'use strict'; angular.module('myapp.orders', ['ngroute']) .config(['$routeprovider', function($routeprovider) { $routeprovider.when('/orders', { templateurl: 'orders/orders.template.html', controller: 'ordersctrl' }); }]) .controller('ordersctrl', function($scope, $location) { $scope.changeview = function(view){ $location.path(view); // path not hash } }); test: 'use strict'; describe('myapp.orders module', function() { beforeeach(module('myapp.orders')); describe('order controller', function(){ it('should ....',

asp.net web api - Web Api Get FromUri - ArrayList Issue -

i new in web api , trying converting web service web api. encountered issue while running web api. please in issue. i have declared 2 arraylist (parametername & parametervalue) in class model , optional have value in both parameters. public class pnawcfdata { public pnawcfdata() { server = ""; database = ""; loginid = ""; password = ""; cmdtimeout = 30; success = false; } public string server { get; set; } public string database { get; set; } //...... public arraylist parametername { get; set; } public arraylist parametervalue { get; set; } //...... when running it... http://localhost:53386/api/webapi?server=pnante813&database=ff_andon&storedprocname=udpdev_getprojectbyplant&parametername=plant&parametervalue=plant1 if did not put value parametername & parametervalue, able result. if put value (plant & plant1) parameternam

secure trading - Opencart missing orders -

i have managed set securetrading extension in opencart. however, orders through st going "missing orders" opencart. i have double checked , payments being processed (both in test , live mode) , emails being sent st. however, orders go missing orders. please can advise if using opencart 2 url should http://www.yourdomain.com/index.php?route=extension/payment/securetrading_pp/ipn

java - Comparator.comparing(...) throwing non-static reference exception while taking String::compareTo -

below 2 lines of code snippet: list<string> listdevs = arrays.aslist("alvin", "alchemist", "brutus", "larsen", "jason", "kevin"); listdevs.sort(comparator.comparing(string::length)); //this works fine listdevs.sort(string::comparetoignorecase); //this works fine but (out of expermient) when try write listdevs.sort(comparator.comparing(string::comparetoignorecase)); the compiler throws error cannot make static reference non-static method comparetoignorecase(string) type string similar happens below code listdevs.sort(comparator.comparing(string::compareto)); i understand error , works fine if remove comparator.comparing (as shown above). but point is, how line works? listdevs.sort(comparator.comparing(string::length)); i believe missing something. have read this thread. same scenario? comparator.comparing expects function describes comparable property of elements. string::

Java Eclipse m2e order of Libraries/Maven Dependencies -

i have inherited project ('customerx') depends on lots of things including version of our products code base. project implements useful classes makes new version of existing class code base. when other projects depend upon project 'customerx' , nothing more, java resources/libraries/maven dependencies in order lots of 'customerx' dependency jars our products code base useful classes , new version of existing class i happier if place 3. new version of existing class first possibly ensure version seen first , used. the multitude of settings , parameters in brave new java/eclipse/maven world has me stumped. don't know google for. pom 'customerx' has dependencies , in order can change (?) don't need to. pom projects depending on 'customerx' lists customerx dependency.

node.js - Sequelize WHERE sequelize.fn(...) AND something='something' ordering issue -

i have sequelize findone function looks select row given point intersects polygon (col 'geom') , status = 'active'. var point = sequelize.fn('st_geomfromtext', 'point(' + lng + ' ' + lat +')', 4326); var intersects = sequelize.fn('st_intersects', sequelize.col('geom'), point); geocounty.findone({ attributes: ['id', 'name' ], where: { status: 'active', $and: intersects }, plain: true }) as of right now, works fine. produces sql looks like: select "id", "name" "geocounty" "geocounty" "geocounty"."status" = 'active' , (st_intersects("geom", st_geomfromtext('point(-98.025006 43.714735)', 4326))) limit 1; what want is: select "id", "name" "geocounty" "geocounty" (st_intersects("geom", st_geomfromtext('point(-98.025006 43.714735

Why is Java RMI server showing an error message when I try to run it? -

the following exception thrown after execution of program. unresolved compilation problem: method bind(string, remote) in type registry not applicable arguments (string, employeermimain) public static void main(string args[]){ try { employeeservice obj = new employeeservice(); registry r = locateregistry.createregistry(1234); r.bind("remote", obj); } catch (remoteexception e) { e.printstacktrace(); } catch (alreadyboundexception e) { e.printstacktrace(); } } edit: user solved own problem. @kmuir practice post solution if found it. what class interfaces of employeeservice class? sure implements remote marker interface? public interface tunnelingmessagebox extends remote { public void pushmessage(message message) throws remoteexception; //..more interface methods } public class tunnelingmessageboximpl implements tunnelingmessagebox { public v

r - Compare and obtain intervals intersections between rows -

i have data base following. pos1<-c(5,15,25,40,80,5,18,22,38,84,5,16,50,92,31,50,20,30,50,70,27,50,60,50,90,20,40) pos2<-c(10,17,30,42,90,10,20,24,42,87,10,19,52,100,40,70,25,32,60,90,30,60,71,60,100,25,50) chr<-c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2) n<-c(25,65,78,56,35,78,58,98,14,25,65,85,98,74,20,36,48,98,52,69,21,47,53,10,12,37,82) pop<-c("a","a","a","a","a","b","b","b","b","c","c","c","c","c","d","d","a","a","a","a","b","b","b","c","c","d","d") data<-data.frame(pos1,pos2,chr,pop,n) position 1 , position 2 designed start , end point of interval each chr , population. intention obtain interval intersects between pops a, b , c (not d) , intervals unique each population. so,

domain driven design - Spring and MongoDB: Saving Value Objects in a more flat way -

for new spring application i'm designing , developing, we're using mongodb persistence layer number of technical reasons. first project i'm trying implement ddd principles, including value objects. i'm trying find best way save valueobject in fact string. using lombok's @value, spring rest controller happily parses value valueobject on restcontroller side. when saving value, gets saved in structured way on mongodb side. for example my vo: @value public class personkey { private string value; } the document i'll storing in mongodb: @document public class persondocument { private personkey personkey; private name name; ... } what gets saved in mongodb: {.. "personkey": {"value": "faeeaf2"} ...} what want: {.. "personkey": "faeeaf2" ..} of course minimal boilerplate code.. :-) it seems option use abstractmongoeventlistener onafterconvert method modify dbobject afte