Posts

Showing posts from February, 2015

xcode - Concatenate .wav files in C++ -

how can i, using function, library, whatever have to, concatenate 2 .wav files? input should absolute paths, , output audio file created , placed (not played) somewhere, doesn't matter where. i writing mac command line application in xcode 6. the .wav file format simple format, consisting of fixed header defines audio file's properties; namely endian-ness, number of channels, , sampling rate. documentation defined on intertubes. off top of head don't recall if common library offers convenient way (it's worth looking through libsndfile's api documentation , fit bill). in case, shouldn't tough read headers of both wav files, check format, , create output file. if both wav files have same endian-ness, number of channels, , sampling rate, procedure trivial, otherwise have resample/remix @ least 1 of files.

node.js - JavaFX : How to process a webview in a non application thread -

i have javafx application contains webview among other javafx views in same window. webview opens url nodejs webapp consumes lot of cpu resources. with resource consumption webview, other javafx views working slowly. for our application, have powerful system 12 virtual threads in processor. so, need deport webview processing thread won't affect behavior of other javafx views. there way achieve this? you cannot this. javafx has single application thread per jvm process (java invocation) , webview api calls must processed on javafx application thread. note internally, webview uses webkit may have own threading implementation support html5 stuff web workers , hidden when programming webview @ java api level. won't make of difference unless explicitly program javascript make use of it. guess if nodejs webapp optimized other browsers work fine in webview, need benchmark, guess did , found wanting. may want expend effort optimizing nodejs webapp have. the ...

c# - Error while calculating percentage -

unable cast object of type 'system.web.ui.webcontrols.textbox' type 'system.iconvertible'. i getting error while converting. have 2 text boxes in 1 have amount , in have percentage value should come in third text box. public partial class caltxt : system.web.ui.page { double amt1; double exc; public void page_load(object sender, eventargs e) { } public void txtamt_textchanged(object sender, eventargs e) { amt1 = math.round(convert.todouble (txtamt)); //decimal percentagerate = convert.todecimal(this.txtamt.text); } protected void txtexc_textchanged(object sender, eventargs e) { double exc = math.round (convert.todouble(this.txtexc.text)); // decimal temp = (math.round(convert.todecimal(txtexc.text) / convert.todecimal(txtamt.text)*100)); // txttotalexc.text = temp.tostring(); } protected void txttotalexc_textchanged(object sender, eventargs e) { ...

How to zoom in the Image by ROI in MATLAB -

Image
i have 2 images. want see more detail in special region (roi). hence, draw red rectangular , zoom in original size (256 256) , display in second row below expected result. me solve in matlab? current code img1 = imread('peppers.png'); img2 = imread('coins.png'); img1=imresize(img1,[256 256]); img2=imresize(img2,[256 256]); %%draw rectangle subplot(221);imshow(img1); rectangle('position',[100 50 20 20], 'linewidth',2, 'edgecolor','r'); subplot(222);imshow(img2);rectangle('position',[100 50 20 20], 'linewidth',2, 'edgecolor','r'); %% zoom in image try (when images appears, use mouse select region of interest): img1 = imread('peppers.png'); img1=imresize(img1,[256 256]); f=figure; imshow(img1); rect = getrect(f); %//select roi mouse img1_roi = img1( rect(2) : (rect(2)+rect(4)) , rect(1) : (rect(1)+rect(3)) , : ); %//store roi in matrix img2 = imread('coins.png...

plsql - PL/SQL: Does SELECT INTO give the variable NULL if the value is NULL in the table? -

i ask question because trying make function returns value based on if selected information in table null or not. however, cannot argument in if statement true. so, have varchar2 variable prepared, , use select statement select info lv_test ... if lv_test != null --do not null stuff else --do null stuff now, in code use specifically, values lv_test , unless check them directly, if lv_test = 'ny' , becomes true , works, won't become true. not work whenever check null values, nor work if check = '' (initialized/default value). my experience in sql limited basic don't know yet. answer questions: how check null values select ... ... statement? why argument not work?

angularjs - ui-sref in parent div overriding all nested links -

we have series of notifications , want make overall item clickable related item. has been implemented using ui-sref , functions correctly. however, within that, there series of nested links go other relevant information. problem @ moment parent ui-sref overrides of these links. i've tried implementing these nested links standard anchor , ui-sref has same effect. hyperlink shows correctly, , when clicking on it, goes split second, reverts ui-sref link. here code example: <div class="notificationitembalanced"> <div class="notificationitem" ui-sref="community.act({slug: slug, id: id})"> <div class="messagebodywrapper"> <span class="messagetext"><strong><a ui-sref="user.posts({username: username})"></a></strong> commented on post</span> </div> </div> </div> is related ui-sref or there specific setting in r...

actionscript 3 - Adobe Flash Builder 4.7 Full Screening Scaling Problems -

in adobe air application, have room , player can walk around it. set automatically opens in fullscreen, however, when exit fullscreen doesn't scale anything, shows edge of room, can't see player or else. how make when exit fullscreen, scale down windowed version, , again? in adobe flash builder 4.7. i tried scaling down putting if statement in update function, checks if window full screened or not, , if not, it'll scale x , y down .5, , if full screened again, it'll scale 1. player changes position, , if try make x equal it again if move player, doesn't work. i've tried verticlecenter , horizontalcenter on both player , room, doesn't work. what i'm wondering if there stage.autoscale line can solve everything, or if have manually way i've tried. so got 2 options here. check fullscreen event , in listener function scale according logics. give more control on scaling , visual display of components , graphics. can find working example...

reactjs - React router and this.props.children - how to pass state to this.props.children -

i'm using react-router first time , don't know how think in yet. here's how i'm loading components in nested routes. entry point .js reactdom.render( <router history={hashhistory} > <route path="/" component={app}> <route path="models" component={content}> </route> </router>, document.getelementbyid('app') ); app.js render: function() { return ( <div> <header /> {this.props.children} </div> ); } so child of app content component sent in. i'm using flux , app.js has state , listens changes, don't know how pass state down this.props.children. before using react-router app.js defines children explicitly, passing state natural don't see how now. using couple of react helper methods can add state, props , whatever else this.props.children render: function() { var children = react.ch...

logging - to send logs from php application to graylog using monolog -

i have installed graylog server , dependencies.trying send logs php application graylog server using monolog. not aware of how use gelf handler.i have seen gelfhandlertest.php present inside project monolog not able set publisher , create handler.can please explain me sample code how use it. trying send logs localhost apache server set in same private network graylog installed. the testlogging file getting executed in php are, use monolog\logger; use monolog\handler\streamhandler; use monolog\handler\gelfhandler; use gelf\message; use monolog\formatter\gelfmessageformatter; $handler = new gelfhandler($publisher); how set publisher in monolog? any sort of appreciated.thanks

Use powershell to add text to a .conf file -

i tried add-content command add following lines .conf file didn't work, think reason didnt work because file not .txt file, .conf file. [sslconfig] sslversions = *,-ssl2,-ssl3 ciphersuite = tlsv1.2:!enull:!anull allowsslrenegotiation = false is there way of adding additional lines end of .conf file using powershell? "new line content" | out-file .\ssl.conf -append -encoding ascii

ide - Atom autoclose-html how to force inline closing tags -

Image
brand new atom. see can force html tags close inline using autoclose-html package. however, when populate list tags close inline, still closing on separate line. how should list formatted? see defaults default: ['title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] and first tried adding ...'p', 'span'] list, , did not work. found list in autoclose-html.coffee , added same, no avail. doing wrong? the way did (mac os - should same other os's): bring atom settings (atom menu --> preferences) select packages select autoclose-html settings select view code expand lib folder select configuration.coffee make changes in there , save file. restart atom all done!

c# - Jumping onto a platform -

i making 2d platform game in untiy android , having issues section of code have. when jump onto platform first time can land onto platform when jump again fall through platform. have box collider inactive if player less height of platform , active when player higher platform. thought box collider small , missing collider have tried different sizes of colliders , have tried adjusting different heights @ activates. when set height low player double jump. doing wrong? public class rock : monobehaviour { private boxcollider2d platform; private playerscript player; public float height; void awake() { player = gameobject.find("player").getcomponent<playerscript>(); platform = getcomponent<boxcollider2d>(); } void start () { platform.enabled = false; } // update called once per frame void update () { if(player.transform.position.y > height){ platform.enabled = true; } el...

c - Printing Sums within range for a Binary Search Tree -

i've got code working, reason isn't taking values of each node , adding them up. instead, output sum 0 each time. thought sum = sum + data line in btreesumrange method take care of this. idea how fix this? #include <stdio.h> #include <stdlib.h> static long long sum; typedef struct node { long long data; struct node *left; struct node *right; } node; node * btreeinsert(node *node,long long data) { if(node==null) { struct node *temp; temp = (struct node *)malloc(sizeof(node)); temp -> data = data; temp -> left = temp -> right = null; return temp; } if(data >(node->data)) { node->right = btreeinsert(node->right,data); } else if(data < (node->data)) { node->left = btreeinsert(node->left,data); } return node; } void btreesumrange(node *tree, long long min,long long max) { if (tree == null) { ...

javascript - Dynamically assigning ng-model inside a form -

similar dynamically assign ng-model except solutions provided assign same element. want assign elements inside element. for example given form <form name="myform" my-directive controller="mycontroller me"> <input name="email"> <input name="password"> <button type="submit" ng-click="me.submit()"> </form> i transform to <form name="myform" my-directive controller="mycontroller me"> <input name="email" ng-model="email"> <input name="password" ng-model="password"> <button type="submit" ng-click="me.submit()"> </form> i thinking compile "pre" $compile seem side effect of ng-click being assigned twice.

javascript - How to session variable using jquery and PHP -

in code want assign value of jquery variable php variable , session php variable , use in page.for session using jquery plugin jquery.session.js.but getting error typeerror: cookies[i].split not function . $(function() { var certificate_id =123; $.session.set("myvar", certificate_id); alert($.session.get("myvar")); }); please me in solving this. please provide more information, error occur? use cookies[i].split function? additionally, can't manipulate php session variable directly using jquery session variable. instead, need combination of ajax , php script. please refer setting php $_session['var'] using jquery

reliable to read loop variable after loop in Python -

this question has answer here: short description of scoping rules? 7 answers is safe read loop variable after loop (using python 2)? purpose check how many iterations in loop done. here code show idea: a=[1,2,3,4,5] in range(len(a)): if a[i] == 2: break print # output 1, safe read here? yes, fine read there. because when create for loop, internally, has mechanism create indexer (in case being i ) , increases 1 one assigning new value every time. thus, can use i after for loop. after: a=[1,2,3,4,5] in range(len(a)): if a[i] == 2: break i isn't dropped. drop i , can use del keyword: a=[1,2,3,4,5] in range(len(a)): if a[i] == 2: break del #deleted here print # give error! while replace is, need redefine it: a=[1,2,3,4,5] in range(len(a)): if a[i] == 2: break = [] #now l...

PHP $GLOBALS as array issue -

i trying store array in $globals , using following code: $globals['cols'] = array(); but seems printing word 'array' actual page being called. any ideas why it's doing or how can around it. there variable named $cols being echoed echoing 'array'. changed $globals['cols'] $globals['columns'] , it's been removed. thank replies

java - SAXParseException: An invalid XML character (Unicode: 0x13) was found in the element content of the document -

i getting following error message when code trying parse xml data. org.xml.sax.saxparseexception; linenumber: 1; columnnumber: 2056552; invalid xml character (unicode: 0x13) found in element content of document.     a  t  com.sun.org.apache.xer ces.internal.util.errorhandlerwrapper.createsaxparseexception(errorhandlerwrapper.java:19     a  t  com.sun.org.apache.xer ces.internal.util.errorhandlerwrapper.fatalerror(errorhandlerwrapper.java:177)     a  t  com.sun.org.apache.xer ces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:441)     a  t  com.sun.org.apache.xer ces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:36     a  t  com.sun.org.apache.xer ces.internal.impl.xmlscanner.reportfatalerror(xmlscanner.java:1436)     a  t  com.sun.org.apache.xer ces.internal.impl.xmldocumentfragmentscannerimpl$fragmentcontentdriver.next(xmldocumentfragmentscannerimpl.java:2927)     a  t  com.sun.org.apache.xer ces.internal.impl.xmldocumentscannerimpl.next(xmld...

android studio LinearLayout image starting point -

i new android programming , trying position "circle ball" image file linearlayout in middle. so, have tried making 7 linearlayouts equally divided , trying put image @ bottom of 4th linearlayout . code below shows have 7 linearlayouts . how can put "circle ball" image @ bottom of 4th linearlayout? also, creating 7 linearlayouts idea? purpose of ball move ball next linearlayout when click "next" button . <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:layout_above="@+id/view"> <linearlayout android:id="@+id/layout1" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <linearlayout android:id="@+id/layout2" android:layout_weight="1" a...

c++ - switch case being used in a do{}while statement causes the GoAgain to not work properly -

the following code when run fails activate commands in switch statement prevents goagain @ end of } while not work correctly in asking user if want exit before so. goagain() function works correctly , when called in others. tried having run addition outside of case(even though need fix math) , runs. tries run switch statement sets goagain false , terminates. help! // fractions project.cpp : defines entry point console application. // #include "stdafx.h" #include <iostream> #include <string> using namespace std; // ================= struct fraction { int num; int den; }; // structure fraction // ===================== // ================== // funtion prototypes // ================================= fraction add(fraction, fraction); fraction multiply(fraction, fraction); fraction subtract(fraction, fraction); fraction divide(fraction, fraction); void printfraction(string, fraction); void setfraction(...

In a perl string, how can I replace a unicode em dash with 2 ascii hyphens? -

i first tried find in line using: $w = index($line, "\x{2014}"); i got no syntax error, $w never >= 0. i tried: $line =~ s/\x{2014}/--/g; and didn't work either, ie: no changes made. what's simplest way make swap? if explained in prior posts, didn't see where. works me: #!/bin/perl -w use feature 'unicode_strings'; use utf8; $line = "first — , second"; $line =~ s/\x{2014}/--/g; print("$line\n"); # => first -- , second

web services - PHP SOAP Call Client Functions -

i need call soap client functions without libraries(nusoap , zendframework , laravel) should work php native because requiriment proyect more important on future moment practice simple public web service here( http://www.service-repository.com/operation/show?operation=getcitiesbycountry&porttype=globalweathersoap&id=4 ) , need help.i try call client soap functions recive error: fatal error: uncaught soapfault exception: [soap:server] system.web.services.protocols.soapexception: server unable process request. ---> system.data.sqlclient.sqlexception: procedure or function 'getwcity' expects parameter '@countryname', not supplied. @ webservicex.globalweather.getcitiesbycountry(string countryname) --- end of inner exception stack trace --- in /applications/xampp/xamppfiles/htdocs/php-soap/soap/client.php:41 stack trace: #0 /applications/xampp/xamppfiles/htdocs/php-soap/soap/client.php(41): soapclient->__soapcall('getcitiesbycoun...', array) #...

Convert RGBA-image to black and white image in Tensorflow -

Image
tf.image.decode_png() can output grayscale, rgb , rgba image. but i'd convert rgba pure black , white in tensorflow (without using pillow ). please give me advice. use tf.select thresholding pil_image = pilimage.open('/temp/panda.png') show_pil_image(pil_image) pil_buf = open('/temp/panda.png').read() contents = tf.placeholder(dtype=tf.string) decode_op = tf.image.decode_png(contents, channels=1) gray_image = tf.squeeze(decode_op) # shape (127,127,1) -> shape (127,127) sess = create_session() [decoded] = sess.run([gray_image], feed_dict={contents: pil_buf}) show_pil_image(pilimage.fromarray(decoded)) contents = tf.placeholder(dtype=tf.string) decode_op = tf.image.decode_png(contents, channels=1) gray_image = tf.squeeze(decode_op) # shape (127,127,1) -> shape (127,127) select_op = tf.select(gray_image>127, 255*tf.ones_like(gray_image), tf.zeros_like(gray_image)) sess = create_session() [decoded] = sess.run([select_op], feed_dict...

fullscreenchange - firefox browser settings to avoid appearance of menu bar or task bar in full screen when pointing mouse on the top of the screen -

i using firefox 3.0 in rhel6.2.wwhen press f11, fullscreen mode appears, if mouse pointer goes top of screen @ fulscreen mode task bar appears. want avoid appearance of bar. have searched net got answers how show them in full screen. please suggest me settings need do. go ~/.mozilla/firefox/<profile folder>/chrome/ (check in profiles.ini profile using), , put piece of code in userchrome.css (create 1 if doesn't exist) /* needed once */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); #fullscr-toggler { display:none!important; } source: https://support.mozilla.org/en-us/questions/942904

frameworks - Protected folder in yii folder is missing -

hello i'm new yii framework . and think i've been succeed install in computer. problem when want connect phpmysql in xampp cannot find folder name 'protected' needed connect myproject yii . so can me this? thank you. if protected folder not there, how can successded in installing it. try installing again. try below yii2 template. follow guide install on system properly. must know composer installing template. https://github.com/yiisoft/yii2-app-advanced

Python flask delete 500 internal server error -

i'm running 500 internal server error in delete def: def delete(self, flight_id): session = db.get_session() try: spend_for_flight = session.query(func.count(db.snapshot.rowid))\ .join(db.flight, db.flight.strategy_id == db.snapshot.strategy_id)\ .filter(and_(db.snapshot.interval >= db.flight.start_date, db.snapshot.interval <= db.flight.end_date, db.flight.rowid == flight_id)).scalar(); # there spend @ least 1 of these flight dates if spend_for_flight > 0: response = jsonify(error="flight has spend. cannot delete.") response.status = 400 return response elif spend_for_flight == 0: session.query(db.flight).filter(db.flight.rowid == flight_id).delete() session.commit() return 204 except sqlalchemy.exc.sqlalchemyerror, exc: session.rollback() reason = exc.message response = jsonify(error=reason) ...

c++ - Integration issue to tess-two (Tesseract Tools for Android)library into an Android studio and build ndk -

i want import tess-two library in android studio , after compilation show error in ndk build. have tries solution given on stackoverflow. , execution failed task ':app:compiledebugndk' did not resolved issue. please suggest me doing wrong. it show following error : error:error: undefined reference 'isnanf' error:error: undefined reference '__isinff' error:error: undefined reference 'isnanf' [arm64-v8a] install : libtess.so => libs/arm64-v8a/libtess.so error:error: undefined reference 'isnanf' error:error: undefined reference '__isinff' error:error: undefined reference 'isnanf' [x86_64] install : libjpgt.so => libs/x86_64/libjpgt.so error:error: linker command failed exit code 1 (use -v see invocation) error:error: linker command failed exit code 1 (use -v see invocation) make: *** [obj/local/armeabi-v7a/libtess.so] error 1 make: *** waiting unfinished jobs.... make: *** [obj/local/armeabi/libtess.s...

ruby - Is it safe to reuse Faraday connection objects? -

is safe reuse faraday connection objects, or better recreate them every time? def connection @connection ||= faraday.new('http://example.com') |conn| conn.request :url_encoded # more configuration end end i think it's safe reuse them (i have, lot). don't see covered 1 way or in documentation presence of "per-request options" (as opposed per-connection) @ least implies can rely on making multiple requests same connection.

sql - c# pushing to database REALLY slow -

i'm making folder/text file reader in one. obtained data should pushed sql server. it's going really, really.. slow. really slow => data needs inserted: 2.73 gb (2,938,952,122 bytes) spread over 78,995 files, 5,908 folders with folder structure of folder (toplevel) folder folder textfiles ... more folders -> 100 maybe folder folder textfiles .. .. 60 folders total ... ... i've been reading them 3 days or smth also because files contain lot of duplicate values think it's slow too reasons think happening: because have relational database need keep opening new connection nested foreach is there way increase dramatic performance? should use sqlbatchcopy instead? can use relation table because examples see 1 table getting filled, ignoring foreign key's need inserted (my get generated auto increment in sql db) is there maybe solution make lot easier? source code: static void leestxt(string rapport,...

Please help me explain the Java mechanism for transpose a matrix (code is attached) -

i newbie java, currently, practicing codes of java. trying build matrix class myself. however, refers code jama ( http://math.nist.gov/javanumerics/jama/doc/jama/matrix.html ). feel quite strange. here structure of matrix class, jama defined in later part. can me explain why transpose() return x (in thinking, c array stransposed elements of x,elements of x same order. why jama return x, , role of c-array in program?). thank much. public class matrix { private double[][] a;// 2-d array hold matrix element private m,n ; // number of column , row. // constructors omit //public methods: // don't understand this: public matrix transpose () { matrix x = new matrix(n,m); double[][] c = x.getarray(); (int = 0; < m; i++) { (int j = 0; j < n; j++) { c[j][i] = a[i][j]; } } return x; // while returns x? seem x not transpose c. // seems there no connection between x , c. role o...

java - How to integrate Spring Retry with AsyncRestTemplate -

how can integrate spring retry external calls asyncresttemplate ? if it's not possible, there framework supports it? my use case: public void dosomething() throws executionexception, interruptedexception { listenablefuture<responseentity<string>> future = asyncresttemplate.getforentity("http://localhost/foo", string.class); // tasks here responseentity<string> stringresponseentity = future.get(); // <-- how retry call? } how retry future.get() call? if external service returns 404, want avoid calling tasks in between again , retry external call? can't wrap future.get() retrytemplate.execute() because won't make call external service. you have wrap entire dosomething (or @ least template operation , get) in retry template. edit instead of calling get() add listenablefuturecallback future; this... final atomicreference<listenablefuture<responseentity<string>>> future = new at...

javascript - Image preview not working properly -

i have code shows image before uploading not working shows image if there no height or width set if try fix height , width same dimensions doesn't works properly <?php echo '<input type="file" id="changeme" name="file" multiple/> <div id="output"></div> </div> <div id="right"> <script> function fileload(e) { var files=e.target.files || e.datatransfer.files (var i=0, f; f=files[i]; i++) { parsefile(f) } } function parsefile(file) { var reader=new filereader(); reader.onload=function (e) { var output=document.getelementbyid("output"); output.innerhtml +="<img src=" + e.target.result + " />"; } reader.readasdataurl(file); } if(window.file && window.filelist && window.filereader) { var fileselect=doc...

for loop - Running factor analysis using split function in R -

i have following dataset : mkt econ_unemp econ_gas open 504 0.0743088 3.461 38 504 0.0740673 3.448 38 504 0.0740673 3.455 38 504 0.0740673 3.42 38 504 0.072682 3.391 38 505 0.0692244 3.345 38 505 0.0692244 3.381 38 505 0.0692244 3.484 38 505 0.0692244 3.488 38 i need run factor analysis on 3 variables market used split function in r split data: splitx<-split(data,data$dma) and tried running factor analysis follows: for (i in 1:length(splitx)) { fa <- factanal(splitx[[i]],factors =1) } but getting following error: error in optim(start, fafn, fagr, method = "l-bfgs-b", lower = lower,:non-finite value supplied optim i hope information provided sufficient. can me fix this. regards by(data[, -1], data[, 1], factanal, factors = 1) that should trick, assuming mkt split variable.

staging - Retrieving an old version of a file using Git -

say want retrieve old version of file (filename.html) few commits ago. right in thinking need git checkout sha -- filename.html (where sha hash of commit want) but puts file in staging index, , not working directory, right? if run git commit repo update have old file in place, working directory still have newer file (which don't wont more). i suppose git checkout -- filename.html 2 in sync, best way it? process seems quite drawn out 1 , 1 messy quickly. there way old version of filename.html in working directory without getting 'stuck' in staging index? thanks. but puts file in staging index, , not working directory, right? it put old version both in index and working tree. if run git commit repo update have old file in place, working directory still have newer file no, have older version of file. i suppose git checkout -- filename.html 2 in sync, best way it? to latest version, have to: git reset head -- filename.html # re...

c# - How do I use Ncalc.Expression to solve for y? -

i want input string: "pow(y,2) = 4 - pow(x,2)" (in other words, y^2=4-x^2) and make "x" = 1, have evaluate , give me value of y. how do this? so want solve equation y given number x? means 'y' function of x, so: var y = new expression("sqrt(4 - pow(x, 2))"); // y = sqrt(4 - x^2) e.parameters["x"] = 1; var x = y.evaluate(); wouldn't solve problem? (other square root of plus/minus something, you'd hav add logic)

java - how to validate all preflight error for PDF/A-1a in pdfbox -

i working vaildate pdfa/1a .i followed code exist in link pdfbox preflight pdf/a-1b check not working in java version 1.8 public class test { public static void main(final string[] args) throws exception { file pdfa=new file("d:/dmc-b787-a-00-40-07-00a-008b-d.pdf"); // error pdf ispdfadocument(pdfa); system.out.println("sucess"); } private static void ispdfadocument(file pdfa) { validationresult result = null; preflightparser parser; try { parser = new preflightparser(pdfa); parser.parse(format.pdf_a1a); preflightdocument documentt = parser.getpreflightdocument(); result = documentt.getresult(); system.out.println("result"+result); documentt.close(); } catch (syntaxvalidationexception e) { result = e.getresult(); } catch (ioexception e) { e.printstacktrace(); } if (result.isvalid()) { system.out.println("the fi...

cmake - Building spectrum2 on non root server -

as subject says i've trouble installing spectrum2 on non root server. main problem i've build lot of dependencies source , link them correct. i've installed log4cxx dependencies in /home/$user/log4cxx_build/apache-log4cxx-0.10.0 . when trying cd libtransport , make following result: $user@puppis libtransport]$ make [ 1%] built target pb [ 1%] building cxx object plugin/cpp/cmakefiles/transport-plugin.dir/networkplugin.cpp.o in datei, eingefügt von /home/$user/libtransport/plugin/cpp/networkplugin.cpp:23: /home/$user/libtransport/include/transport/logging.h:30:28: fehler: log4cxx/logger.h: datei oder verzeichnis nicht gefunden /home/$user/libtransport/include/transport/logging.h:31:37: fehler: log4cxx/consoleappender.h: datei oder verzeichnis nicht gefunden /home/$user/libtransport/include/transport/logging.h:32:35: fehler: log4cxx/patternlayout.h: datei oder verzeichnis nicht gefunden /home/$user/libtransport/include/transport/logging.h:33:42: fehler: log4cxx/prop...

PHP - How to handle including content? -

for particular project, not require huge mvc framework, going how used write php applications: header.php footer.php -- pages index.php but, using frameworks, such laravel templating engine blade have got used when creating header.php use (e.g.): <html> <head> <title>test</title> </head> <body> @yield('content') </body> </html> then in of pages: @section('content') @stop no, moving old standard, having this: in header: if(function_exists("content")) { content(); } then in of pages: function content() { ?> test <?php } ?> as can see, not appealing @ all. does know of alternative way of doing similar blade (without using blade)? or of way makes process more easy understand , lot less messy? even if don't feel it's necessary use mvc framework build application it'd still best choice because there's taken care of authentication , ...

php - Laravel behaving madly - showing wrong images -

i have website satoshirps.site when new user registers, profile photo remains empty. goto upload picture upload profile picture. after returning dashboard (www.satoshirps.site/dashboard) user see uploaded profile picture. goto delete picture delete current profile picture , upload profile picture using upload. this time returning dashboard gives old picture(which weird). when tried thing, uploaded picture second time (i checked file in app's folder). not getting correct image. lavarel have cache or cookie problem. tried again deleting browser's cache , cookie nothing worked. the upload page : <!doctype html> <html> <head> <meta charset="utf-8"> <title>upload</title> </head> <body> @if(session::has('success')) {{ session::get('success') }} @endif @if(session::has('error')) {{ session::get('error') }} @endif {{ form::open(array('url' => ...

Pygame: How to ignore collisions -

okay making 2d scroller game pygame want able control when take collisions consideration. example, after player collides , dies respawns straight away in middle of screen, problem there collision object close kills player instantly. want small time period in player immured collisions allowing move away safety first carry on playing ad normal. thinking maybe placing respawns in dummy sprite group on time remove , add group has collisions. don't know. when player dies, set variable number of frames want invulnerable for. when collision detection, can check if player has frames of invulnerability left, , handle collisions when there no frames left. def kill_player(player): # handle moving player after death, else need # set player invulnerability 30 frames player_invulnerable_frames = 30 if environment_rect.collides(player_rect) , player_invulnerable_frames = 0: # perform collision response stuff here in game loop, or maybe update function, can dec...

ios - swift App using cocoapod fails to launch after 20.00s -

i created default 1 view swift project , added 11 libraries in podfile. can run app inside xcode, app fails run when run phone directly stack: incident identifier: 3eb8a44e-8f2c-407a-ae7b-a314e62ac61b crashreporter key: d8ab2628e36e1c5ef60c63f217d734d62950b336 hardware model: iphone5,2 process: testpod [1250] path: /var/mobile/containers/bundle/application/0f6bfe2a-4fd0-4553-9ab6-cfc5281fe707/testpod.app/testpod identifier: com.franck.testpod.testpod version: 1 (1.0) code type: arm (native) parent process: launchd [1] date/time: 2016-03-17 10:48:44.44 +0100 launch time: 2016-03-17 10:48:22.22 +0100 os version: ios 9.2.1 (13d15) report version: 105 exception type: 00000020 exception codes: 0x000000008badf00d exception note: simulated (this not crash) highlighted thread: 0 application specific information: com.franck.testpod.testpod failed launch after 20.0...

android - CreateTempFile returns No Such File or Directory in Pictures folder? -

so here code: string timestamp = new simpledateformat("yyyymmdd_hhmmss").format(new date()); string imagefilename = "jpeg_" + timestamp + "_"; file storagedir = environment.getexternalstoragepublicdirectory(environment.directory_pictures); file image = file.createtempfile( imagefilename, /* prefix */ ".jpg", /* suffix */ storagedir /* directory */ ); however, application intermittently throws error @ file.createtempfile : java.io.ioexception: open failed: enoent (no such file or directory). from documentation of file : parameters: prefix prefix temp file name. suffix suffix temp file name. directory location temp file written, or null default location temporary files, taken "java.io.tmpdir" system property. may necessary set property existing, writable directory method work properly. returns: temporary file. throws: illegalargumentexception - if length of prefix less 3. ioexception - if er...

printing - WKWebView Print Response Headers in Swift 2 -

how can see response headers wkwebview loadrequest ? eg let url = nsurl(string: "http://www.anywebsite.com")! let urlrequest = nsurlrequest(url: url) wkwebview.loadrequest(urlrequest) then print headers in response. you have assign wkwebview.navigationdelegate. in navigationdelegate's methods provide wknavigationresponse, can cast navigationresponse.response nshttpurlresponse access navigationresponse.response.allheaderfields.

how to generate a new array in perl each time a loop runs -

this question has answer here: creating arrays dynamically in perl 4 answers i running loop , each time need store information in new array. how generate new array each time loop runs @array1, @array2 , @array3 , on? what want array of arrays, i.e. multi-dimensional array. my @arrays; $i(0..10) { $arrays[$i] = ['data1', 'data2']; } print $arrays[0][0]; print $arrays[0][1];

Get Git commit hash from commit message -

Image
is possible hash of commit commit message? i ran following git log | grep tap , got list of commit messages only, no hashes. i need cherry-pick few of listed commits, don't want manually search them find commit hashes. yep can. you have minor mistake in command: correct command use --grep flag log , not unix command after pipe | git log --grep=".. text need find ..." git log --grep=<pattern> limit commits output ones log message matches specified pattern (regular expression). with more 1 --grep=<pattern> , commits message matches of given patterns chosen (but see --all-match ). when --show-notes in effect, message notes matched if part of log message.

Inheritance - different files (C++) -

i'm trying out inheritance tutorial in different files, .h , .cpp. i've done necessary #include of header files. couldn't figure out wrong code, when trying run it. have error stating that: severity code description project file line error c2011 'person': 'class' type redefinition error c2027 use of undefined type 'person' error c2065 'idnum': undeclared identifier error c2065 'lastname': undeclared identifier error c2065 'firstname': undeclared identifier error c2027 use of undefined type 'person' error c2065 'idnum': undeclared identifier error c2065 'firstname': undeclared identifier error c2065 'lastname': undeclared identifier below code: person.h #include <iostream> #include <string> using namespace std; class person { private: int idnum; string lastname; string fi...