Posts

Showing posts from April, 2011

Spring Data JPA deleteInBatch -

while delete(list) working fine, if try delete deleteinbatch(list), thowing exception below org.springframework.dao.dataintegrityviolationexception: not execute statement; sql [n/a]; constraint [dept_details_f_key1]; nested exception org.hibernate.exception.constraintviolationexception: not execute statement @ org.springframework.orm.jpa.vendor.hibernatejpadialect.converthibernateaccessexception(hibernatejpadialect.java:248) @ org.springframework.orm.jpa.vendor.hibernatejpadialect.translateexceptionifpossible(hibernatejpadialect.java:214) @ org.springframework.orm.jpa.abstractentitymanagerfactorybean.translateexceptionifpossible(abstractentitymanagerfactorybean.java:417) @ org.springframework.dao.support.chainedpersistenceexceptiontranslator.translateexceptionifpossible(chainedpersistenceexceptiontranslator.java:59) @ org.springframework.dao.support.dataaccessutils.translateifnecessary(dataaccessutils.java:213) @ org.springframework.dao.support.persistenc

cloudera cdh - CDH 5.4 upgrade to HUE to 3.8 -

i using cdh 5.4 . see version of hue 3.7 . i want use spark notebook feature in hue 3.8 not know how upgrade hue 3.8 i find instruction how update hue @ hue wiki page . removed place update bash script here #!/bin/bash cdh_lib=/opt/cloudera/parcels/cdh/lib # download tarball wget https://dl.dropboxusercontent.com/u/730827/hue/releases/3.8.1/hue-3.8.1.tgz # backup old version sudo mv $cdh_lib/hue $cdh_lib/hue-3.7 # install libs sudo apt-get -y install python2.7-dev sudo apt-get -y install libxslt1-dev sudo apt-get -y install libmysqlclient-dev sudo apt-get -y install libsqlite3-dev sudo apt-get -y install make sudo apt-get -y install libkrb5-dev sudo apt-get -y install libxml2-dev sudo apt-get -y install libssl-dev sudo apt-get -y install libldap2-dev sudo apt-get -y install python-pip sudo apt-get -y install libsasl2-dev sudo apt-get -y install python-ldap tar -zxvf hue-3.8.1.tgz cd hue-3.8.1/ #sudo rm -rf /opt/cloudera/parcels/cdh/lib/hue # build sudo prefi

scala - Class file for android.support.v4.widget.DrawerLayout not found - Intellij (UI 14.141.1192.2) -

when compiling gradle can't find android.support.v4 , though correctly declared in build.gradle . i'm using android-scala plugin don't think issue because various other posts seem have same issue. intellij displays libraries under sidebar: "project view", @ compile time library " android.support.v4 " not available, not after clean compile. have tried suggestions find on stackoverflow without success. any appreciated thanks adam error message: error:scalac: error: class file android.support.v4.widget.drawerlayout$lockmode not found java.lang.assertionerror: class file android.support.v4.widget.drawerlayout$lockmode not found @ scala.tools.nsc.symtab.classfile.classfileparser$$anonfun$enterowninnerclasses$1$$anonfun$12.apply(classfileparser.scala:1050) @ scala.tools.nsc.symtab.classfile.classfileparser$$anonfun$enterowninnerclasses$1.apply(classfileparser.scala:1049) @ scala.tools.nsc.symtab.classfile.classfileparser$$anonfun$en

c# - Are there better ways for updating an execution timer every second than using a background worker that checks every 150 ms? -

to show timer how long specific process runs i'm using background worker update execution time label. naturally should done every second user sees increases consistently. after trying around bit , failing utterly went down road i'm checking every 150 milliseconds if next second there , update display. private void executiontimerbackgroundworker_dowork(object sender, doworkeventargs e) { stopwatch executiontime = new stopwatch(); double lastupdateatseconds = 0; executiontime.start(); while (!executiontimerbackgroundworker.cancellationpending) { thread.sleep(150); // sleep while give other threads time stuff if (executiontime.elapsed.totalseconds > lastupdateatseconds + 1) // update execution time display once per second { executiontimerbackgroundworker.reportprogress(0, executiontime.elapsed); // update execution time display lastupdateatseconds

html - why width is not working in table-cell? -

Image
i need following output given html, used display:table property ul ul , display:table-cell property li childeren, every ul ul has 4 child expect last ul ul , set width of every li child of ul ul , not working last raw, dont want edit html, please me, why happening. in advance jsfiddle expect output : - result getting:- html:- <div> <ul> <li> <ul> <li><a href="#">11</a></li> <li><a href="#">12</a></li> <li><a href="#">13</a></li> <li><a href="#">14</a></li> </ul> </li> <li> <ul> <li><a href="#">21</a></li> <li><a href="#">22</a></li> <li><a href="#">23</a></li>

global properties command line configuration of soap ui pro maven plugin -

i wanted know if there way override global properties values in soapui-settings.xml file passing values command line parameters. reference using soapui pro maven plugin , not in using command line version of soapui. you have use maven properties intermediary. definite soapui plugin like: <plugin> <groupid>com.smartbear.soapui</groupid> <artifactid>soapui-pro-maven-plugin</artifactid> <version>.....</version> <executions> <execution> <configuration> <projectfile>.....</projectfile> <projectproperties> <value>property1=${soapui.value1}</value> </projectproperties> </configuration> </execution> </executions> </plu

ios - Size class does not works -

Image
i need create app adaptive ui. use auto layout , size class. can't expected result. displays different uis different screen sizes. kindly guide me create adaptive ui(for screen sizes). in advance. this indeed problem constraints mentioned in comments question. using size classes allows set constraints iphones @ lowest level (that's why screen size size class compact x regular same iphones in xcode). it difficult you, without knowing of constraints. advice is, use preview assistant, can see of devices , generated ui. opening preview assistant, tap on bottom "+" symbol , add device wish inspect. as can see on screenshot, in storyboard, there margins around middle view, on iphone 4, width smaller, these margins lower (they have lower priority constraint), while view retains it's width/height.

python - Track state of order in Django -

i have model order . i want track 'the life-cycle' of order, i.e. when , requested customer, when , order processed, etc. right have field determining whether order requested, processed, etc. don't know how save additional information states. i guess it's kind of kanban system. how obtained? guess make foreign key model state / status . work?

objective c - uinavigationcontroller after many push and pop not working -

my uinavigationcontroller not more working after many push , pop. have tested transition´s operations , content of stack of uinavigationcontroller. viewcontrollers nice pushed , popped. after many times tried push viewcontroller. this 1 added stack view not showing, , app blocked. have tried debug can not become exception. i think problem view of new pushed viewcontroller not showing. anyone has idea kind of mistake can achieved? impressumcontroller* impressumvc = [self.storyboard instantiateviewcontrollerwithidentifier:@"impressumcontroller"]; [self.navigationcontroller pushviewcontroller:impressumvc animated:yes]; nslog(@"navigation viewcontrollers %@",self.navigationcontroller.viewcontrollers); popping code. [self.navigationcontroller popviewcontrolleranimated:yes]; check if view controller being deallocated , memory usage not growing. override - (void)dealloc function , put there break point check if being reached.

mysql - PHP - limit 10 offset 1 if rows are greater than 20 -

Image
i'm displaying top 10 newest , last 10 oldest topics after 10 newest database. i'm able display need in top 10 topics.my problem when have 21 topics in database, last 10 topics displayed according want,but when have 20 topics,the last topic in newest still in oldest.to make more clear,here reference picture. -this happen when have 21 or more topics in database- -this happen when have 20 topics in database- i don't want topic repeated happen when have 20 topics. here code fetching last 10 topics database: // fetching last 10 topics forum function history() { $sql = "select * ( select f_id id, f_title name,f_dept dept,f_last_view last_view forum order last_view asc limit 10 offset 1 ) `table` order last_view desc "; //-run query against mysql query function $result=mysql_query($sql) or die(mysql_error()); $history = array(); //-create while loop , loop through result set while (($row = mysql_fetch_assoc(

how to plot multiple curves with plotyy in MATLAB? -

i want draw plot 2 y axes , 1 x axes. 2-d line plot y-axes on both left , right side. there multiple curves plotted. for example: x=1:20 % left y axes y1_1=randn(20,1)*1 + 0 y1_2=randn(20,1)*1 + 5 y1_3=randn(20,1)*1 + 10 % right y axes y2_1=randn(20,1)*1 + 20 y2_2=randn(20,1)*1 + 30 y2_3=randn(20,1)*1 + 40 how can draw this? you can supply several y s each x: plotyy( x, [y1_1, y1_2, y1_3], x, [y2_1 ,y2_2, y2_3] ); should trick you.

methods - ios xmpp call another viewcontroller from oneview controller through appdelegate -

i working on xmpp project. have created connection , able login successfully.but have setup methods , in appdelegate [connect] method. when login in app when have fetch friend list have again call appdelegate [connect] method want set condition , in viewcontroller loginbutton. when secondtime appdelegate [connect] method call not affect other view controller , result. have tried declaring bool method not successful. here try. //appdelegate.m file// -(bool) isauthenticate; // mthod declaration - (bool)connect { // hud = [mbprogresshud showhudaddedto:self.navigationcontroller.view animated:yes] ; //hud.delegate = self; hud = [[mbprogresshud alloc ] initwithwindow:[uiapplication sharedapplication ].keywindow]; [self.window.rootviewcontroller.view addsubview:hud]; [hud setdetailslabeltext:@"please wait..."]; [hud setdimbackground:yes]; [hud setopacity:0.5f]; [hud show:yes]; // hud.color =[uicolor colorwithpatternimage:[uiimage

sql - Correlated subqueries: How to get the ID of the outer query? -

i have multiple tables : person --------------------- idperson, name stickertransaction --------------------- idtransac, idperson, idsomeoneelse, nbstickersreceived, nbstickersgiven purchase --------------------- idpurchase, idperson, nbstickersbought i'm trying every person never made transaction or have 0 sticker. have number of stickers person has, here's formula : nbstickersbought + nbstickersreceived - nbstickersgiven here's query i've got far. problem i've got in subsubsubqueries... not have access person's id. is there way have access person's id or there better way write query ? select people.idperson, people.name ( -- selects people never made sticker transaction select p.idperson, p.name person p left join stickertransaction st on p.idperson = st.idperson st.idperson null union -- selects people have 0 sticker select p.idperson, p.name person p 0 = ( select sum(nbstic

html - nth-child selector not working -

i need hide border 4, 3, 2 wrapper based on screen size. i show 4, 3, 2 , 1 items in row based on screen size. @media( min-width:1000px){ #news-tab > div > .news-tab-item-wrapper:nth-child(2n+1){ border-right:2px solid #fff; background:red; } } based on above css should not show border last element, not able target it. may using wrong reference in case. <div id="news-tab" class="tab-pane"> <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3"> <div class="news-tab-item-wrapper"> <span>this news title</span> <a href="#">read more</a> </div> </div> <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3"> <div class="news-tab-item-wrapper"> <span>this news title</span> <a href="#">read more</a> </div> </div> <div class="col-xs-12 col

ArrayList sorting Android -

private list<string> mitem = null; private list<string> mpath = null; string dirpath = environment.getexternalstoragedirectory().getpath(); private void getdir() { mitem = new arraylist<string>(); mpath = new arraylist<string>(); file f = new file(dirpath); file[] files = f.listfiles(); (int = 0; < files.length; i++) { file file = files[i]; if (!file.ishidden() && file.canread()) { mpath.add(file.getpath()); if (file.isdirectory()) { // folder names mitem.add(file.getname() + "/"); } else { // file name mitem.add(file.getname()); } } } filelist = new filemanageradapter(this, mitem, mpath); listview.setadapter(filelist); listview.setonitemclicklistener(onitemclick); } here im adding list of files , folders on path arraylist, how sort folders first , files @ last. ki

xcode - How to open Storyboard as xml source? -

Image
i need reorder view controllers in storyboard . know need open storyboard source code using right clicking on file , using menu open as... . can open storyboard xml file. my problem source opened text - there no colour differences on comments example. when make move of code inside not indented properly. how open storyboard source xml ? to open storyboard xml source: right click on storyboard, see menu, hover on "open as" select "source code" hope help. to go view storyboard in design build mode, right click on storyboard, see menu, hover on "open as" select "interface builder -- storyboard"

ERROR backtype.storm.util - Async loop died java.lang.RuntimeException: java.lang.RuntimeException -

i running simple word count topology using kafka storm integration.i getting output when using spout source text file.but when using kafka spout getting following error. the error : error backtype.storm.util - async loop died! java.lang.runtimeexception: java.lang.runtimeexception: org.apache.zookeeper.keeperexception$nonodeexception: keepererrorcode = nonode /brokers/topics/randomquery/partitions 7173 [thread-4-sendthread(localhost:2006)] info org.apache.storm.zookeeper.clientcnxn - opening socket connection server localhost/127.0.0.1:2006. not attempt authenticate using sasl (unknown error) 7174 [thread-4-sendthread(localhost:2006)] info org.apache.storm.zookeeper.clientcnxn - socket connection established localhost/127.0.0.1:2006, initiating session 7175 [nioservercxn.factory:0.0.0.0/0.0.0.0:2006] warn org.apache.storm.zookeeper.server.nioservercnxn - caught end of stream exception org.apache.storm.zookeeper.server.servercnxn$endofstreamexception: unable read ad

javascript - BootStrap Header Fixed -

please find below jsfiddle code - http://jsfiddle.net/xf8hz/3/ in above code, when scroll, table header gets fixed top of page. however have masterpage consumes top 50 px. how can above code tweaked whenever page scrolled header of table should fixed @ 50px , not 0px . from api can use offsettop: 50 in fixed header intitialization datatables plugin: new $.fn.datatable.fixedheader(table, { alwaysclonetop: true, offsettop: 50 }); here's example: http://jsfiddle.net/xf8hz/260/ hope helps!

c# - Hide multiple Dropdown boxs using CSS for printing -

on c# mvc page, have several dropdown boxs displayed on page, i'm using media query render view differently print , screen. my question is there way (using css) hide dropdown boxs if selected option value "". (the text value '< select >'). so when printing, following printed: title instead of: title < select > just want make more clear, if selected option not "" need display when printing, following: title mr will display same when printing as: title mr here 1 of dropdown: <select id="alias_title" name="alias.title"> <option value="">< select ></option> <option value="1">mr</option> <option value="2">mrs</option> <option value="3">ms</option> </select> don't know whether achievable or not css, if not, can done jquery? thanks you can use $.fn.filter() find

angularjs - How to pass data from $http.get to request body in angular -

i using express , angular app. suppose have following factory: angular.module('liveapp.factory',[]) .factory('datafactory', ['$http', datafactory]) function datafactory($http){ var datafactory = {}; datafactory.checkdb = function(){ return $http({ method: 'get', url: '/artistsearch', data: "need data go request body" }) } return datafacory; } and on server side have: app.js app.get('/artistsearch',dbhelpers.checkdbartist) dbhelpers.js exports.checkdbartist = function(req,res,next){ var newartist = req.body; } for reason when checkdb invoked request not passing on data req.body in checkdbartist . request body evaluates {} . have idea why?

Getting started with SAS parallel processing using MP Connect -

i trying understand mpconnect , how can use parallel processing. as simple example, started session prints "hello world!" forever , prints "bye world!". said "waitfor any " , "rget" , expect "bye world!" in log because "hello world!" go on forever while "bye world!" has finished. unfortunately, doesn't work. in general, have great difficulties retrieving output remotely submitted task. option cpucount=4 sascmd="!sascmd" autosignon; rsubmit task1 wait=no; data _null_; while(1); put "hello world!"; end; run; endrsubmit; rsubmit task2 wait=no; data _null_; put "bye world!"; run; endrsubmit; waitfor _any_; rget; signoff task1; signoff task2; the problems seems when have syncronous processes running disconnected each other. though you're waiting fast task2 complete before continuing: rsubmit task2 wait=no

selenium - Chrome webdriver does not let me click a hamburger menu -

Image
this appearance of html markup (a tile object) testing selenium. the goal of test trigger drop down menu clicking hamburger icon seen in attached screenshot. here relevant code dropdown_menu = tile.find_element_by_class_name('dropdown-toggle') dropdown_menu.click() when comes click function call, got error: webdriverexception: message: unknown error: element not clickable @ point (528, 125). other element receive click: <span class="icon-file"></span> the icon-file class blue icon on top left corner of tile. however, when test same code in firefox did not exception. what cause of difference of behaviour? i added time.sleep(5) in between 2 lines , fixed issue dropdown_menu = tile.find_element_by_class_name('dropdown-toggle') time.sleep(5) dropdown_menu.click() thanks peanut link bug report in comment

csv - Python pandas trouble with storing result in variable -

i'm using pandas handle csv file, i'm having trouble storing results in variable , printing out is. this code have. df = pd.read_csv(my_file.csv, index_col=false, header=0) df2 = df[(df['name'])] # trying result of name variable n = df2['name'] print(n) and result get: 1 jake name: name, dtype: object my question: is possible have "jake" stored in variable "n" can call out whenever need it? eg: print (n) result: jake this code have constructed def name_search(): list_to_open = input("which list open: ") + ".csv" directory = "c:\users\jake wong\pycharmprojects\box" "\\" + list_to_open if os.path.isfile(directory): # search name name_id = input("name search for: ") df = pd.read_csv(directory, index_col=false, header=0) df2 = df[(df['name'] == name_id)] # defining name save file n = df2['name'].ix[1

Title Attribute not working in Firefox Addon -

i developing mozilla firefox addon. need hover tooltip icon in panel of firefox extension. when use title attribute tooltip not displaying. suggest me solution . p.s : specifiying firefox addon or extension , not browser thanks in advance normally need this: myelement = document.createelement("somexultagname"); myelement.setattribute("tooltiptext","my tooltip text"); but inside panels (at least non-sdk ones) have more work if including html elements instead of xul elements: mypanelview = document.createelement('panelview'); mypanelview.setattribute('tooltip', 'ahtmltooltip'); ... myelement = document.createelementns('http://www.w3.org/1999/xhtml', "somehtmltagname"); myelement.setattribute("title","my tooltip text");

javascript - Is it possible to have different colored graphs in a single series in HighCharts? -

i have single series column graph x-axis datetime , y-axis constant value. show columns in different colors based on information have , possible ? e.g. have dynamic data coming in plot graph,i use series.addpoint({x:x,y:value,extra:info}, false, false) plot same. based on info, how can vary colors? i pretty new javascript , highcharts. pardon limited knowledge, in right direction appreciated. updated code: if(type=='a') color='#7cb5ec'; else if(type=='b') color='#f45b5b'; else if(type=='c') color='#8085e9'; else if(type=='d') color='#2b908f'; else color='#e4d354'; series.addpoint({x:x,y:value,extra:info,marker:{fillcolor:color}}, false, false); i have set colorbypoint: true option. series.addpoint function runs in loop runs , when data. try out following plotoptions: {

javascript - How to add sound on alert pop up? -

i developing system in php-mysql , using sweetalert.min.js alerts.. along need add notification tone alert pop-ups. below code if(((sms_alert == 'null') && (email_alert == 'null'))) { swal("you have " + obj[i].e_name + " event @ moment"); } please me out whether done javascript, jquery or other thing.. n how achieved. try using jquery https://github.com/admsev/jquery-play-sound $.playsound(' http://example.org/sound.mp3 ');

mysql - SQL: Must appear in the GROUP BY clause or be used in an aggregate function -

Image
i have table displays teams salaries , want display minimum, maximum , average salary each team each year. my table looks like: i run following sql: select min(salary), max(salary), avg(salary), teamid, yearid salaries; but following error: error: column "salaries.teamid" must appear in group clause or used in aggregate function what mean? select min(salary), max(salary), avg(salary), teamid, yearid salaries group teamid, yearid;

spring - java.lang.IllegalArgumentException starting libreplan in docker -

i have docker repo ( here ) source code ( here ) supposed start libreplan on tomcat server. there docker-compose.yml sets up. however, when start container, long list of java exceptions: libreplan_1 | error [01-june 05:01:53] [main] org.springframework.web.context.contextloader - context initialization failed libreplan_1 | org.springframework.beans.factory.beancreationexception: error creating bean name '_filterchainproxypostprocessor': beanpostprocessor before instantiation of bean failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.transaction.config.internaltransactionadvisor': cannot resolve reference bean 'org.springframework.transaction.annotation.annotationtransactionattributesource#0' while setting bean property 'transactionattributesource'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework