Posts

Showing posts from 2013

java - Is it possible to propagate a transaction through different EJB 3.1 and several database servers? -

the problem this, have 3 ejb, ejb_a have connection server database 1, ejb_b have connection server database 2 , third ejb_c responsible calling first two. when there error in ejb_a or ejb_b rollback done in ejb there error, on other ejb saved done, eventhough should propagate rollback 2 ejb. ejb_c: @stateless @localbean @transactionmanagement( transactionmanagementtype.bean ) public class ejb_c { private ejb_a ejba; private ejb_b ejbb; @postconstruct public void init(){ context context = null; try { context = new initialcontext(); this.ayudantesessionbean = (ayudantesessionbean) context.lookup("java:global/trans1/trans1dba/ejb_a"); this.ayudantesessionbean = (ayudantesessionbean) context.lookup("java:global/trans1/trans1dba/ejb_b"); } catch (namingexception ex) { logger.getlogger(orquestadorsessionbean.class.getname()).log(level.severe, null, ex); } }

Trying to convert from c# string to SQL binary -

i building c# application needs work binary(16) unique identifiers in our sql server db. currently, application storing these string. i hoping able pass unique id string varchar parameter , convert within sql statement, getting strange results. convert(binary(16), '0x6ec5cae61df38840b8efec2d5a158b3a', 1) --desired: 0x6ec5cae61df38840b8efec2d5a158b3a --actual: 0x307836454335434145363144463338383430423845464543324435413135 is there way convert in way? solution found in various places, haven't been able work. have tried other recommendations: convert(binary(16), '0x6ec5cae61df38840b8efec2d5a158b3a', [1-3]) convert(varbinary(16), '0x6ec5cae61df38840b8efec2d5a158b3a', [1-3]) convert(binary(16), '6ec5cae61df38840b8efec2d5a158b3a', [1-3]) convert(varbinary(16), '6ec5cae61df38840b8efec2d5a158b3a', [1-3]) cast('' xml).value('sql:variable("@variable")', 'binary(16)') to no

How to apply pagination in dojo -

Image
is there type of pagination allows user enter page number available not similar goto button in dojo pagination? here's example of mean: in example, there text box in user can specify page number , afterwards taken respective page. can done? if so, can u please me ... in advance. script.js function paginate(){ //create pagination buttons if(data.length >= 5){ for(var y = 0; y < data.length / 5 ; y++) { // divide 5 results per page equal 5 var button = document.createelement("button"); button.setattribute("id", "pagination-button" + (y+1).tostring()); button.setattribute("class", "pagination-button center"); button.setattribute("onclick", "nav(id)"); var text = document.createtextnode((y + 1).tostring()); button.appendchild(text); document.body.appendchild(button); } } }

check if user has permissions to add items to the list in a SharePoint DVWP with XSLT -

is possible check if user has permissions add items list in dvwp when rending xslt? the idea being see if user has access add , if add link newform page. you can xslt function ddwrt:ifhasrights(xx) xx permission mask. this: <xsl:if test="ddwrt:ifhasrights(16)"><tr> <td width="190px" valign="top" class="ms-formlabel"><h3 class="ms-standardheader"><nobr>entry status</nobr></h3></td> <td width="400px" valign="top" class="ms-formbody"><sharepoint:formfield runat="server" id="ff8{$pos}" controlmode="new" fieldname="entry_x0020_status" __designer:bind="{ddwrt:databind('i',concat('ff8',$pos),'value','valuechanged','id',ddwrt:escapedelims(string(@id)),'@entry_x0020_status')}" /><sharepoint:fielddescription runat="server" id="

spring - nullpointerexception while using if condition -

im using hibernate criteria spring(both annotation) im having nullpointerexception service class : public list<voiture> rechercher_voiture(string type, string couleur, string lieulocation) { list<voiture> v = new arraylist<voiture>(); criteria crit; session session = dao.getsessionfactory().getcurrentsession(); crit = session.createcriteria(voiture.class) .add(restrictions.eq("type", type)) .add(restrictions.eq("lieulocation", lieulocation)) .add(restrictions.eq("statut", (long) 0)); if(couleur.isempty()==false) { crit.add(restrictions.eq("couleur", couleur)); } v = crit.list(); return v; } the nullpointerexception caused if condition suggestion? it happens if couleur = null . change if(couleur!=null && couleur.isempty()==false)

mysql - Postgres, Create uniqueness of values between 2 columns -

and thank ahead of time able help. have table shown below. table invoice id| delivery_statement_id | supply_statement_id _ | 1 |2 _ | 3 |4 _ | 2 | 4 <-should not pass db because id 2 used in first row. i want make sure unique ids exists between 2 columns throughout entire database if statement_id 1 has been used can never used again delivery, or supply statement. please help, when search issue keep getting index multiple columns solves issues of row combinations. thank you my understanding is, have table of following structure: "invoice" ( id (primary key), delivery_statement_id, supply_statement_id ) judging names of colums, "delivery_statement_id" , "supply_statement_id" foreign keys same, external table... let's say, refer "statement" "invoice" ( id (primary key), delivery_statement_id -> statement(id), supply_statement_id ->

html - Can't use certain Width - CSS menu -

i got menu , need items same width (155px). don't seem doing right way, appreciate tips , possible solutions. #menu { width: 1000px; height: 625px; text-transform: uppercase; text-align: left; font-size: 10px; margin: 0 auto; font-family: 'raleway', sans-serif; font-weight: 400; } #menu span { padding-left: 11px; } #menu ul { margin: 0; padding: 25px 0 0 0; } #menu li { background: url(../img/menu_dots.jpg) no-repeat; display: inline; padding-bottom: 614px; padding-top: 25px; width: 155px; } #menu li { text-decoration: none; color: #d1d3d4; } #menu li a:hover { color: #000; font-weight: 700; } #menu li .current { color: #000; font-weight: 700; } <div id="menu"> <ul> <li><a href="index.html" class="current"><span>octo</span></a> </li> <li><a href="equipa.html"><span&

C++ ostream : no operator match << & expected initializer before '&' token -

thanks in advance help! program student registration program. input via file , results out file. general idea learn c++, method overloading -including operators , fstream 's. i'll post code compiler points please let me know if want see other code. when go build compiler error points header file method, outside of class inside #endif . see below. std::ostream & operator << ( std::ostream & os, const registration & r); the implementation of file such: std::ostream &operator <<( std::ostream & os, const registration & r ) { os << "student id: " << r.getstudentid() << "\n" << "semester: " << r.getsemester() << "\n \n"; for(unsigned = 0; < r.getcount(); i++) { os << "\tunit name : " << r.getname(i) << "\n" << "\tunit id : " << r.getid(i) << "\n"

c# - Linq Join: Join using a mapping table and associate objects -

i trying write linq query make basic join. have 2 arrays park[] parks = new park[]{ new park() {id = 1, name = "free park"}, new park() {id = 2, name = "cost park"}, new park() {id = 3, name="sneak in park"} }; and facility[] facilities = new facility[] { new facility() { id = 1, name = "swing", minimumage = 1, maximumage = 120}, new facility() { id = 2, name = "slide", minimumage = 1, maximumage = 200}, new facility() { id = 3, name = "see-saw", minimumage = 1, maximumage = 300} }; each park can have 0...n facilities, hence have set of mapping objects parkfacility[] associations = new parkfacility[] { new parkfacility() {parkid = 1, facilityid = 1}, new parkfacility() {parkid = 1, facilityid = 2}, new parkfacility() {parkid = 1, facilityid = 3}, new park

OrientDB javascript function, "save" on getDataBase not working -

i'm following tutorial http://pettergraff.blogspot.fr/2014/01/getting-started-with-orientdb.html and on fourth part, we're suppose create javascript function push "members" in database. i know tutorial old , i've been through issues, instance had delete block <handler class="com.orientechnologies.orient.graph.handler.ographserverhandler"> <parameters> <parameter value="true" name="enabled"/> <parameter value="50" name="graph.pool.max"/> </parameters> </handler> from orientdb-server-config.xml, make following code work : var db = orient.getdatabase(); is normal? now line okay, i'm having trouble, here "my" code : var db = orient.getdatabase(); db.begin(); (var = 0; < n; i++) { var name = prefix + "_" + i; var email = name + "@gmail.com"; var member = {

Does spring integration support AMQP with ActiveMq -

i new mom. i want connect activemq using amqp application. want use spring integration connecting activemq. i see example of amqp rabbitmq not able find example activemq. is not possible spring integration ? no, isn't possible. activemq supports amqp 1.0 protocol oasis standard. where rabbitmq , hence spring integration amqp adapters support 0.9.1. those spec versions different. you should try tu use activemq jms api on amqp. , spring integration jms adapters.

content management system - Hybris CMS Cockpit - add Javascript -

i working hybris cms cockpit (only user, not admin) , have built page content slots. however trying insert javascript page. cannot see mean't add javascript , tried in-line <script> tags stripped out , turned plain text. does know if possible or have ask admin of system enable something? you can add javascript have have developer make overrides configuration files (local.properties) of environments want add javascript in. the settings are: xss.filter.rule.script_fragments= xss.filter.rule.lonely_script_tags= xss.filter.rule.lonely_script_tags2= xss.filter.rule.javascript= by doing this, system no longer strip tags :)

ios - Get frame of a view after autolayout -

i have method: - (void)underlinetextfield:(uitextfield *)tf { cgfloat x = tf.frame.origin.x-8; cgfloat y = tf.origin.y+tf.frame.size.height+1; cgfloat width = self.inputview.frame.size.width-16; uiview *line = [[uiview alloc] initwithframe:(cgrect){x,y,width,1}]; line.backgroundcolor = [uicolor whitecolor]; [self.inputview addsubview:line]; } that underlines input uitextfield ; textfield has width changes depending on screen width (nib autolayout). i have tried using [self.view setneedslayout]; [self.view layoutifneeded]; and [self.inputview setneedslayout]; [self.inputview layoutifneeded]; before call method no change in result. resulting line wider uitextfield (it matches original size in nib). i want resulting frame of uitextfield in question after being processed autolayout solution: (using 'masonry' autolayout) - (uiview *)underlinetextfield:(uitextfield *)tf { uiview *line = [[uiview alloc] initwithframe:cgrectzero];

iis - Permissions for ASP -

i've inherited quite intranet, amongst other systems. not written programmers, there's fair bit of getting things work done. one of asp pages has worked since i've gotten here, today of sudden got error 500.19. none of asp pages in other folders had issue. on hunch, checked permissions on folder , folder did work. 1 worked shared everyone, added folder doesn't work. seems have fixed problem. i'm wondering cause. no 1 changed permissions, issue group policys changed? remember setting iis decade ago, , had share folder local user. , root folder shared local user. possible due group policy changes, share no longer cascading root folder subfolders?

java - rotate Frame in JavaCV -

i write simple app android whick use ffmpeg + javacv. can capture image camera , can recorde video. want rotate frame when record video, don't can :-( please see image stop , save code: public void stoprecording() { runaudiothread = false; try { audiothread.join(); } catch (interruptedexception e) { e.printstacktrace(); } audiorecordrunnable = null; audiothread = null; if (recorder != null && recording) { if (record_length > 0) { log.v(log_tag,"writing frames"); try { int firstindex = imagesindex % samples.length; int lastindex = (imagesindex - 1) % images.length; if (imagesindex <= images.length) { firstindex = 0; lastindex = imagesindex - 1; } if ((starttime = timestamps[lasti

javascript - Should I / how do I clear a mousemove JQuery event listener? -

when use $(".page").mousemove(function(event){}); as mouseup event comes, no longer need listener. since i'll applying listener repetitively different actions, seems me these listeners might stick around , build (needlessly wasting cpu) user activates function many times. i'm not sure how works internally, that's guess. should / how clear mousemove jquery event listener? here code: $('.page').off('mousemove'); but please note following approach turns off functions firing on mousemove . if want turn off prticular function should following: // define function fires on mousemove function anyfunctionname () { // code } // set listener $('.page').on('mousemove', anyfunctionname); // turn off function called funcionname $('.page').off('mousemove', anyfunctionname); another way turning off particular function defining name event: // define function fires on mousemove function anyfunction

iis 8.5 - Cannot get authentication working in IIS 8.5 -

we have installed basic , windows authentication iis 8.5 on our windows 2012 server cannot server prompt client credentials. under "authentication" feature have 2 options (despite restarting iis numerous times): anonymous authentication: disabled asp.net impersonation: disabled when set anonymous disabled 401 no authenticate headers. when enable 200 anonymous. we've tried sorts of settings in web.config , here current situation: <system.web> <authentication mode="windows" /> <authorization> <deny users="?"/> </authorization> </system.web> solved running iis admin console administrator (thanks question #8067448). reason new authentication options (basic , windows) appear , enabled. sheesh microsoft!

java - Serialization of a class inside the class -

i'm trying make class singleton have serialize method. objective serialize singleton in own function. there way serialize class inside class ? here sample of tried : public void serialize() { singleton commit = this.getinstance(); try { fileoutputstream fileout = new fileoutputstream(new config().getdatafile()); objectoutputstream out = new objectoutputstream(fileout); out.writeobject(commit); out.close(); fileout.close(); } catch (exception e) { system.out.println("unable commit database changes."); e.printstacktrace(system.out); } } and stack trace below : unable commit database changes. java.io.notserializableexception: com.cuistot.data.singleton @ java.io.objectoutputstream.writeobject0(objectoutputstream.java:1184) @ java.io.objectoutputstream.writeobject(objectoutputstream.java:348) @ [...].singleton.serialize(singleton.java:50) [...] does class implement

python - Converting PeriodIndex to DateTimeIndex? -

i have question regarding converting tseries.period.periodindex datetime. i have dataframe looks this: colors country time_month 2010-09 xxx xxx 2010-10 xxx xxx 2010-11 xxx xxx ... time_month index. type(df.index) returns class 'pandas.tseries.period.periodindex' when try use df var analysis ( http://statsmodels.sourceforge.net/devel/vector_ar.html#vector-autoregressions-tsa-vector-ar ), var(mdata) returns: given pandas object , index not contain dates so apparently, period not recognized datetime. now, question how convert index (time_month) datetime var analysis can work with? df.index = pandas.datetimeindex(df.index) returns cannot convert int64index->datetimeindex thank help! you can use to_timestamp method of periodindex this: in [25]: pidx = pd.period_range('2012-01-01', periods=10) in [26]: pidx out[26]: <class 'pandas.tseries.period.periodi

java - Testing WebSockets With The Gretty Gradle Plugin -

i created simple war includes servlet (defined in web.xml) , jsr 356 websocket (defined annotations). when deploy tomcat 7.0.59 (via tomcat manager) both servlet , websocket work correctly. when use gretty gradle plugin test out war servlet works jsr 356 websocket not. have tried tomcat 7.0.59, tomcat 8.0.20 , jetty 9.2.9.v20150224 in gretty. obvious doing wrong here? i assume using latest gretty version adding gretty gradle build file via: apply plugin: 'war' apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginscripts/gretty.plugin' please check gretty 1.2.1 - https://github.com/akhikhl/gretty it supports websockets out-of-the-box, no configuration needed. gretty includes 2 working examples of using websockets: https://github.com/akhikhl/gretty/tree/master/examples/websocket https://github.com/akhikhl/gretty/tree/master/examples/springbootwebsocket

deployment - maven release:prepare with artifactory deploy substep fails -

after researching days , close suicidal tendencies here problem , really hope stupid find problem myself .... setup: windows7 / maven 3.2.3 / jdk 1.7.0_60 (64bit) / artifactory 3.5.0 problem: - mvn clean install deploy --> works - mvn release:prepare --> works - mvn release:perform fails in substep deploy (which works standalone mentioned before) - pom.xml , settings.xml (for testing took pregenerated 1 artifactory) me. attached them further down.... thnx in advance help! cheers j. log: ..... [info] [info] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ apps.hr --- [info] uploading: http://vm-local-repo.fernbach-lu.dom:8081/artifactory/libs-release-local/com/fernbach/apps.hr/0.1.4/apps.hr-0.1.4.war [info] 2/75918 kb [info] 4/75918 kb [info] 6/75918 kb [info] 8/75918 kb .... [info] 60/75918 kb [info] apr 01, 2015 4:56:30 pm org.apache.maven.wagon.providers.http.httpclient.impl.execchain.retryexec execute [info] 62/75

javascript - What is difference between these two self invoking functions -

this question has answer here: location of parenthesis auto-executing anonymous javascript functions? 4 answers both of these functions below self-invoking functions. can explain me difference between these two? i've looked around lot of places. i've not been able find anything. first type (function(){ console.log('hello world'); }()); second type (function(){ console.log('hello world'); })(); they're same. they're 2 different similar ways force js engine correctly interpret function expression. another way example +function(){ console.log('hello world'); }() the accepted convention put parenthesis around function expression : (function(){ console.log('hello world'); })();

image - Why is saving a picture twice in a row producing different binary in Paint -

i thought little odd. open paint on windows (i'm using windows 7) , draw (anything). save .png example called 1.png. save 'n' number of other copies straight away without modifying image (2.png, 3.png,..etc). i notice 1.png has different checksum 2/3/4/../n.png. 1.png varies in such (sometimes smaller , other times bigger) compared other images. what going on? the difference in filesize due choice of scanline filters used compressor. don't have idea why application use different set of filters when compressing image multiple times, it's harmless. there's no time stamp in 2 images mohammad posted. according "pngcheck -v", difference in content of idat chunk. image signatures computed imagemagick identical. neither image contains time chunk. "pngcrush" produces 2 identical images smaller filesize (11493 bytes). according "pngtest -mv" (pngtest included in libpng distribution), 1 image uses png "none&quo

android - Send push notification with data using JSON -

i want send push notification data in it. example send parse { "phoneid": "ejw6pfsqny", "action": "com.parse.starter.update_status" } how can send android device. using following code jsonobject obj = null; try { obj = new jsonobject(); obj.put("phoneid",pass); obj.put("action","com.parse.starter.update_status"); } catch (jsonexception e) { e.printstacktrace(); } parsepush push = new parsepush(); parsequery query = parseinstallation.getquery(); // notification android users query.whereequalto("objectid", pass); log.d("log",pass); push.setquery(query); push.setdata(obj); push.setmessage(pass); push.sendinbackground(); and code use retrieve data jsonobject notificationpayload = new jsonobject(intent.getextras().getstring("com.parse.data")); id = notificationpayload.getstring("phoneid"); but not working. you can't bo

jquery - Event listener don't work -

i have next selector "#btn-similar", why listener works: $("#btn-similar").click(function(e){ console.log("similar click"); }); but listener not: $(document).on("click", "#btn-similar", function(e){ console.log("similar click"); }); the html markup is: <div id="btn-similar" class="details-tab active-nav"> <span class="angle"></span> <div class="title">overview</div> </div> i using jquery 1.10, ideas ? since both pieces of code correct , work in circumstances, can think of these reasons why second 1 not work: there's <a> tag or form post in hierarchy causing browser go new page before results of code can seen. you have more 1 object in page id=btn-similar . there's script error right before second block of code keeps executing. you have typo somewhere , code doesn't match desired id. in ques

hp uft - Automation Tool for Siebel Open UI : UFT or Selenium? -

i wanted know if has automated siebel openui ( seiebel 8.1.1.14). if yes tool used , challenges faced.? feedback me. i use both uft & webdriver. both have own pros & cons. have automated siebel application using uft in past. uft pros: has siebel add-in. learning uft easy. record & playback we can come decent framework & test script easily. cons: commercial tool. works in windows. (uft 12 can used test safari well. has limitations) supports ie. other browsers need apply patches hp whenever release. might not able test latest browsers. uft uses vbscript (even in 2015) webdriver: pros: free & open source os independent. supports browsers. cons: learning not easy uft & difficult find testers programming knowledge. it might take time come framework , create robust test script.

spock - How can I test my Grails service save method? -

i've created grails service using grails create-service taskcrudservice . command created files taskcrudservice.groovy in grails-app\services , taskcrudservicespec.groovy in test\unit folder. the method in taskcrudservice is task save(string name) { task task = new task() task.name = name task.save(flush: true, failonerror: true) } i wanted test method so, i've filled body of "test something" method generated grails in test class. taskcrudservicespec code: @testfor(taskcrudservice) class taskcrudservicespec extends specification { void "test something"() { when: task t = service.save('task name') then: assert t.name == 'task name' } } but test doesn't work. when run grails test-app java.lang.illegalstateexception: method on class [task] used outside of grails application. if running in context of test using mocking api or bootstrap grails correctly.

c# - How do I declare an MVC 5 action like in Web API 2? -

in web api declare actions this: [responsetype(typeof(mymodel))] public async task<ihttpactionresult> get(httprequestmessage request, int accountid) { //get mymodel return ok(mymodel); } i request being passed in rather obtaining controller. mvc that? have been searching cant find examples or references ability. edit: also, return interface. looking in mvc: [responsetype(typeof(mymodel))] public async task<iactionresult> get(httprequestmessage request, int accountid) { //get mymodel return view(mymodel); } its bit different mvc, actions map user interactions, not directly httprequest such. designed pass in model , respond view() . typically dont need check things headers , method type because need part of method parameters. if need view specific method type, can decorate [httppost] or [httpget] etc. you can current httpcontext via static property httpcontext.current.httprequest directly

xaml - Why MVVM/WPF ComboBox SelectedItem is null in multibinding to other control's Visibility? -

edit : bound same property (searchtype) combobox binds -> works fine. still know why first solution described here not work. i have public enum searchtype { networkobjects, customers } in viewmodel contructor: public searchviewmodel() { searchtype = panels.searchtype.networkobjects; in xaml: <usercontrol.resources> <xpui:convertsearchtypetovisibility x:key="searchtypetovisibilityconverter" /> </usercontrol.resources> <combobox name="searchtypecombobox" itemssource="{binding path=searchtypes}" selecteditem="{binding path=searchtype, mode=twoway}"> ... <datagrid.visibility> <multibinding converter="{staticresource searchtypetovisibilityconverter}"> <binding relativesource="{relativesource self}" path="name"/> <binding elementname="searchtypecombobox" path="selectedite

php - How do I add inline css to dropdown in Yii? -

this code: <?php echo $form->dropdownlist($model, 'type', chtml::listdata($ab->type, 'id', 'name'), array('class' => 'edit'), array('width:165px')); ?> i trying add inline css dropdown, example not work. why ? it should this: <?php echo $form->dropdownlist($model, 'type', chtml::listdata($ab->type, 'id', 'name'), array('class' => 'edit', 'style' => 'width:165px')); ?>

java - How do you put a BufferedImage into a ByteBuffer? -

i have bufferedimage, need make bytebuffer can apply cubemap face. create byte[] bufferedimage can put bytebuffer. example create byte[] can found here: http://www.mkyong.com/java/how-to-convert-bufferedimage-to-byte-in-java/

c# - How to publish a project with extern Data correctly -

i'm trying publish project needs data stored in .txt file. the file located in bin\debug. path streamreader relative using applicaton.startuppath. added .txt file solution explorer, somehow bad path error message every time try start published setup. how publish project needed .txt file? you have various ways of achieving this. the txt file included in solution file have property called build action. change content , should published deployments. you can add resources, need access differently. add installation package

Flyway usage: what exactly is the migration concept? -

i looked @ flyway samples , documentation , tried understand if useful in environment. following conceptual detail unclear me: how flyway manage changes between database versions? not compare database life-instances (see answer here: can flyway find out , generate migration files datamodel? ) in detail setup looks this: create sql create , insert scripts when coding (automatically , manually). means every version of database represented number of insert/create statements. in world execute these scripts through database tool (sqlplus oracle). each run setup database _from_scratch_ (!). can put these same scripts 1 1 inside "migration" path of flyway? happens if target database way older last "migration step" did (or flyway did not yet exist when installed)? update: i got input flyway user: it seems each "migration" (version of database) has hand-written sql/java code , contains "updates" previous "migration" of database.

php - Can i use the below to unset several sessions -

i have several sessions this: $_session['search']['max'] $_session['search']['order'] currently, unset each 1 of them separate statement: if(isset($_session['search']['max']) && $_session['search']['max'] != ''){ unset($_session['search']['max']); } if(isset($_session['search']['order']) && $_session['search']['order'] != ''){ unset($_session['search']['order']); } my question - can use below general unset statement instead of having separate statement each session: if(isset($_session['search']) && $_session['search'] != ''){ unset($_session['search']); } are there advantages of declaring each unset statement separately? note: need unset them @ same time, meaning not need keep 1 or more use again, therefore believe 1 statement s

How to control references between elements in XML -

Image
in previous question ( how create references between elements in xml ) asked how create, in xml schema, references between elements. ok, noticed something. example, defining these 3 types of vehicles: <car id="car1"> <plate>aaa</plate> <mark>peugeot</mark> <model>206</model> </car> <truck id="truck1"> <plate>bbb</plate> <mark>scania</mark> <model>x1</model> </truck> <trailer id="trailer1"> <plate>ccc</plate> <mark>scania</mark> <model>t1</model> </trailer> ... can define complex vehicle , example: <trailertruck id="tt1"> <car refid="car1"/> <trailer refid="trailer1"/> </trailertruck> <trailertruck id="tt2"> <truck refid="truck1"/> <trailer refid="trailer1&

php - Number of variables doesn't match number of parameters in prepared statements -

$sql = "select table_name information_schema.tables table_schema = '?'"; $stmt = $db->prepare($sql); $stmt->bind_param("s", $database); $stmt->execute(); $resultset = $stmt->get_result(); it says " warning : mysqli_stmt::bind_param(): number of variables doesn't match number of parameters in prepared statement in..." can explain what's wrong? $database string. if use ? placeholder, don't use ticks ' s $sql = "select table_name information_schema.tables table_schema = ?"; $stmt = $db->prepare($sql); $stmt->bind_param('s', $database); $stmt->execute(); $resultset = $stmt->get_result();

Access my projects details in Microsoft Project server 2013 errors? -

i have created 1 pwa(project web app) site in ms project server 2013 i created projects on it working fine, but after time when wanted access projects details page it give loop error: an error occurred while opening project. give few minutes , try again. if happens again, contact administrator. can tell cause error in ms project server 2013 web app have checked permissions in groups & categories? simple needing add "open project," "view project site" "view project schedule in project web app" , "view project summary in project center" (in categories). i have had weird permissions issues cause such loops. place start if haven't investigated.

android - List view updates view which are not touched -

sorry bad title. i adding toggle button @ run-time list view. when click on button state gets changed. problem when scroll down other items selected too. for example, if click on first toggle button 6th toggle button gets checked too. this weird behavior. here xml code acitivty <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <relativelayout android:id="@+id/title_bar" android:layout_width="match_parent" android:layout_height="50dp" android:background="@color/eros_now_title_bar"> <imageview android:id="@+id/back_button_image" android:layout_

osx - Disable editing in NSTextView -

i trying disable editing in nstextview there doesn't seem option there.all other types have enabled property when set false non editable there nstextview? please not forget class inherits methods of superclass. superclass of nstextview nstext . , there find method (void)seteditable:(bool)flag with comment: controls whether receiver allows user edit text.

Android ListView does not respond -

i have problem listview , adapter. listview setonitemclicklistener , setonitemlongclicklistener not respond onscroll works perfectly. here code , have solution me... thanks in advance. public class afragment extends fragment { view rootview; listview l; public static aarrayadapter adapter; public afragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { rootview = inflater.inflate(r.layout.fragment_list, container, false); return rootview; } @override public void onviewcreated(view view, bundle savedinstancestate){ l = (listview) rootview.findviewbyid(r.id.listview); adapter = new aarrayadapter(getactivity(), r.layout.list_item_adapter, new arraylist<astring>()); l.setadapter(adapter); l.setonitemlongclicklistener(new onitemlongclicklistener() { public boolean onitemlongclick(adapterview<?> parent, view view, int position, long id) { //toast doesn

android - Display large text from BufferedReader into viewPager fragments (text reader type implementation) -

im trying make reader app wherein data static. have saved data in text files in assets folder. want read data using bufferedreader , display in viewpager . user goes on swiping right, pages should added viewpager along data bufferedreader if there data display. this getitem function inside viewpageradapter. public fragment getitem(int i) { fragment pagefragment = new pagefragment(); stringbuilder sb = new stringbuilder(); bufferedreader reader = null; try { inputstream file = context.getassets().open("chap1.txt"); reader = new bufferedreader(new inputstreamreader(file)); // reading, loop until end of file reading string mline = reader.readline(); while (mline != null) { //process line sb.append(mline); sb.append("\n"); mline = reader.readline(); } } catch (ioexception e) {

Access Twitter User Timeline using Fabric SDK iOS -

i trying struggle issue 2 days. using fabric sdk , rest kit, trying play different rest api web services twitter. can login using twtrloginbutton having session object authtokensecret , authtoken , other values. when try user timeline, failure response in return as: {"errors":[{"code":215,"message":"bad authentication data. "}]} full error log is: e restkit.network:rkobjectrequestoperation.m:297 object request failed: underlying http request operation failed error: error domain=org.restkit.restkit.errordomain code=-1011 "expected status code in (200-299), got 400" userinfo=0x1780f6f80 {nslocalizedrecoverysuggestion={"errors":[{"code":215,"message":"bad authentication data."}]}, nserrorfailingurlkey=https://api.twitter.com/1.1/statuses/user_timeline.json?user_id=3116882322&count=2&screen_name=ann_10p, afnetworkingoperationfailingurlrequesterrorkey=<nsmutableurlrequest: 0x1782