Posts

xml - Where to put copyright information in an XSD? -

when placing copyright information in xml schema definition (xsd), there official (or semi-official, universally accepted) location doing so? based on where add version xsd schema? , there's official version attribute in xs:schema element - there similar copyright information? i have seen people using annotation/documentation elements (e.g. here ) - accepted way of doing this? <xsd:annotation> <xsd:documentation xml:lang="en"> copyright 2015 example.com. rights reserved. </xsd:documentation> </xsd:annotation> xsd has no specific, direct support copyright information. 3 methods used in practice: xml-level comments: <!-- copyright 2015 example.com. rights reserved. --> this ok may run afoul of policies preferring see documentation in proper xsd annotations. also, sure not add such line above xml declaration ( <?xml version="1.0" encoding="utf-8" ?> ) present in xsd keep xsd well-f...

node.js - Facebook Canvas App on Heroku with Meteor.js - Incomplete Chunked Encoding -

i have meteor.js app on heroku i'm trying load facebook canvas app. page works great in browsers chrome, i'm getting error in web inspector console: err_incomplete_chunked_encoding , , page never loads. happens around 80% of time, load correctly (upon multiple refreshes). for simplicity, i've put sample meteor app replicates same issues i'm having. here website on heroku: https://fbmeteor.herokuapp.com , here facebook canvas: https://apps.facebook.com/mymeteortestheroku/ i've searched through , found many similar cases people have run incomplete chunked encoding error in chrome, , solutions have ranged disabling anti-virus claiming fixed in future chrome versions . i've tried of these , more , still running same issues. on heroku, following error in logs: heroku[router]: sock=backend at=error code=h18 desc="server request interrupted" method=post path="/" the reason why unique heroku is, tried running same app hosted on me...

python - How to fix floating point decimal to two places even if number is 2.00000 -

this have: x = 2.00001 this need: x = 2.00 i using: float("%.2f" % x) but is: 2 how can limit decimal places 2 , make sure there 2 decimal places if zero? note: not want final output string. this works: '%.2f" % float(x) previously answered this: how this? def fmt2decimals(x): s = str(int(x*100)) return s[0:-2] + '.' + s[-2:] afaik can't trailing zeros format specification %.2f .

angularjs - Accessing parameter from Angular route -

i working on first production angular application. know can set routing can grab parameter , use to, instance, data database. for instance, in application have list of cases. each case has case number. have partial displays documents related case. here routing: jbenchapp.config(['$routeprovider', '$locationprovider', function($routeprovider, $locationprovider) { $routeprovider. when('/dashboard', { templateurl: 'partials/dashboard.html', controller: 'jbenchctrl' }). when('/calendar', { templateurl: 'partials/calendar.html', controller: 'jbenchctrl' }). when('/', { templateurl: 'partials/calendar.html', controller: 'jbenchctrl' }). when('/case/:number', { templateurl: 'partials/case.html', controller: 'casedetailct...

javascript - Limit number of characters in input field with PHP -

i'm creating database of people using this wordpress plugin . on signup form, want limit number of characters users can input in fields, don't know how, i'm not programmer , have limited knowledge of php , javascript. can't edit html directly since i'm using plugin, can't use maxlength html attribute. signup page based on following php template plugin, guess that's need edit, how? <?php /* * bootstrap template signup form * * outputs twitter bootstrap-compatible form * http://twitter.github.com/bootstrap/index.html * */ ?> <div class="wrap <?php echo $this->wrap_class ?>" > <?php // how html wrapper error messages can customized $this->print_errors( '<div class="alert %1$s">%2$s</div>','<p>%s</p>' ); ?> <?php $this->print_form_head(); // must included before fields output ?> <div class="form-horizontal pdb-signup"> ...

java - To upload a file using rich:fileUpload -

i'm facing problem while uploading file server, in code below can context. view.xhtml <h:outputtext value="subir archivo tráfico:" styleclass="label" /> <h:panelgrid > <rich:fileupload disabled="#{not administrarformtraficobean.edicionhabilitada}" fileuploadlistener="#{fileuploadbean.listener}" listheight="60px" id="upload" acceptedtypes="txt" ontyperejected="alert('Únicamente se pueden cargar archivos en formato .txt');" autoclear="true" maxfilesquantity="1" lang="es" donelabel="listo" deletelabel="eliminar" servererrorlabel="se produjo un error al subir el archivo" sizeexceededlabel="el tamaño de archivo supera el tamaño permitido!" clearlabel="limpiar" clearalllabel=...

java - Idea doesn't recognise persistence.xml -

Image
i faced weird behavior: ide can't recognize xml document if named "persistence.xml" , features syntax coloring & code completion doesn't work file. but when rename it, idea start support xml document. so, can reason of behavior? (debian, idea 14) updated persistence.xml: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="2.1" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="ex01" transaction-type="jta"> <jta-data-source>java:global/jdbc/ch08</jta-data-source> <properties> <property name="javax.persistence.schema-generation.database.action" value="create"/...