Posts

Showing posts from February, 2014

php - SQL Syntax error in where clause -

i've been searching around , couldn't find problem mine. i'm getting syntax error, no matter how @ it, there doesn't seem wrong it. it goes this: <?php if(!empty($_post['proj_id'])||!empty($_post['task_uid'])) die("invalid proj_id or task_uid."); $query = " select pm.id, pm.proj_id, pm.task_uid, pp.pipeline_name, pm.proj_pipeline_order, pcrs.gestor_projeto, pcrs.prioridade, pcrs.tecnologia, pcrs.resp_programa projetos_main pm inner join projetos_pipeline pp on pm.task_uid = pp.task_uid right join pcrs on pp.pcr = pcrs.num_doc pm.proj_id = ".$_get['proj_id']." , pm.task_uid = ".$_get['task_uid']." ";

java - Why does clear hashmap method clears added map in array list -

i'm trying reuse same hashmap in example bellow populate list. first put values in map, add map list , clear map in order put again new values , add second set of values in list , on... but, seems clear() method delete values added in list , if don't use clear() method every set of values added in list overwritten new set of values in end in particular example have 4 identical value sets in list. what i'm doing wrong? list<hashmap<string, string>>datalist = new arraylist<hashmap<string, string>>(); hashmap<string, string> map = new hashmap<string, string>(); map.put(answer.id, "0"); map.put(answer.image, "color_icon_awesome"); map.put(answer.title, firstoption); datalist.add(map); map.clear(); map.put(answer.id, "1"); map.put(answer.image, "color_icon_awesome"); map.put(answer.title, secondoption); datalist.add(map); map.cl

c# - Unable to find the report in the manifest resources - Please build the project, and try again -

i trying fix problem my previous question when read changing build action compile , copy output copy always fix issue didnt. tried reverting previous settings didn't fix anything. nothing mentioned here , here helped either. how can fix error? public override string resourcename { { return "printorder.rpt"; } set { // nothing } } public override string fullresourcename { { return "gharaanganresturantmanagement.printorder.rpt"; } set { // nothing } }

iphone - When I rotate iOS screen, collection view cell is going wrong -

when rotate ios screen without keyboard , it's fine. keyboard, rotate screen, cell going wrong. don't know how explain in english, uploaded screenshot. this screenshot swift solution override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) { if uidevice.currentdevice().orientation.islandscape.boolvalue { print("landscape") view.endediting(true) } else { print("portrait") view.endediting(true) } } objective-c solution [[uidevice currentdevice] begingeneratingdeviceorientationnotifications]; if ( ([[uidevice currentdevice] orientation] == uideviceorientationportrait) ) { // portrait mode [[self view] endediting:yes]; } else if(([[uidevice currentdevice] orientation] == uideviceorientationlandscaperight) || ([[uidevice currentdevice] orientation] == uiinterfaceorientationlandscapeleft)) { // landscape mode [[se

Perl read a file and send e-mail -

i have log file of below format d12345 joe@gmail.com c67890 mary@gmail.com b45678 don@gmail.com a12309 joe@gmail.com f45670 mary@gmail.com f45470 joe@gmail.com currently i'm able send e-mail below e-mail body content your product id: $product_id ($product_id d12345, a12309, f45470 , c67890, f45670) problem ' n ' e-mails sent user if e-mail id present n times in log file. example : 2 e-mails sent mary@gmail.com , 3 e-mails sent joe@gmail.com i want send 1 e-mail users having product ids, if single e-mail id occurs multiple times in output file, like your product ids: c67890, f45670 mary@gmail.com and your product ids: d12345, a12309, f45470 joe@gmail my current code snippet open $fh, '<', "output.txt" or die "could not open file: $!"; while (my $line = <$fh>) { ($product_id, $to_email) = $line =~ /(\w\d+)\t(\s+)/; $mailfrom = 'myemail@domain.com'; $subject = "product id details"; $mes

How to call an array from a static method? -

in code, how call array globally other methods use? background info on code, asked scan file contains dna strands translating rna strand. i receive error: " cannot find symbol - variable dna " when call dna array on translation method (it can't find dna.length) for(int i=0; < dna.length; i++){ public class filescannerexample { public static void main(string[] args) throws ioexception { //this how create scanner read file scanner infile = new scanner(new file("dnafile.txt")); string dnasequence = infile.next(); int dnalength = dnasequence.length(); string[] dna = new string[dnalength]; for(int i=0; i<=dna.length-2 ; i++) { dna[i]=dnasequence.substring(i,i+1); //looking ahead , taking each character , placing in array } dna[dna.length-1]=dnasequence.substring(dna.length-1); //reading last spot in order put in array //testing array ide

json.net - ExtJS view model binding not working for date field -

i facing issue date field in extjs. view model data not bind date field correctly. server, if date gets rendered "2010-07-13t01:02:10.000z" binds correctly. if gets rendered "2010-07-13t01:02:10", not bind correctly date field. is there need bind data date field? cannot post actual code tried creating small sample in both formats not binding correctly. if specify '2010-07-13', binds correctly. extjs version 6.0.1.250 ext.define('plus.view.mainm', { extend: 'ext.app.viewmodel', alias: 'viewmodel.main', data: { startdate: '2010-07-13t01:15:20.000z', name: 'kapil' } }); ext.define('plus.view.mainv', { extend: 'ext.form.panel', xtype: 'app-main', viewmodel: { type: 'main' }, items: [{ xtype: 'textfield', itemid: 'name', bind: '{name}', }, { xtype: 'datefi

Convert Height to Centimeter in Java -

i trying convert height in centimeter code works when have height eg: 4'5'' - 134cm splitting text using split("'") , it's working fine. public double converttocms(string str){ double c = 0; string[] x = str.split("'"); try{ c = (integer.parseint(x[0].trim()) * 12 + integer.parseint(x[1].trim().split("\"")[0])) * 2.54; }catch(exception e){ e.printstacktrace(); } return c; } but problem occurs when have height 6' - 182cm because in x[1] -182 gets passed. 1 me out in such scenario. public class so35575713 { public static void main(string[] args) { system.out.println(converttocms("6'")); } public static double converttocms(string str){ double c = 0; string[] x = str.split("'", 2); if(x[1].trim().isempty()){ x[1] = "0"; } try{ c = (integer.parse

c# - Entity Framework Optimize Count Child Entities -

i trying optimize query generated entity framework linq sql query. below massively simplified version of query. c# list<bool> isused = context.tparent.select(parent => parent.tchild.any() ).tolist(); this produces following sql generated sql select case when (( exists (select 1 [c1] [dbo].[tchild] [extent2] [extent1].[id] = [extent2].[parentid] )) ) cast(1 bit) else cast(0 bit) end [c1] [dbo].[tparent] [extent1] unfortunately, performs poorly (my real query checks count on many linked tables) , if rewrite query follows speed increased. optimized query select case when ( count(tchild.id) > 0 ) 1 else 0 end tparent left join tchild on tparent.id = tchild.parentid group tparent.id how can re-write c# generate optimized query using linq sql query? well, following linq entities query produces same sql optimized query . it's 1 one sql linq translation, imo not intuitive way of describing que

php - Mistake in echo -

could tell me fails in following line: echo '<div id="login"><div id="centrar_app"><label>success. created account. <a href='login_app.php'>log in</a></label></div></div>'; i know must tiny stupid error, don't it. thank time you mixing single quotes , double quotes. href='login_app.php' change href="login_app.php" try this, echo '<div id="login"><div id="centrar_app"><label>success. created account. <a href="login_app.php">log in</a></label></div></div>';

Nativescript + Angular 2 base screen template -

is possible create base screen template (master screen) , use in other screens? example have application component this @component({ selector: "main", directives: [ns_router_directives, bar], template : ` <stacklayout orientation="vertical"> <bar-component> </bar-component> <page-router-outlet></page-router-outlet> </stacklayout> ` }) i'd have in screens, have on first screen ("" route) , after changing screen using this._router.navigate(["/details"]); ("details" route) can't see . do wrong? tell please how can create functionality if it's possible. try use <router-outlet></router-outlet> instead of <page-router-outlet> . i think test code nativescript angular, shows want do: https://github.com/nativescript/nativescript-angular/blob/master/ng-sample/app/examples/router/router-outlet-test.ts

HTML, CSS : Image size not proper -

Image
i working on spring-mvc project in have jsp files html,css code inside it. now, there span class text , image inside. image width , height set 90, image looking small, 1/3rd size of thumbnail. idea why happening , can rectify without increasing height , width. thank you. code : <div class="span4"> <div class="service clearfix"> <table> <tr> <td valign=top><img src="${pagecontext.request.contextpath}/resources/assets/img/image.jpg" alt="text" height="90" width="90"></td> <td> <p>"some texxt" </p> </tr> </table> <small style="margin-left: 107px">some text</small> </div> </div> now wh

Unable to get response in JSON format after aggregation in WSO2 ESB -

i have proxy service search user in multiple systems , should return combined responses in json format.i responses combined instead of getting in json format responses in xml format. can see json responses in wso2 server logs below: [2016-07-19 07:26:58,249] info - logmediator to: http://www.w3.org/2005/08/addr essing/anonymous, wsaction: , soapaction: , messageid: urn:uuid:895c4303-6de5-49 88-a4d1-c06275582841, direction: response, component = application2, payload: { "findusers":[ {"id":"20","add_state":"0","remove_state":"0","supervisor_id_name":"","idc_id":" 3","backup_supervisor_name":"","backup_supervisor":"","business_unit_id":"","com pany":"companyb","creation_date":"2016-05-11 18:02:42.0","deletion_date":"","dep artment":"922&quo

google compute engine - Cloud SQL Connection + Auto Scaling -

per this , cloud sql requires external ip address of client in order allow connections it. other suggested way sql proxy big disclaimer method may change on time. question: if auto scaling compute engine vms running webservers, need assign them external ips , go set in cloud sql instance? or missing huge? noob question perhaps, reading through. the recommended way use cloud sql proxy (but if don't want use need add static ips gce vms , whitelist them on cloud sql instance).

javascript - fullpage.js how to detect vertical scrolling -

i building page few "stages" fullpage.js plugin provides. my main problem need apply fixed position header, default using simple script use of cases far. , here is: $(document).scroll(function () { var = $(this).scrolltop() if (a > 5) { $('header').addclass('headersnap') } else { $('header').removeclass('headersnap') } }); i calculate viewport offset ammount , tell append class header using fixed position. here problem fullpage.js not allow simple script detect offset, therefore class not being applied. what can bypass issue? managed sort out myself, added scrollbar settings follows: $(document).ready(function() { $('#fullpage').fullpage({ scrollbar: true, }); }); this way script works, since has scollbar follow. note: answers specific question , not overall solution fixed headers. please re-read first post further information on this.

android - OSM vector map and OSM data -

i want create android app using osm vector map. is osm vector map rendered osm data? if yes how implement in android? the osm wik has page vector tiles . lists several libraries android , example mapsforge .

knockout.js - Referencing observable from inline computed method -

am missing anything, or not possible declare computed "inline" property id_and_name below in first example? function viewmodel(){ var self = this; // adding 'inline' won't work (exception functions doesn't exist): self.person = ko.observable({ id: ko.observable(), name: ko.observable(), id_and_name: ko.computed(function(){ return this.id() + this.name(); }, self.person) }); // works: self.person.id_and_name = ko.computed(function(){ return this.id() + this.name(); }, self.person); } well, self.person undefined until after ko.observable call has returned. computed bootstrapped before that, bootstrapped @ moment when self.person still undefined . can check out in the computed source code file , pretty easy read actually. here's 1 way @ that: function viewmodel() { var self = this; self.person = "temp"; self.person = ko.observable({ id: ko.observa

javascript - No output from jasmine-node on FilesizeWatcherSpec - Newbie Alert -

i'm new node.js , jasmine, , javascript experience old , rusty, i'm newbie there too. finished manuel kiessling's book, the node beginner book , , working way through second book, the node craftsman book . i'm stuck on filesizewatcher tutorial. i've been able run earlier tests 1 not working. there similar question on so: no output jasmine-node answer isn't working me. i'll post code here , can tell me i'm doing wrong. filesizewatcherspec.js: 'use strict'; var filesizewatcher = require('./filesizewatcher'); var exec = require('child_process').exec; describe('filesizewatcher', function() { var watcher; aftereach(function() { watcher.stop(); }); it('should fire "grew" event when file grew in size', function(done) { var path = './var/tmp/filesizewatcher.test'; exec('rm -f ' + path + ' ; touch ' + path, function() {

material design lite - Masonry layout using MDL -

i trying create dynamic tiles using mdl-grid , mdl-cell , cell stretching maximum height of column in row . to see difference here example angular material design . here tiles displayed dynamically , columns not taking max width of other columns in row . http://codepen.io/anon/pen/bpbxzz here second example using material lite , here can see columns stretching http://codepen.io/anon/pen/xvkaod is there way can create dynamic tiles using mdl ? update after researching few hours found approach called masonry layout . searched , found below ones . can not able flex layout . 1) jquery plugin https://github.com/desandro/masonry 2) css3 http://web.archive.org/web/20111226183221/http://sickdesigner.com/index.php/2011/html-css/masonry-css-getting-awesome-with-css3 here link http://jsfiddle.net/rtlun/ here stackoverflow link compact arrangement of divs in 2 directions update i found above links doesn't maintain order of items , 1 . can not find css code

shell - How to find out command in unix for files old than 5 days? -

i creating shell script , requirement need command this. no sure mean old 5 days , find command, in particular -atime operator of command. perhaps looking for.

xml - How to add Propertygroup of csproj? -

we doing delay sign of our csproject. opening each csproject file doing time consuming task decided write powershell script. function new-xmlnode { [cmdletbinding()] [outputtype([string])] param ( # webconfig file full path [parameter(mandatory=$true, valuefrompipelinebypropertyname=$true, position=0)] [string]$path, [string] $xpath, [string] $node, [string] $logfile = "$env:temp\newxmlnode.log" ) try { if (-not (test-path -path $path)) { throw [system.io.filenotfoundexception] "$path not found." } else { $xml = new-object -typename xml $xml.load($path) # getting values $items = select-xml -xml $xml -xpath $xpath

jboss - How to enable TLS 1.1 in apache Karaf -

can guide me how enable tls 1.1 in apache karaf. thanks, abdul wahid it's documented @ pax web documentation can found here

dplyr - R calculating grouped frequency table with percentage -

this question has answer here: calculate percentage each time series observations per group in r 2 answers giving following data.frame , calculate occurance of each variable of var , percentage of these occurence grouping variable group : group<-c("g1","g2","g1","g2","g3","g3","g1") var<-c("a","b","b","a","b","b","a") d<-data.frame(group,var) with table() , nice frequency table, counting occurences of combinations of 2 variables: d<-as.data.frame(table(d)) group var freq 1 g1 2 2 g2 1 3 g3 0 4 g1 b 1 5 g2 b 1 6 g3 b 2 now calculate percentage of each variable var group . far i'm splitting data.frame group , calculate percentage seperately g1 , g2 , g3

php - laravel inner pages are not working on AWS EC2 Nginx -

i working on laravel v5.1.11 site hosted on aws ec2 ubuntu ngnix server. setup site inner page not working. config is: server { listen 82; server_name www.example.com; return 301 https://$server_name$request_uri; } server { listen 83; server_name www.example.com; root /home/in4matic/example-website-dev/public; location / { index index.php; try_files $uri $uri/ /index.php?q=$uri&$args; } location ~* \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; #fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param path_info $fastcgi_path_info; #fastcgi_param script_filename $document_root$fastcgi_script_name; fastcgi_param script_filename $document_root/index.php; #fastcgi_param path_translated $document_root$fastcgi_path_info; fastcgi_param script_name $fastcgi_script_name; } }

javascript - Rotate Labels nvd3 line chart -

i want rotate x-axis labels 90 degree because overlapping each other. have used rotatelabels isnt wotking <nvd3-line-chart data="singlelinechartdata" id="singlelinechart" width="800" height="200" showxaxis="true" showyaxis="true" tooltips="true" interactive="true" rotatelabels="90" useinteractiveguideline="true" xaxistickvalues="xaxistickvaluesfunction()" xaxistickformat="xaxistickformat()" color="colorfunction()" isarea="false" margin="{left:50,top:50,bottom:50,right:50}" showlegend="true" legendcolor="colorfunction()" nodata="no data!"> <svg></svg> </nvd3-line-chart> you have use 'xaxisrotatelabels' instead of rotatelabels <div ng-app='nvd

ios - rectForRowAtIndexPath crashing with defined indexPath in UITableView -

Image
the following code crashing @ currentcellrect = tableview.rectforrowatindexpath(indexpaths[0]) but sometimes. public func showcellscrollcount(animated:bool) { self.tableview.addobserver(self, forkeypath: "contentoffset", options: nskeyvalueobservingoptions.new, context: nil) self.tableview.addobserver(self, forkeypath: "dragging", options: nskeyvalueobservingoptions.new, context: nil) } override public func observevalueforkeypath(keypath: string?, ofobject object: anyobject?, change: [string : anyobject]?, context: unsafemutablepointer<void>) { switch (keypath, object) { case (.some("contentoffset"), _): self.updatescrollposition() default: super.observevalueforkeypath(keypath, ofobject: object, change: change, context: context) } } func updatescrollposition() { let indexpaths = tableview.indexpathsforvisiblerows var currentcellrect:cgrect? if let indexpaths = index

javascript - Selenium-Unable to Type into TextArea -

i trying enter value in text-area using selenium webdriver , java. however,sendkeys not working. on using javascript,though able enter value,but click save button,i error message enter value in text area. below html textarea. below selenium code not working : element=driver.findelement(by.id("primaryclientdemarc")); element.clear(); element.sendkeys("testtextarea"); please provide suggestion. you need focus first on textarea using click() , try below :- element = driver.findelement(by.id("primaryclientdemarc")); element.click(); element.clear(); element.sendkeys("testtextarea"); hope helps..:)

php - Breadcrumb returning url with % within url structure -

i'm working on nitrosell website - first time , when click on product category e.g. http://www.examaple.com/category/product-type shows url. when click on breadcrumb within product page return http://www.example.com/category/product%20type any appreciated in how can keep url original. cheers

html - Navigation menu alignment and active state issue -

i have 2 questions: how align text middle of box bg color aqua without removing height: 100% want border bottom on active state touch ul's entire height? vertical-align: middle doesn't seem working. how make sure border-bottom stays highlighted when clicked on link? ul.nav { list-style-type: none; display: flex; height: 45px; margin-bottom: 30px; align-items: center; background-color: gray; } ul.nav .nav-item { box-sizing: border-box; margin-right: 20px; height: 100%; background-color: aqua; } ul.nav .nav-item:active, ul.nav .nav-item:focus { border-bottom: 3px solid blue; outline: none; } ul.nav .nav-link { text-decoration: none; } ul.nav .nav-link:hover, ul.nav .nav-link:focus, ul.nav .nav-link:active { text-decoration: none; outline: none; } <ul class="nav"> <li class="nav-item"> <a class="nav-link" href="#">dashboard</a>

spring integration - How to store payload and append it to another payload later? -

i using spring integration in project. have following payload. <?xml version="1.0" encoding="utf-8"?> <pq> <pqcontact> <hostaddress>10.193.244.136</hostaddress> </pqcontact> <workflowstatuscomment> <comment>i here</comment> </workflowstatuscomment> </pq> i want extract tag <workflowstatuscomment> i.e workflowstatuscomment <comment>i here</comment></workflowstatuscomment> , save future purpose. don't want use java code use saved tag info in future. want add saved info payload @ end of execution.i know header enrichers, don't know how use saved header enriched values without using java. have use spring integration components manipulate payload. the second payload going append saved tag info here: <?xml version="1.0" encoding="utf-8"?> <pq> <pqcontact> <hostaddress>10.193.244.136&

javascript - Copy to clipboard buttons -

i want create "copy clipboard" buttons work on our sharepoint. should placed in few different places, , need copy text from specific field on page (ex. list of emails). i know, can select text , copy it, quite often, having button automatically copies text clipboard useful. i did manage create 1 in script editor, pasted whole code below (which found on internet) <!doctype html> <html> <head> <script type='text/javascript'>//<![cdata[ window.onload=function(){ document.getelementbyid("copybutton").addeventlistener("click", function() { copytoclipboardmsg(document.getelementbyid("copytarget"), "msg"); }); document.getelementbyid("copybutton2").addeventlistener("click", function() { copytoclipboardmsg(document.getelementbyid("copytarget2"), "msg"); }); document.getelementbyid("pastetarget").addeventlistener("mousedown", funct

c# - Using HttpContextAccessor in a .NET 4.6 project -

i've created .net core project (a class library) targets .net 4.6, needs able access current http context. see can no longer use static httpcontext.current , , have inject instance of ihttpcontextaccessor . can still use inside web api project targeting .net 4.6? far, can't httpcontextaccessor.httpcontext return null. for class library think might want pass relevant variables/objects via constructor or methods. it's practice, because class library wont break if reference in console app without httpcontext, example. if you're inside controller method, can use request or response.

go - Number of GC call increasing (golang) -

i have webservice written in golang running on armv7 server. after few hours, process crashes. decided monitor processus newrelic (with plugin https://github.com/yvasiyarov/gorelic ). can notice memory/cpu use constant, number of garbage collector call , garbage collector pause never stop increase. this service connected redis , mysql databases, processus run golang 1.6, last stable version. tell me if have idea reason why garbage collector called whereas memory/cpu usage doesn't grow. thanks

java - how does rethrow exception terminate by outer catch? -

Image
enter code here `class rethrow { public static void genexception() { int n[]={4,8,16,32,64,128}; int d[]={2,0,8,0,4}; for(int i=0;i<n.length;i++) { try{ system.out.println("n/d is:"+n[i]/d[i]); } catch(arithmeticexception exc) { system.out.println("cant divide zero"); throw exc; } catch(arrayindexoutofboundsexception exc) { system.out.println("no match element found "); // rethrow exception } } } } class rethrowdemo { public static void main(string args[]) { try { rethrow.genexception(); } catch(arithmeticexception exc) // catch rethrow exception { // recatch exception system.out.println(&

rust - Implementing Nested Traits -

i have traits (after removing functions , parameter bloat) like: trait foo { } trait boo { } trait bar<t: foo> { } trait baz { } if u implements bar<t> t implementing foo and u implements boo , 1 able derive implementation of baz u . however, wasn't able write valid rust code doing this. a few tries were: impl<t: foo, u: bar<t> + boo> baz u { } which gives error: type parameter t not constrained impl trait, self type, or predicates [e0207] whereas impl<u: bar<t> + boo> baz u { } yields error: type name t undefined or not in scope [e0412] could one/how 1 in (stable) rust (hopefully without dynamic dispatch)? edit : people hinted @ similar questions there 2 approaches (and find both of them unsuitable situation): using associated types. don't want because want keep track of t , e.g. want write functions have signature fn bla<t: foo, u: bar<t>, v: bar<t>>() want know u , v impl

android - User downloads all events, then favourites a few -

Image
this theoretical question. i'm creating app downloads list of events around city mysql db , displays them in recyclerview . users should able select event , add own list of events interested in. at point, i'm not sure best practices. so when user selects event item recyclerview , what's best solution, can think of that: method 1: add chosen event list<event> saved in sharedpreferences json string. upload list online mysql db @ later point. any other suggestions? about query: also, give me pointer on how complex query database. i have these tables events,accounts, guestlist . so, guestlist holds id of event , of account keep track of events specific user wants attend. i'm guessing i'd have use kind of join? you can see if want data display (the event information user requesting it) i'd need first query guestlist table list of events. query events table information events ids grabbed moment ago. example sql statement anyone?

Django - Check if newer value exist for each item in queryset -

i have model hold users reactions , have few types of reactions - 1,2,3,4. user can react few times different values , want keep them in db. model (i'm using generic foreign key, not sure if matters). class reaction(models.model): user = models.foreignkey('auth.user', on_delete=models.set_null, null=true) date = models.datetimefield("reaction date", auto_now_add=true) content_type = models.foreignkey(contenttype, verbose_name=_('content type'), related_name="content_type_for_%(class)s", on_delete=models.cascade) object_pk = models.textfield(_('object id')) root_obj = genericforeignkey(ct_field="content_type", fk_field="object_pk") react = models.charfield('reaction', max_length=10) i want the root_obj (distinct if possible) user reacted specific reaction (e.g. 2), not reaction of type 3,4 afterwards. is possible? thanks r i hope

android - Fetching objects with Collections -

i'm trying list objects have inner collection. can save , retrieve objects fine, when do: parentrepo.findall() only last object has it's child object listed, others has empty collection. parent model @foreigncollectionfield(eager = false) private collection<child> childs; child model @databasefield(foreign=true,foreignautorefresh=true) private parent parent; eager true or false doesn't make difference. if query child , parent, can it's children well. missing? edit: it's working modeling made. mistake need many-to-many relation between parent , child. made quick research , need intermediate model achieve this. i'll close question , try made many-to-many relation between models. i solve many-to-many relationships this: example ongoing project. have many-to-many relationship between preparation , glidewax. solve use thee classes: preparation, glidewax , preparationglidewax. preparationglidewax represents connections between

python 2.7 - pip install for whl files -

i trying install scipy package python 2.7 in windows, process followed follows: downloaded whl file scipy-0.17.1-cp27-cp27m-win32.whl http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy tried install pip install scipy-0.17.1-cp27-cp27m-win32.whl error : requirement 'scipy-0.15.1-cp27-none-win32.whl' looks filename file not exist scipy-0.15.1-cp27-none-win32.whl not supported wheelon platform. then tried install pip install file_location\scipy-0.17.1-cp27-cp27m-win32.whl. error displayed :scipy-0.15.1-cp27-none-win32.whl not supported wheel on platform. also have upgraded pip command. can suggest me out valid solutions? i think issue in python interpreter variant 32 or 64.. if python 32-bit use scipy-0.17.1-cp27-cp27m-win32.whl otherwise if python 64bit try scipy-0.17.1-cp27-cp27m-win_amd64.whl

Visual Studio Db project with custom static code analyzer -

i've troubles adding sample code analyzer db project. followed guide: https://msdn.microsoft.com/en-us/library/dn632175(v=vs.103).aspx , custom analyzer hadn't added. missing? p.s. i'm using vs 2015 enterprise ssdt 2016 if side, it's due dll being in wrong folder. when hit issue find easiest run logging , place dll ssdt looking rather trial , error placing in random folders ☺ kevin cunnane has described procedure in comments on page https://blogs.msdn.microsoft.com/ssdt/2016/06/30/sql-server-data-tools-july-update-2/

c# - How do I get the row of a selected cell in a DataGrid? -

this question has answer here: get selected row item in datagrid wpf 9 answers i have wpf application working on. using datagrid control display fields list various information. cannot find datgridview control in visual studio community toolbox. majority of google searches bring info datagridview, frustrating. use datagridview if find, digress. want able capture current row when user selects cell, can value adjacent cell. having no luck finding out how this. here how create datagrid: private void displayfieldlengths(string strflfilename, int32 inttotalrowsize, int[] intfieldlengths) { int intdisplaycnt, colcnt = 0; string strdata = ""; lblflinfo.content = "file: " + strflfilename; datatable dt = new datatable(); dt.columns.add("field", typeof(string)); dt.columns.add("s

java - header value in regex expression for apache camel -

this question has answer here: how dynamic “from” endpoints , exchanges work in camel? 1 answer i want read files folder correspond regex this from("direct:queuealpha").process(new datetaggenerator()).from("file:///folder1/folder2/?delete=false&include=.*(${headers.timetag}).*); so datetaggenerator sets header value want use in regex input. tried escaping {, $ , } using simple doing sth wrong. how can dynamically create value header or body, can used regex? since camel 2.16 can use content enricher dynamic endpoints ([doc][1]) , in particular pollenrich (as using file endpont) from("direct:queuealpha") .process(new datetaggenerator()) .pollenrich.simple("file:/folder1/folder2/?delete=false&include=${headers.timetagexpr}") .process(…) // can process message .to(…); // , send onward

c++: replace multiple index equality tests by a single function call -

in c++/c++11 proper way replace multiple comparison of form: if(isindextofind==index1 || isindextofind==index2 ...) with less messy of form: if(isin(indextofind,index1,index2,...)) for varying number of parameters index1, index2, ... code belongs numerical have efficient direct comparison. maybe interesting add index1, index2 const static values maybe variadic template based solution of interest ? you can write like #include <iostream> #include <algorithm> #include <initializer_list> template <class t> bool one_of( const t &value, std::initializer_list<t> lst ) { return std::any_of( lst.begin(), lst.end(), [&]( const t &x ) { return value == x; } ); } int main() { std::cout << one_of( 1, { 2, 3, 1, 5 } ) << std::endl; std::cout << one_of( 4, { 2, 3, 1, 5 } ) << std::endl; }

javascript - Call two functions when onsubmit -

basically have 3 functions (format(), checkempty() , validdate()). 1 makes sure format correct second has been entered , third checks dates not in past etc. (booking form basic airline webpage). want both functions run , if both valid move testpage.py <form action="testpage.py" method="post" name="myform" onsubmit="return !!(format() & validdate());"> function checkempty(userdate) { if (userdate == '' || userdate == null ) { return false; } else { return true; } } function format() { var departuredate = document.getelementbyid("departdate").value; var arrivaldate = document.getelementbyid("arrivedate").value; var pattern1 = /^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/; //dd/mm/yyyy var pattern2 = /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/; //yyyy-mm-dd chrome date type input field var output1a = pattern1.te