Posts

Showing posts from January, 2012

java - Add Image with jOpenDocument in odt document (writer) -

i'm trying jopendocument api , want add/insert image. can api? i'm interested in jopendocument because enables me create template , process document afterwards java (which don't think it's possible odfdom apache). the thing found can this: final file outfile = new file("output.odt");  final string bcfile = "image.png";  final javascriptfiletemplate template = new javascriptfiletemplate("template.odt");  final odsinglexmldocument ddoc = template.createdocument();  ddoc.getdescendantbyname("draw:frame","pc_lsbarcode").setattribute("href", "file:///" + bcfile,namespace.getnamespace("xlink", "http://www.w3.org/1999/xlink")); ddoc.saveas(outfile);  as can see href , result odt file won't portable depends on path of image. are there native methods in jopendocument api can insert images in odt document?

node.js - Grunt Watch LESS files in folder and create css when less file is changed -

i looking grunt automation task watches less files in root directory , gives css files of same name less files in same directory like root folder package.json gruntfile.js folder1 file1.less file2.less folder2 file3.less file4.less my gruntfile.js module.exports = function(grunt) { grunt.initconfig({ //our less options less: { development: { files: { "": "" //not able write line, how can mention file compile watching entire folder } } }, watch: { css: { files: '**/*.less', tasks: ['less'] } } }); //load our tasks grunt.loadnpmtasks('grunt-contrib-less'); grunt.loadnpmtasks('grunt-contrib-watch'); //default tasks run grunt.registertask('default', ['less']); } not able mention source les

unable to select the drop down list in selenium webdriver in java -

this selenium webdriver code package com.ej.zob.modules; import org.openqa.selenium.by; import org.openqa.selenium.support.ui.select; public class employee { public void execute(string toplink,string username,string password,string email,string createdon, string rolename,string firstname,string lastname, string company, string phone ){ launchapplication.driver.findelement(by.classname(toplink)).click(); launchapplication.driver.findelement(by.id("field-username")).sendkeys(username); launchapplication.driver.findelement(by.id("field-password")).sendkeys(password); launchapplication.driver.findelement(by.id("field-email")).sendkeys(email); launchapplication.driver.findelement(by.id("field-created_on")).sendkeys(createdon); //launchapplication.driver.findelement(by.tagname("") launchapplication.driver.findelement(by.linktext("select role name")).click(); launchapplication.driver.findelements(by.id("field-role_name&quo

java - Android Unity plugin -

i want use unity android plugin in ar application. app has ar camera, image target , 3d object. on eclipse : i create default android application on eclipse. click build automatically , check project name -> proeprties -> islibrary . create class named bridge on eclipse project. bridge.java package com.tutorial.pluginforunity; public class bridge { public static int returnint() { return 5; } } on unity : create bridgeforunity.cs file. conent of : using unityengine; using system.collections; using system; using system.runtime.interopservices; public class bridgeforandroid : monobehaviour { #if unity_android //&& !unity_editor public static int returnint () { androidjavaclass ajc = new androidjavaclass("com.tutorial.pluginforunity.bridge"); return ajc.callstatic<int>("returnint") ; } #endif void start () { } void update () { } } i edit defaulttrackable

Angularjs Display single element from json -

i have json file contains different prices service, depending on day of week (in weekend it's more expensive) use angular show these prices using lines this: <div ng-repeat="arr in arrangementen | filter:'_1'" >mon-fri: € {{arr.prijs_ma_vr | number :2 }} </div> <div ng-repeat="arr in arrangementen | filter:'_1'" >sat: € {{arr.prijs_za | number :2 }} </div> json: { "id": "_1", "arrangement": "vriendinnendag", "prijs_ma_vr": 99.95, "prijs_za": 103.95, "prijs_zo": 104.95, }, { "id": "_2", "arrangement": "vipdag", "prijs_ma_vr": 199.95, "prijs_za": 205.95, "prijs_zo": 209.95, } i wonder if there more smart , easier way display these prices or other elements json. want display 1 element (

arrays - What is the top of the stack in various stack implementation? -

when implementing stack, element stack's top? stack implemented linked list stack implemented array stack implemented linked list in implementation, have linked list, , pointer/reference first element of list. element top of stack. when want add element, create new node, link current head, , modify head new element. push(x) in stack. when pop() element, take head, set new head following element, , return value of old head. both operations done in constant time. stack implemented array when implementing stack array, circular array implementation. means if array of length n , refer element @ index 0 , 1 @ index n-1 adjacent. in implementation, hold index of "top" of stack, , modify whenever pop or push elements stack. top of stack not in constant index in implementation.

Can react-native load a js file remotely? -

in facebook's official example, says nsurl *jscodelocation; /** * loading javascript code - uncomment 1 want. * * option 1 * load development server. start server repository root: * * $ npm start * * run on device, change `localhost` ip address of computer * (you can typing `ifconfig` terminal , selecting * `inet` value under `en0:`) , make sure computer , ios device * on same wi-fi network. */ jscodelocation = [nsurl urlwithstring:@"http://localhost:8081/index.ios.bundle"]; my question can use js file remotely, e.g., " http://www.example.com/index.ios.bundle "? i got error the requested url /index.ios.bundle not found on server. yes, react-native can load js file remotely. you should upload bundled js file server , change jscodelocation variable.

scanf - How to read integers with sscanf separated by symbols in C? -

so have string following value [7, 8] now wan't store each value (only numbers) in 2d array [1][2]. i'm pretty sure using sscanf best way this, how tell sccanf read integers? thanks in advance sscanf("[%d,%d]", array[a][b], array[c][d]);

Rewriting .on methods for jQuery 1.6 -

i want build in plugin, written jquery 1.11 site, written on jquery 1.6. plugin has several methods goes like document.on('touchstart mousedown ...', function(){...}); they should rewritten jquery 1.6. how should rewrite these methods? unfortunately not find info in api of jquery. how along lines of: jquery.fn.on = function() { alert('overriden'); };

osx - ngrok command not found -

for many of question might sound stupid don't command line , i'm new mac. i'm trying install ngrok (which i've been using while on windows no issues) on 1 week old yosemite , these steps i've followed far. 1. downloaded ngrok here https://ngrok.com/download . 2. unziped file , copied unix executable file application. now understand need open terminal, move inside application folder , write ngrok http 80 . result of "command not found". i've sign @ ngork website , run terminal command ./ngrok authtoken "blablabla" , result "no such file or directory" can tell me how proceed able activate tunnel ngrok ? thank much short answer : put executable file in /usr/local/bin instead of applications. should able run commands ngrok http 80 . long answer : when type commands ngrok in terminal, macs (and other unix oss) these programs in folders specified in path . path list of folders that's specified

ios - How to get the device name and type of device while scan local network? -

i scanning local network , getting ip , mac address, want device name "hassan's iphone" , type of device, me how can this. thanks in advance i think need have @ in following link: stumbler we deal wireless on iphone: 802.11, gsm, , bluetooth. stumbler lets view wireless networks in area. while right stumbler handles 802.11 networks, should see bluetooth , gsm capabilities well. stumbler still in alpha stage, functional, , pretty stable however thoroughly mention that: stumbler can not distributed through app store, uses private apis! following link blog post found above stumbler google code project! so i'm not sure if require possible do, won't able publish through apple app store. you better read following stackoverflow answers too: programmatically finding ip address of computer on lan gethostbyname xcode issues https://stackoverflow.com/a/27099363/1752988 how scan devices in lan network another blog post mentioned

html - Passing javascript variable to popup DIV -

i have html main page div popup. when user click button in main html page, hidden value collected javascript. , javascript open popup. can value collect javascript sent popup? in following code, value apple need display echo $abcd. <div class="pages"> <input type="button" name="addquestion" value="click" /> <input type="hidden" value="apple" name="cellname" /> <div> <div class="popup" id="popupid"> <?php echo $abcd; ?> <div> java script var cell = document.getelementsbyname("cellname"); (var = 0; < cell.length; i++) { cell[i].strcell = cell[i].value; cell[i].onclick = popupmenu; } function popupmenu() { var abcd = this.strcell; // need send value popup div. document.getelementbyid("popupid").style.display = 'block'; }

linux - Shell out into zsh and execute commands from bash script -

i'm trying hand little virtualisation, i've been using vagrant provision centos7 vm , configuring applications. my vagrant config runs bootstrap.sh file bash script, in install zsh, want configure per https://github.com/sorin-ionescu/prezto . step 1 launch zsh run commands. this code have @ moment. echo "installing zsh" yum install -y zsh echo "configure zsh" # touch /home/vagrant/.zshrc exec /usr/bin/zsh git clone --recursive https://github.com/sorin-ionescu/prezto.git "${zdotdir:-$home}/.zprezto" setopt extended_glob rcfile in "${zdotdir:-$home}"/.zprezto/runcoms/^readme.md(.n); ln -s "$rcfile" "${zdotdir:-$home}/.${rcfile:t}" done chsh -s /bin/zsh i want default shell when ssh vm. not appear working, there no errors vagrant step want know if possible , if seems correct? thanks exec zsh replaces shell zsh -- doesn't in way tell instance of zsh pick @ same point in execution, or run sam

c# - Using SQL That Return Varied Columns with Out Of Memory asp mvc -

i'm working on generic search object , relation objects. execute sql query , display data dynamically on grid. problem faced query returns varied columns (more 18) , data (1474656 records) , when return data display them in grid out of memoryexception occured. how can solve problem? your grid needs either implement paging solution (fairly easy) or need load rows on demand user scrolls down (could little bit more difficult). regardless, should loading small subset of data needed display on ui.

html - Can I have a non-clickable section of a link? -

hopefully simple enough, in below example want blue section of link clickable (as link) red section not be. planning subscribe red section's onclick event after javascript. spent hour on , getting nowhere! know how this? .outer{ width:300px; height:50px; background-color:blue; position:relative; display:block; color:white; z-index:1; } .inner{ width:150px; height:25px; background-color:red; top:0; right:0; position:absolute; pointer-events:none; z-index:2; } <a href="http://google.co.uk" class="outer"> clickable <div class="inner"> not clickable </div> </a> i thought inner div having higher z-index , no pointer events it, doesn't seem work. anybody have ideas? instead of hacking html that, bad practice. why not: .outer { background-color: red; display: inline-block; } .inn

It is possible to async a local_action in ansible? -

i'm using ansible provision vagrant machines. want playbook uncompress database dump, import in vm , recompress back. in "normal" mode not big deal, since dumps can pretty big uncompress/compress operation take lots of time. use "fire , forget" method described here https://docs.ansible.com/playbooks_async.html the idea is: "fire , forget" dump bunzip [ other operations package install, configurations ecc] get bunzip import dump fire , forget dump recompression if attempt bunzip using local_action dies error: unexpected error: unable determine jid it possible async local task? edit tasks list example # start async unzip - name: bunzip dump command: bunzip2 /vagrant/vagrant_provision/dump.sql.bz2 async: 10000 poll: 0 register: bunzip_status #[... other things ...] # connect unzip , wait end - name: check dump bunzip async_status: jid={{ bunzip_status.ansible_job_id }} register: bunzip_result until

PHP array check if value in specific key exists -

i using php 5.5.12 . i have following multidimensional array: [ { "id": 1, "type":"elephant", "title":"title of elephant" }, { "id": 2, "type":"tiger", "title":"title of tiger" }, { "id": 3, "type":"lion", "title":"title of lion", "children":[{ "id": 4, "type":"cow", "title":"title of cow" }, { "type":"elephant", "title":"title of elephant" }, { "type":"buffalo", "title":"title of buffalo" }] } ] i iterating array using foreach loop. the array key type must

logging - How to log request body in JAX-RS client -

i need see request body client jax-rs request in order verify serialization works correct , reuse request test clients postman . i know it's possible activate logging jersey using example resource.addfilter(new com.sun.jersey.api.client.filter.loggingfilter()); . however, don't use jersey or resteasy implementation directly, abstracted via jax-rs api: final webtarget target = clientbuilder.newbuilder().build().target("http://localhost:8080"); how can enable logging here? result the answer @peeskillet + this snippet . however close() method snippet not being invoked jax-rs implementation ( org.jboss.resteasy:resteasy-client-3.0.11.final in case). jax-rs 2.0 (which looks you're using), has clientrequestfilter . can register client or webtarget . filter method, can entity, , logging public class loggingfilter implements clientrequestfilter { private static final logger log = logger.getlogger(loggingfilter.class.getname()

c# - Scripts in mvc blank -

i started empty project: empty webapi project has grown bit, , need have 1 layouted page. things added page: added controller named: streamcontroller added /views/stream/details.cshtml file. the web.config , in /views there web.config containing: <add namespace="system.web.optimization" /> , added it's reference. added /scripts folder , added scripts added bundleconfig , routeconfig (just copied them asp.net webapi project generated standard project creation. added bundles bundleconfig added config's in global.asax . problem: when go /scripts/xxx.js return blank. am forgetting config ? or something? there wrong in web.config. updated system.webserver tot following , works now. <system.webserver> <validation validateintegratedmodeconfiguration="false" /> <modules runallmanagedmodulesforallrequests="true"> <remove name="webdavmodule" /> </modu

c++ - Triangulate over a manifold using CGAL -

in problem want triangulate (using cgal dd triangulation package) points on r^3 x s, s mono-dimensional compact manifold. in documentation i've read triangulation cgal performs on n-dimensional euclidean space. at point need help, since i'm not big cgal expert , don't know if thing possible or not (and if it's possible how it). thank in advance! (i cgal developer, not know dd triangulation package.) i think cannot computation on r^3 x s using cgal. if s embedable in r, suggest computation in r^4.

spring - How Authentication manager verifies Credentials? -

i using spring security in web application. here have authentication-manager & authentication-provider providing authenticate user details directly or service. like: <authentication-manager> <authentication-provider user-service-ref="loginservice" /> </authentication-manager> how internally performing verifications. verification logic present ? what going on internally ? can suggest explanation. spring security javadoc friend ! authenticationmanager interface. default implementation providermanager gets list of authenticationprovider . each authenticationprovider tried in sequence until 1 can decide authentication credentials proposed. here, <authentication-provider user-service-ref="loginservice" /> declares daoauthenticationprovider . daoauthenticationprovider loads user information userdetailsservice (here loginservice ) , compares username/password combination values supplied @ login. i

java - JOptionPane window opens in background -

i developing swing application, little query joptionpane.showmessagedialog() bugging me: joptionpane.showmessagedialog(null, "record entered successfully"); if write code message window appears @ of parent frame. joptionpane.showmessagedialog(this, "record entered successfully"); whereas code automatically places window on parent frame. the question is: while implementing null first argument message @ background of current parent frame whereas if write this first argument window comes on parent frame. why happenning? in method showmessagedialog(component parentcomponent, object message) the first argument sets parent of dialog: parentcomponent defines component parent of dialog box. used in 2 ways: frame contains used frame parent dialog box, , screen coordinates used in placement of dialog box. in general, dialog box placed below component. parameter may null , in case default frame used parent, , dialog centered on screen (d

Where can I find the file explorer in Android studio 1.0.1? -

i found lot of similar questions mine , tells me it's under tools > android > android device monitor. did , there have select file explorer tab, problem there no such tab. thing see list devices , logcat. knows can find file explorer in android studio because don't see in ddms. thanks in advance! if searching file explorer device/emulator: tool > android > android device monitor. see list of devices on left. click device want explore, , can select file explorer tab. if can't find it, have closed it. can reopen pressing small android logo on right side of window, or window > reset perspective.

Upload item image using Square Connect API and PHP -

i've reviewed old questions posted here on stackoverflow issue. didn't find example php integration. here sample of code it's failing $url = 'https://connect.squareup.com/v1/me/items/9999999/image'; $auth_bearer = 'authorization: bearer ' . $this->accesstoken; $image_data = base64_encode(file_get_contents('image.jpeg')); $header = array( $auth_bearer, 'accept: application/json', 'content-type: multipart/form-data; boundary=boundary', ); $ch = curl_init($url); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_httpheader, $header); curl_setopt($ch, curlopt_postfields, 'files=' . $image_data); $head = curl_exec($ch); curl_close($ch); $response = json_decode($head); echo "<pre>"; print_r($response); echo "</pre>"; and nothing happens... he

python - Python3 - Iterate over object methods with similar names -

i trying iterate list of object methods similar names. there clever way can this. have objects similar use iterator instead of making list of functions. dog1.feed() dog2.feed() dog3.feed() dog4.feed() dog5.feed() ... all local object names in locals() : for in range(1,6): locals()["dog" + str(i)].feed()

Why can not decode persian character from csv file with c#? -

Image
i'm write code read csv file: var reader = new streamreader(file.openread(@"c:\test.csv")); list<string> lista = new list<string>(); list<string> listb = new list<string>(); while (!reader.endofstream) { var line = reader.readline(); var values = line.split(';'); lista.add(values[0]); listb.add(values[1]); } , sample csv file recode here: استان نمونه عمليات دوره صورت حساب- دوره اول سال 1393 1393,01,01 1393,03,01`enter code here` when debug program,i data sample line: ��� ���� �������,��� ������ happen?why can see data csv file? when open file visual studio see this: if has done once, easiest way open csv file , convert unicode text. open csv file in visual studio , following: choose file -> advanced save options -> choose 'unicode (utf-8 signature) - codepage 65001' -> save file , try again . according msdn, stream reader should able p

python - using a loop, while using a variable to set how many times it loops -

def searchqueryform(alist): noforms = input("how many forms want search for") in range(noforms): searchquery = [ ] nofound = 0 ## no found set @ 0 formname = input("pls enter formname >> ") ## asks user formname formname = formname.lower() ## converts lower case row in alist: if row[1].lower() == formname: ## formname appears in row2 searchquery.append(row) ## appends results nofound = nofound + 1 ## increments variable if nofound == 0: print("there no matches") return searchquery i trying use variable set how many times loop occurs. have tried set entering variable. keep getting error typeerror: 'str' object cannot interpreted integer cast user input. int instead of string : noforms = int(input("how many forms want search for"))

How to submit a spark Job Programatically -

while submitting application spark-submit works. but while trying submit programatically using command below mvn exec:java -dexec.mainclass="org.cybergen.submitjobexample" -dexec.args="/opt/spark/current/readme.md please" am getting following error while trying so application log 15/05/12 17:19:46 info appclient$clientactor: connecting master spark://cyborg:7077... 15/05/12 17:19:46 warn reliabledeliverysupervisor: association remote system [akka.tcp://sparkmaster@cyborg:7077] has failed, address gated [5000] ms. reason is: [disassociated]. 15/05/12 17:20:06 info appclient$clientactor: connecting master spark://cyborg:7077... 15/05/12 17:20:06 warn reliabledeliverysupervisor: association remote system [akka.tcp://sparkmaster@cyborg:7077] has failed, address gated [5000] ms. reason is: [disassociated]. spark master log 15/05/12 17:33:22 error endpointwriter: associationerror [akka.tcp://sparkmaster@cyborg:7077] <- [akka.tcp://sparkdriver@10.18.26

computer architecture - For a Single Cycle CPU How Much Energy Required For Execution Of ADD Command -

the question obvious specified in title. wonder this. expert can help? ok, going long answer, long may write article instead. strangely enough, i've been working on experiments closely related question -- determining performance per watt modern processor. paul , sneftel indicated, it's not possible real architecture today. can compute if looking @ execution of instruction given silicon technology , alu design through calculating gate leakage , switching currents, voltages, etc. isn't useful value because there going on (from hw perspective) in processor newer 8086, , instructions haven't been executed in isolation since pipeline first came being. today, have multi-function alus, out-of-order execution, multiple pipelines, hyperthreading, branch prediction, memory hierarchies, etc. have execution of 1 add command? energy used execute 1 add command different execution of multiple add commands. , if wrap program around it, gets complicated. sort-of-an-answ

model view controller - How to Change link (nameOfController?a=1&b=5&c=20&d=30) in Custom PHP MVC -

i'm trying retrieve data database of values in link uisng method... , working custom php mvc.. since im still beginner, don't know access data send form in page 1 form in page 2.. this regular way. example page1.php <form method="get" action="<?php echo url"./page2.".php ;?> "> <select name="a"> <option value="1">option 1</option> <option value="2">option 2</option> </select> <select name="b"> <option value="1">option 1</option> <option value="2">option 2</option> </select> <select name="c"> <option value="1">option 1</option> <option value="2">option 2</option> </select> <input type="submit" value="continue"> </form> whe

html - Issues with input and Crosswalk -

i have trouble crosswalk input text. when write , delete it, input doesn't clear totally. when write again old text appears in input... for exemple when write "cordova" , delete word, , write "is best", after writing "is the" gives me "is cordovabest". i didn't have issue before installing crosswalk. solution ? i had same issues , used directive (just made now, not tested extensively). on emptying of input creates new input focus on (just blur(ing) didn't much), re-focuses on original input: angular.module('yourmodule') .directive('autocomplete', function($timeout) { return { restrict: 'a', scope: { autocomplete: '=' }, link: function(scope, element, attrs) { function createinputfocus(origfield) { origfield.blur(); var field = document.createelement('input');

html - Footer keeps scrolling with text, no matter what I do -

i've got small problem i'm trying solve since yesterday. couldn't find solutions on google. i have follows: the footer should stay @ bottom no matter how text there in .main class. below you'll find html , css code. the webpage should work chrome. (internal work related project) /* -------------------------- base styles -------------------------- */ body { margin: 0; padding: 0; color: #000; background: #fff; font: 1em/1.2 helvetica, arial, sans-serif; } h1 { margin: 0; font-size: 1.5em; font-weight: 500; } h2,h3 { margin: 0 0 1em; font-size: 1.3em; font-weight: 500; } p { margin: 0 0 1.5em; line-height: 1.5; } /* -------------------------- layout -------------------------- */ .header { background-color: #ccc; padding: 1em; } .nav-bar { color: #fff; background-color: #09f; } .content { padding: 1em; } .main { margin-bottom: 1em; } .aside { margin-bottom: 1em; } .footer {

angularjs - ngChange in custom directive fire twice -

attached custom directive let using ng-change attribute. the problem is, when using twice in same view, notice bar method fire twice, found problem $viewchangelisteners store same method of controller twice. note: notice maybe i've same directive twice 2 different ng-change methods have 1 idea on problem? html: <my-directive ng-model="foo" items="items" ng-change="bar1(foo)"></my-directive> <my-directive ng-model="foo2" items="items" ng-change="bar2(foo2)"></my-directive> directive: template: '<div ng-repeat="item in items" ng-click="updatemodel(item)">{{item}}</div>', require: "ngmodel", scope : { items : "=" }, link: function(scope, element, attrs, ctrl){ scope.updatemodel = function(item) { ctrl.$setviewvalue(item); } ctrl.$viewchangelisteners.push(function() { scope.$eval(attrs.ngchange); }); } pl

java - Architecture of a multiple-windowed JavaFX 8 Application -

i'm building multi-window , multi-module simulation application, , use javafx gui. from understood, make javafx project run, need run application.launch( myapplicationsubclass.class ) , use primary stage given in start(stage primarystage) method started. in start method , beyond happens in javafx thread. my app multi-moduled application. today, main class bootstraps program , launches several modules (which distinct maven modules), including 1 in charge of gui. in beginning (when designed current architecture), planned create 1 window. so, once loaded, gui module make application.launch( myonlymainwindow.class ) call, , work fine. today, i'd add console window, launched before module, , used "live-log" application (by redirecting system.out stream, between other things, textflow). architecture described, it's impossible, because if want ot keep application.launch() call in gui module, can't make in console window, not part of gui module. imposs

Show Data after choose option php -

how can show detail after choose 1 of option here's code: <td><p>id vendor :</p></td> <td> <select> <?php $host = "localhost"; $username = "root"; $password = ""; $database = "dbpo"; $conn=mysql_connect($host,$username, $password); $pilihdatabase= mysql_select_db($database, $conn) or die ("connect failed !! : ".mysql_error()); $query = mysql_query("select idvendor tblvendor"); while ($row = mysql_fetch_array($query)) { $idvendor = $row['idvendor']; $namavendor = $row['namavendor']; echo "<option>". $idvendor ."</option>"; } ?> </select> </td> <td><input type="text" name="namavendor" size="50"/></td> please help

ios - Unable to show .xlsx formate in UIDocumentInteractionController / UIWebView -

i have been trying download different documents server swift app , show in uidocumentinteractioncontroller . csv formats downloaded , shown in uidocumentinteractioncontroller . .xlsx formats downloaded not recognised uidocumentinteractioncontroller / uivewbview . how can show .xlsx file in uidocumentinteractioncontroller in swift

c++ - g++ static string member causes segmentation fault -

i own static library "my.a", static library pure c library. static library internally links c++ static library "yours.a" , whoever consumes library has link against libstdc++ since library has dependency on libstdc++. there program "final_exec" linking dynamically against libstdc++, , linking statically library. when launching executable, , while executable finished executing , calles exit, segmentation fault , following stack trace *** glibc detected *** ./stage-o/bin/amd64/cats: double free or corruption (!prev): 0x0000000016846b80 *** ======= backtrace: ========= /lib64/libc.so.6[0x2ac1f98e54af] /lib64/libc.so.6(cfree+0x4b)[0x2ac1f98e97ab] /slowfs/swe82/abhish_temp/clientstore/v35/stage- o/lib/amd64/libstdc++.so.6(_znssd1ev+0x1f)[0x2ac1f91820af] /lib64/libc.so.6(exit+0xe5)[0x2ac1f98a7255] ~basic_string destructor throwing exception while freeing global string. just troubleshoot if remove dependency on library "yours.a" lib

Aggregation Support for Spring Data Elastic Search -

elastic search has deprecated facets , recommend use aggregations ( http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-aggregations.html ) . is spring data elastic search supports ? if yes, there samples available ? yes aggregation supported. example : @test public void shouldreturnaggregatedresponseforgivensearchquery() { // given indexquery article1 = new articleentitybuilder("1").title("article four").subject("computing").addauthor(rizwan_idrees).addauthor(artur_konczak).addauthor(mohsin_husen).addauthor(jonathan_yan).score(10).buildindex(); indexquery article2 = new articleentitybuilder("2").title("article three").subject("computing").addauthor(rizwan_idrees).addauthor(artur_konczak).addauthor(mohsin_husen).addpublishedyear(year_2000).score(20).buildindex(); indexquery article3 = new articleentitybuilder("3").title("article two").subject("

c++ - undefined-reference Error when defining a function in the *.cpp instead of in the *.h -

this question has answer here: what undefined reference/unresolved external symbol error , how fix it? 27 answers i have got problem: have 2 classes: mainwindow , ergebnisausfortran this: mainwindow.h: #ifndef mainwindow_h #define mainwindow_h #include <qmainwindow> #include <qdebug> #include <qstring> #include "ergbnisausfortran.h" namespace ui { class mainwindow; } class mainwindow : public qmainwindow { q_object public: explicit mainwindow(qwidget *parent = 0); ~mainwindow(); public: ergbnisausfortran berechnung(); ergbnisausfortran berechnung_1() { ergbnisausfortran ret; qdebug() << " ich berechne berechnung_1..." ; return ret; }

html - How do I add a vertical scrollbar to a centred, expanding table? -

i have rather long table, , wish add vertical scrollbar it. this, i've wrapped table inside 2 divs. inner div has display: inline-block shrink wrap around table, , outer div has text-align: center . here's problem: i've added overflow-y: auto inner div, , apparently adds scrollbar inside of inner div, makes content wider equal width of vertical scrollbar, spawns horizontal scrollbar. i can't find solution this. ideally, width of inner wrapper div should expand accomodate vertical scrollbar, rather spawning horizontal scroll bar. any ideas? i'm using chrome 42 , firefox 39 in case. example demonstrating issue: body { font: 14px "verdana", "arial", "sans serif"; } #wrapper1 { text-align: center; } #wrapper2 { display: inline-block; overflow-y: auto; max-width: 100%; max-height: 150px; text-align: initial; } table { min-width: 512px; background-color: rgba(0, 0, 0, 0.05); }