Posts

Showing posts from August, 2013

java - How to profile Native JNI library -

java - How to profile Native JNI library - how can profile java native interface library written in c? i know usual c profilers, question how can profile whole set including calls jvm methods might slowing downwards program. after research , testing of methods proposed here ended using sprof . basically followed instructions available in answer. comments: i had leave ld_profile_output empty in order result in /var/tmp/ , otherwise output file not generated. i assigned ld_profile=libxxxx.so to profile ran java code loads , uses native jni library , got file profiling results in: /var/tmp/libxxxx.so.profile once have file can read using command: sprof /path/to/libxxxx.so /var/tmp/libxxxx.so.profile the results of profiling follow same template gprof . here can find description of contents , meaning. java c jvm jni profiling

php - Two different Paypal Forms based on User's Status -

php - Two different Paypal Forms based on User's Status - i created website has registration form fundraiser event. has simple fields such "first name, lastly name, email, etc" after click on "submit" on first page, taken page can pay via paypal. i know how insert paypal feature says "buy now". however, case, want have 2 different paypal forms: if user has registered particular conference, pay $10 (i have list of registered attendees in database table via phpmyadmin) if user has not registered general conference, pay $15 how code can validate if user in database table of registered attendees , gets $10 rate? (perhaps can validate email address used on form) this have right php file (it's defaulted on $15 regular rate non-attendees) <html> <div class="container"> <head><title>payment page</title></head> <body> <h1>step 2: payment</h1> <p class=...

PHP forking and processing MySQL database without conflict -

PHP forking and processing MySQL database without conflict - i have mysql database table need process. takes 1 sec process 3 rows (due curl connections need create each row). so, need fork php script in order have reasonable time (since process 10,000 rows 1 batch). i'm going run 10-30 processes @ once, , need way create sure processes not overlapping (in terms of rows retrieving , modifying). from i've read, there 3 ways accomplish this. i'm trying decide method best situation. option 1: begin transaction , utilize select ... update , limit # of rows each process. save info array. update selected rows status flag of "processing". commit transaction , update selected rows status of "finished". option 2: update number of rows status flag of "processing" , process id. select rows process id , flag. work info normal. update rows , set flag "finished". option 3: set limit ... offset ... clause each process's s...

php - Get content of specific page in WordPress -

php - Get content of specific page in WordPress - at moment querying out pages have in wordpress , displaying them on page. this: <?php query_posts(array('post_type' => 'page')); while(have_posts()) { $this_page = the_post(); echo the_content(); } ?> the question is, how can same thing 1 specific post? side note, if need utilize id's of pages can find them, @ moment don't see id page has in wordpress. something this? query_posts( array ( 'category_name' => 'my-category-slug', 'posts_per_page' => -1 ) );//al items my-category-slug while(have_posts()) { $this_page = the_post(); echo the_content(); } php wordpress loops

node.js - Express: accessing app.set() settings in routes -

node.js - Express: accessing app.set() settings in routes - in express, i'm led believe global app settings can created doing similar next in main app.js file: var express = require('express'), ... login = require('./routes/login'); var app = express(); app.configure(function(){ ... app.set('ssohostname', 'login.hostname.com'); ... }); ... app.get('/login', login.login); ... now in ./routes/login.js , i'd access app.settings.ssohostname , if effort run similar (as per: how access variables set using app.set() in express js): ... exports.login = function(req, res) { var currenturl = 'http://' + req.header('host') + req.url; if (!req.cookies.authcookie || !user.isvalidkey(req.cookies.authcookie)) { res.redirect(app.settings.ssohostname + '/login?returnurl=' + encodeuricomponent(currenturl)); } }; ... it not recognize app : referenceerror: app not defined my question...

mysql - Grouping the date columns in week range -

mysql - Grouping the date columns in week range - i have table , columns like start_date timestamp, end_date timestamp, id number, cost number(10,2). and info inserted table 'll this 1,'2013-02-03 00:00:00','2013-02-03 00:00:00',75*0.06 1,'2013-02-04 00:00:00','2013-02-04 00:00:00',75*0.06 1,'2013-02-05 00:00:00','2013-02-05 00:00:00',75*0.06 1,'2013-02-06 00:00:00','2013-02-06 00:00:00',75*0.06 1,'2013-02-07 00:00:00','2013-02-07 00:00:00',75*0.06 1,'2013-02-08 00:00:00','2013-02-08 00:00:00',75*0.06 1,'2013-02-09 00:00:00','2013-02-09 00:00:00',75*0.06 and want grouping columns start_date , end_date sunday saturday. can please help me on this. thanks in advance. this best can offer question impossible understand sample provided. iso week table 2013: select start_date -- 1/1/2013 -- , trunc(start_date, 'iw') ...

asp.net - How do I get the NT logged in user using JavaScript? -

asp.net - How do I get the NT logged in user using JavaScript? - how nt login name using javascript? this how can in webforms: session("ntlogin") = page.user.identity.name but want run javascript on client side , servicestack connect. javascript asp.net servicestack

javascript - How to Override/Undo CSS Class Attributes for Twitter Bootstrap -

javascript - How to Override/Undo CSS Class Attributes for Twitter Bootstrap - about year ago, @andres ilich provided beautifully elegant reply centering navigation bar in bootstrap. an excerpt posted reply below: <div class="navbar navbar-fixed-top center"> <div class="navbar-inner"> .... </div> </div> and can target .center class so: .center.navbar .nav, .center.navbar .nav > li { float:none; display:inline-block; *display:inline; /* ie7 prepare */ *zoom:1; /* haslayout ie7 trigger */ vertical-align: top; } .center .navbar-inner { text-align:center; } since affected drop downwards menu well, added this: .center .dropdown-menu { text-align: left; } so drop downwards menus behave normally. now facing similar issue. navigation bar beautifully centered. dropdowns work great. but, when tablet , mobile viewports, mobile menu gets centered. aligning text left not s...

drop down menu - jQuery Odd Even is Adding Even to an Odd Element -

drop down menu - jQuery Odd Even is Adding Even to an Odd Element - jquery('li.has-sub ul li:even').addclass('even'); jquery('li.has-sub ul li:odd').addclass('odd'); the classes beingness added drop downwards menu. in 1 drop downwards menu classes added correctly dropdown adding class even odd elements. think jquery might counting of list items together, still doesnt explain why counting 1 even. can see problem on url: the menu yellowish background starting rafting trips. http://bit.ly/xaemh7 i have tried adding this in effort create jquery count ul in question no luck. jquery behaving correctly given code: jquery('li.has-sub ul li:even').addclass('even'); jquery('li.has-sub ul li:odd').addclass('odd'); if alter to: jquery('li.has-sub').each(function(){ jquery('ul li:even',this).addclass('even'); jquery('ul li:odd',this).addclass('odd');...

python - In Fabric, how can I check if a Debian or Ubuntu package exists and install it if it does not? -

python - In Fabric, how can I check if a Debian or Ubuntu package exists and install it if it does not? - i required install memcached part of fabric script setting test servers. figured i'd record here future reference. pieced superuser comment , stackoverflow answer. (note: i'm running root rather using sudo ): def package_installed(pkg_name): """ref: http:superuser.com/questions/427318/#comment490784_427339""" cmd_f = 'dpkg-query -l "%s" | grep -q ^.i' cmd = cmd_f % (pkg_name) settings(warn_only=true): result = run(cmd) homecoming result.succeeded def yes_install(pkg_name): """ref: http://stackoverflow.com/a/10439058/1093087""" run('apt-get --force-yes --yes install %s' % (pkg_name)) def make_sure_memcached_is_installed_and_running(): if not package_installed('memcached'): yes_install('memcached') setting...

iOS Facebook switches back to app between login & permissions -

iOS Facebook switches back to app between login & permissions - i'm trying setup app publish simple post user's facebook feed (image url, link, description). don't need utilize facebook else first time click "share" needs authorize app, , publish permissions. if have credentials stored in device of ios 6 2 alert boxes , it's done with. if don't, or have older version, switches out safari login. problem is switching user app, 1 time again safari take publish permission. it's jarring , unprofessional. what page in safari alter after login permissions page can take it, , switch app. know can done because popular mixology app behavior. unfortunately facebook keeps changing sdk , info find online outdated. i wrote solution here: facebooksdk presents login ui twice avoid double switch. basically, can utilize openactivesessionwithpublishpermissions: want. however, have handle special case user has signed in facebook device...

entity framework - EF 4.4 Preventing AutoGen Navigation Properties and/or Relationships -

entity framework - EF 4.4 Preventing AutoGen Navigation Properties and/or Relationships - i started db schema using ef , ran multiple issues when tring mannually modify clr's and/or db tables. first "employee_id" column ef placed in table. deleted it, dbo.edmmetadata , dbo.__migrationhistory tables , fumbled through run-time errors insued. now, i'm grapling next error: a dependent property in referentialconstraint mapped store-generated column. column: 'employeeid'. my implementation uses timecardentity clr has 3 computed columns. these columns happens map table's primary key. other table employeerecord. goal) don't want ef auto map thse 3 columns. intend fill them myself due complications ef offers, can't tell ef stop creating navigation relationships and/or referential constraints. point #1) have employeerecord table has guid id primary key, maps clr class employeerecord point #2) have timecardentity table has has 3 comp...

mysql - Prevent database table row from delete and update -

mysql - Prevent database table row from delete and update - this question has reply here: protect row deletion in mysql 2 answers i have database table want protect rows deleting , updating. using mysql database. how can prepare in phpmyadmin or sql syntax? ex: prevent row id:18 delete , update: you have various options. session wise: if using innodb set autocommit=0; update table set mainpage =1 id = 18; -- not commit until want release lock. -- if under myisam, -- think going lock whole table (to verified) structural protection create trigger before update/delete on table , raise error when :new.id = 18 mysql phpmyadmin

How do you make every other integer in an array equal to 0 in matlab? -

How do you make every other integer in an array equal to 0 in matlab? - lets have array y = [1, 2, 3, 4, 5, 6] i want create new array replaces every other number 0, creates y = [1, 0, 3, 0, 5, 0] how go approaching , writing code in efficient way? this should that: y(2:2:end) = 0; with line each element starting seconds last, in steps of two, should zero. can done larger steps too:, y(n:n:end) = 0 makes every n th element equal 0. arrays matlab

rails code works in console not in controller -

rails code works in console not in controller - i've been looking few days not can't find what's going on. i've got code when tested in rails console works well, in controller refuses create database entries. the models utilize are: class project < activerecord::base attr_accessible :name, :user_id belongs_to :user has_many :active_data_sets has_many :data_sets, :through => :active_data_sets end class dataset < activerecord::base attr_accessible :name, :project_id, :filename, :tempfilename has_many :active_data_sets has_many :projects, :through => :active_data_sets end class activedataset < activerecord::base attr_accessible :active, :data_set_id, :project_id belongs_to :project belongs_to :dataset end i'm using form_tag in view because @ later stage want upload file, not part of model. found out form_tag won't work @ point. calling url form is: http://localhost:3000/data_sets/new?project_id=1 and v...

xaml - Remove space between GridView Groups -

xaml - Remove space between GridView Groups - i have list of people grouped first letter of name. the result follow : the problem space between groups d , g, how can remove it? the groupstyle declare : <gridview.itemtemplate> <datatemplate> <border width="150" height="150" background="#fff14b01"> <grid> <grid.rowdefinitions> <rowdefinition height="30" /> <rowdefinition height="30" /> </grid.rowdefinitions> <textblock text="{binding name}" verticalalignment="center" foreground="white" /> </grid> </border> </datatemplat...

C pointer to two dimensional array -

C pointer to two dimensional array - i know there several questions gives (and working) solutions, none imho says best way accomplish this. so, suppose have 2d array : int tab1[100][280]; we want create pointer points 2d array. accomplish this, can : int (*pointer)[280]; // pointer creation pointer = tab1; //assignation pointer[5][12] = 517; // utilize int myint = pointer[5][12]; // utilize or, alternatively : int (*pointer)[100][280]; // pointer creation pointer = &tab1; //assignation (*pointer)[5][12] = 517; // utilize int myint = (*pointer)[5][12]; // utilize ok, both seems work well. know : what best way, 1st or 2nd ? are both equals compiler ? (speed, perf...) is 1 of these solutions eating more memory other ? what more used developers ? //defines array of 280 pointers (1120 or 2240 bytes) int *pointer1 [280]; //defines pointer (4 or 8 bytes depending on 32/64 bits platform) int (*pointer2)[280]; //pointer array of 280 integers...

symfony 2.1 - Symfony2 GenemuFormBundle collection with Select2 -

symfony 2.1 - Symfony2 GenemuFormBundle collection with Select2 - i'm trying create bundle collection (many-to-many relationship). i've set collection of info in way: ->add('subcategory', 'genemu_jqueryselect2_entity', array( 'class' => 'coffee\businessbundle\entity\subcategories', 'property' => 'subcategory', 'label' => 'sotto categorie', 'multiple' => true, 'configs' => array( 'placeholder' => 'seleziona almeno una sotto categoria', ) )) **** in anagrafictype: ->add('subcategories', 'collection', array('type' => new subcategoriestype(), 'allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'prototype_name' => '__categ__', ...

angularjs - Moved data from controller to factory, and can't get it from there -

angularjs - Moved data from controller to factory, and can't get it from there - this shortened version of js file var linksmanager = angular.module('linksmanager', ['ui']); angular.bootstrap(document, ['linksmanager']); linksmanager.factory('linksdata', function () { var linksdata = [ { text: 'menu item 1', url: '#' }, { text: 'menu item 2', url: '#', submenu: [ // more info ... }); function linksrarrange($scope, linksdata) { $scope.links = linksdata; } before linksdata straight within linksrearrange controller $scope.links = [ { text: 'menu item 1', url: '#' }, { text: 'menu item 2', url: '#', submenu: [ // more info ... and worked fine, why sharing doesn't work now? this html, doesn't dis...

c# - Can I use a Label as a barcode representation? -

c# - Can I use a Label as a barcode representation? - i parse string contains in innards barcode value (such 02410103775). i create label dynamically so: private void printbarcodegettingintouchwithitsinnerzebra(string linetoparse) { string barcodetext = getbarcodeval(linetoparse); int barcodeheight = convert.toint32(getbarcodeheight(linetoparse)); int barcodevertstartpos = getbarcodenextverticalstartingpoint(linetoparse); label lblbarcode = new label(); lblbarcode.text = barcodetext; lblbarcode.font = new font(lblbarcode.font.name, barcodeheight, lblbarcode.font.style); lblbarcode.top = barcodevertstartpos; lblbarcode.left = getbarcodenexthorizontalstartingpoint(linetoparse); //lblbarcode.parent = panel2by1labelproxy; // <-- preferred, or line below? panel2by1labelproxy.controls.add(lblbarcode); } right shows barcode value "raw" (as "02410103775" or so); there way morph lable text barcode representation? i...

java - Activity is not starting -

java - Activity is not starting - please have @ next code form.java my main activity form.java. within that, have alertdialog . when user clicks on "yes" button, next class called private class positivedialogbtnaction implements dialoginterface.onclicklistener { public positivedialogbtnaction() { } @override public void onclick(dialoginterface arg0, int arg1) { // todo auto-generated method stub //toast.maketext(getapplicationcontext(), databaseconnector.getstreetaddress(selectedbranch), toast.length_long).show(); dialog dialog = new dialog(context); dialog.setcontentview(r.layout.activity_call_dialog); dialog.settitle("select phone number"); dialog.show(); } } following xml file , java class, beingness set dialog within positivedialogbtnaction class mentioned above. activity_call_dialog <textview a...

javascript - Strange behaviour of Parsley.js in Safari -

javascript - Strange behaviour of Parsley.js in Safari - so working parsley.js. problem is, think is, it's not working cross browser safari. first bug: have input can type numbers. looks this: input#mtlbeitrag.pull-right(data-type="number", name="vb", value="#{calc.vb}", required="required", min="0") when type "1000", parsley create number "1.000". problem because parsing number integer. algorithm parses "1.000", supposed "1000" "1.0". second bug: parsley ignoring require tag. not popup-messages not working , displayed list-element. no, lets user submit form wrong inputs. my question is: these known bugs or did implement wrong way? can confirm bugs safari? on google chrome, non of these errors occure. also, there better, cross-browser library same? ps: when test on safari, nil happens. is possible using html5 form validation , forgot add together n...

Google maps Initial marker won''t show up -

Google maps Initial marker won''t show up - the code found google map seems work fine but, initial marker isn't showing when load map. map centered on initial location no marker. i'm using php populate initial lat , lon. there way remove old marker 1 time dragged new location? // global "map" variable var map = null; var marker = null; // popup window pin, if in utilize var infowindow = new google.maps.infowindow({ size: new google.maps.size(150,50) }); // function create marker , set event window function function createmarker(latlng, name, html) { var contentstring = html; var marker = new google.maps.marker({ position: latlng, map: map, zindex: math.round(latlng.lat()*-100000)<<5 }); google.maps.event.addlistener(marker, 'click', function() { infowindow.setcontent(content...

ruby on rails - How to redirect based on the type of model in devise? -

ruby on rails - How to redirect based on the type of model in devise? - i working on new rails 3 application. in application have 2 different types of resources(admin , garage) both different views , 2 different login screens using devise. admin can create garage , can generate password garage using garage manager can login application. till able implement this. one problem facing in above implementation garage manager, 1 time logged in, able view admin section changing url in browser , can create changes admin user. now trying implement have single log in/sign in form both models , when logs in, depending on model type should redirected respective views. also, restrict users admin using admin section. what should approach implement this. using devise authentication. resource instance of 1 of models here: def after_sign_in_path_for(resource) homecoming admin_route_path if resource.is_a?(admin) homecoming garage_route_path if resource.is_a?(garage) end ...

Sentiment analysis -

Sentiment analysis - while performing sentiment analysis, how can create machine understand i'm referring apple (the iphone), instead of apple (the fruit)? thanks advise ! well, there several methods, i start checking capital letter, usually, when referring name, first letter capitalized. before doing sentiment analysis, utilize part-of-speech , named entity recognition tag relevant words. stanford corenlp text analysis project start with, teach basic concepts. example corenlp: you can see how tags can help you. and check out more info sentiment-analysis

c++ - cascades and signals / slots -

c++ - cascades and signals / slots - i'm running around in circles this. can't wrap head around signals , slots. just looking mechanism can automatically update ui when signal in c++ occurs. example: i have 2 labels in qml have text: _app.method returns value. i have button onclicked runs q_invokable method. method emits signal when it's done, eg, fetches geocordinates , updates values above text: assignments rely on. what want update text: assignments 1 time values change. i need these signals / slots explained plainly. examples in documentation seem assume qml or c++ not mix of both. sample code have examples, not explained in documentation. if had plain description, im sure adapt it. eg, 1: define in qml, 2: define in hpp file, 3: define these in cpp file. i've tried using qobject's setpropery("text","value") app crashes when attempting this. tell me if i'm wrong... 1) in qml: button { id: abutton tex...

vb.net - Best way to store Configuration Data? -

vb.net - Best way to store Configuration Data? - i have developed rather big application in lastly year. since not programmer trade, asked fellow programmer how store huge amount of application settings - reply "use configuration class". ended "constants.vb" file contains literally thousands of configuration details. lot of them unlikely change, few dozen of them alter , should changeable customer. not satisfied mess, since becomes harder maintain min - have seen my.settings / my.resources classes , utilize them settings - since there no obvious way organize data, not keen drop ton of config variables my.settings... have ideas me? vb.net configuration

language lawyer - What's the utility of an empty C++ file? -

language lawyer - What's the utility of an empty C++ file? - the sec part of translation phase 2 (section 2.2.2 in n3485) says if source file not end in newline character, compiler should treat if did. however, if i'm reading correctly makes explicit exception empty source files, remain empty. the exact text (with added emphasis) is: each instance of backslash character ( \ ) followed new-line character deleted, splicing physical source lines form logical source lines. lastly backslash on physical source line shall eligible beingness part of such splice. if, result, character sequence matches syntax of universal-character-name produced, behavior undefined. a source file not empty , not end in new-line character, or ends in new-line character preceded backslash character before such splicing takes place, shall processed if additional new-line character appended file. i haven't been able figure out situations in create difference whether source file empty...

java - hazelcast entry listener on a multinode cluster -

java - hazelcast entry listener on a multinode cluster - i have multi-node hazelcast cluster. need ensure when new value inserted map, 1 entrylistener/map store gets invoked. unless having brain freeze, hazelcast not default (it great if wrong this). besides using distributed locks (i not wish avoid using listeners/map stores on other nodes), there other suggestions ensure 1 listener/map store ends executing code. thanks after set node owns key executes map store operation. after set ones have added listener map receive event. java hazelcast

PHP fread limited to 8192 bytes -

PHP fread limited to 8192 bytes - cordial greetings, i want know, why need specify reading file max allowed 8192 bytes? $bytesfile .= fread($fis, 8192); or $enunciado->send_long_data(3, fread($fifoto, 8192)); is possible utilize greater value changing config file php.ini? how? php byte max fread

django - I want to include haystack search in all pages -

django - I want to include haystack search in all pages - i have configured haystack search index page. have configuration below urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^$',searchview( template='index.html', form_class=searchform),name="haystack_search") but when include index.html in other pages, dont see search bar because configured index page. ideas, if there way include haystack search context personally wouldn't give search results root url, rather utilize line haystack documentation suggests. (r'^search/', include('haystack.urls')), then, place search form in base of operations template point url in form action. template inheriting base of operations include form. again, haystack documentation gives directions how might organise template code. django django-templ...

How to deep clone an object list that contains several objects in java? -

How to deep clone an object list that contains several objects in java? - say there employeelist contains 5 employee object. i want perform clone of employeelist create new employeelist, , wondering how should that? so next class employee: public class employee { private string name; private string ssn; private double salary; private string name() { homecoming name; } private void name(string name) { this.name = name; } private string ssn() { homecoming ssn; } private void ssn(string ssn) { this.ssn = ssn; } private double salary() { homecoming salary; } private void salary(double salary) { this.salary = salary; } void initialize(string initname, string initssn, double initsalary) { this.name(initname); this.ssn(initssn); this.salary(initsalary); } public employee(string name, string ssn, double salary) { this.initialize(name, ssn, salary); } public employee clone() { homecoming new employee(this.name, this.ssn, thi...

Pushing pointers into c++ vectors, and cleanup -

Pushing pointers into c++ vectors, and cleanup - i converting code between different systems, , have question regarding c++ vectors. if this: in header file: struct vertex { float x; float y; float z; } struct submesh { vertex *meshdata; } std::vector<submesh> meshes; in routine in c++ file: { vertex *data = new vertex[1024]; submesh g; g.meshdata = data; meshes.push_back(g); delete [] data; } will in trouble? assumption vector hold pointer info no longer valid 1 time called delete on it. need write re-create constructor vertex info copied first? additional: the question more how set pointer allocated memory std::vector<> , still cleanup locally allocated data. essentially, how re-create info vector can still clean copy. the original code in directx. porting iphone. original code allocated submesh locally in routine using: { id3dxmesh* submesh = 0; d3dxcreatemesh(subgrid::num_tris, subgr...

php - Accessing certain properties of a SimpleXMLElement Object -

php - Accessing certain properties of a SimpleXMLElement Object - when print_r() simplexmlelement object referenced variable $xmlobject , see next structure: simplexmlelement object ( [@attributes] => array ( [uri] => /example ) [result] => simplexmlelement object ( [message] => record(s) added [recorddetail] => array ( [0] => simplexmlelement object ... ) ) ) notice how $xmlobject->result->message property looks string. however, if print_r($xmlobject->result->message) , following: simplexmlelement object ( [0] => record(s) added ) so @ point i'm confused. why $xmlobject->result->message beingness identified instance of simplexmlelement object in case, when result of printing total $xmlobject doesn't suggest this? and how access value? i've tried $xmlobject-...

while else statement? PHP -

while else statement? PHP - so have validation in null values using while statement code is while (!$rs->eof){ echo "<tr><td>".$rs->fields("branch")."</td>"; $rs->movenext(); } $rs->close(); ?> what wanted accomplish have "else" statement though know not possible using statement. 1 equivalent of in statement? while (!$rs->eof){ echo "<tr><td>".$rs->fields("branch")."</td>"; $rs->movenext(); } if(!$rs->eof) { echo "<tr><td> branch missing</td>"; } $rs->close(); ?> i tried using "if" didn't errors though didn't print wanted print while-else not exists in php. you use: if ($rs->eof) { echo "<tr><td> branch missing</td>"; } else { while (!$rs->eof){ echo "<tr><td>".$rs->fiel...

mysql - play framework 2.1 with tomcat 7 -

mysql - play framework 2.1 with tomcat 7 - i have used play framework war plugin maven plugin , create war file , got next exception while deploying tomcat: java.lang.illegalstateexception @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1597) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1556) @ com.mysql.jdbc.databasemetadata.gettables(databasemetadata.java:4997) @ com.jolbox.bonecp.bonecp.isconnectionhandlealive(bonecp.java:677) @ com.jolbox.bonecp.connectiontesterthread.run(connectiontesterthread.java:103) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334) @ java.util.concurrent.futuretask.run(futuretask.java:166) @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$101(scheduledthreadpoolexecutor.java:165) @ java.u...

bash - return only paragraph by filtering command ouput -

bash - return only paragraph by filtering command ouput - is there way homecoming sec or third, 4th paragraph using grep , awk ...? how can lo paragraph, know that's possible using command ifconfig lo how if utilize other commands. output ifconfig is: eth0 link encap:ethernet hwaddr 00:25:22:b2:8b:0d inet addr:192.168.1.22 bcast:192.168.1.255 mask:255.255.255.0 inet6 addr: fe80::225:22ff:feb2:8b0d/64 scope:link broadcast running multicast mtu:1500 metric:1 rx packets:100979 errors:0 dropped:0 overruns:0 frame:0 tx packets:70753 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 rx bytes:129240044 (129.2 mb) tx bytes:7355272 (7.3 mb) interrupt:29 lo link encap:local loopback inet addr:127.0.0.1 mask:255.0.0.0 inet6 addr: ::1/128 scope:host loopback running mtu:16436 metric:1 rx packets:0 errors:0 droppe...

swing - Java how to add application from the other class into gui class -

swing - Java how to add application from the other class into gui class - i've got keypad class separate , want run other class (gui), can have whatever want in gui class (some btn etc.) , in bottom keypad. when seek keypad kp = new keypad(); want they're displayed in separate windows want them in same window. that's keypad class: import java.awt.gridlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton; import javax.swing.jframe; public class keypadwork extends jframe implements actionlistener { private jbutton buttonr = new jbutton("reset"); private jbutton button0 = new jbutton("0"); private jbutton buttone = new jbutton("enter"); public keypadwork() { settitle("keypad"); setlayout(new gridlayout(4, 3, 2, 2)); (int = 1; < 10; i++) { addbutton(new jbutton(string.valueof(i))); } addbutton(buttonr); addbutton(button0); ad...