Posts

Showing posts from July, 2011

c++ - Multiple definiton of function when including library -

i try include headers library in different files of project , multiple definition errors on functions of library. after reading answer this question think problem functions implemented directly in header files of library. in particular want include files codecfactory.h , deltautil.h fastpfor . don't know if relevant problem include cmake project code in cmakelists.txt: include_directories(../../fastpfor/headers) add_library(fastpfor static ../../fastpfor/src/bitpacking.cpp ../../fastpfor/src/bitpacking.cpp ../../fastpfor/src/bitpackingaligned.cpp ../../fastpfor/src/bitpackingunaligned.cpp ../../fastpfor/src/horizontalbitpacking.cpp ../../fastpfor/src/simdunalignedbitpacking.cpp ../../fastpfor/src/simdbitpacking.cpp ${headers} ) everything works fin

machine learning - Why does Neural Network give same accuracies for permuted labels? -

i have datset of 37 data points , around 1300 features. there 4 different classes , each class has around same number of data points. have trained neural network , got accuracy of 60% 2 hidden layers not bad (chance level 25%). the problem p-value. i'm calculating p-value permutation test. i'm permuting labels 1000 times , each permutation i'm calculating accuracy. p-value calculate percentage of permutation accuracies aver on original accuracy. for permutations of labels i'm getting same accuracy original labels, i.e. neural network not seem include labels in learning. if svm i'm getting permutations different accuracies (in end gaussian distribution). why case? by way, i'm using deeplearntoolbox matlab. is 60% success rate on training data or validation dataset set aside? if you're computing success rate on training data expect high accuracy after permuting labels. because classifier overfit data (1300 features 37 data points) , ac

objective c - How to setup Facebook iOS SDK properly with Parse in AppDelegate? -

i'm trying integrate facebook parse project, have problems new sdk version. with older versions i've imported related header files appdelegate, pasted 2 methods , worked well. this how i've done it: // appdelegate.m #import <parse/parse.h> #import <parsefacebookutils/pffacebookutils.h> #import <facebooksdk/facebooksdk.h> - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [parse setapplicationid:@"xy" clientkey:@"xy"]; [pffacebookutils initializefacebook]; [pfanalytics trackappopenedwithlaunchoptions:launchoptions]; return yes; } - (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { return [fbappcall handleopenurl:url sourceapplication:sourceapplication withsession:[pffa

ssas - Process Data cube from job on SQL server -

i have sql server agent job on server(x) has step supposed process data cube on remote server(y). whenever run job fails , says server(x) not have permission process cube or not exist. believe have job set correctly how give access on server(y) server(x) process cube?? below script using. "sql server analysis services command" <batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"> <process xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/eng

javascript - checking that an event fired with mocha -

how can test element fired event mocha? i've got ugly solution working, it's not readable, takes long time time out when fails, , doesn't give failure messaging. describe('test-element', function() { var el; beforeeach(function() { el = document.createelement('test-element'); }); it('fires save event', function(done) { el.addeventlistener('save', function() { done(); }); el.save(); }); in perfect world, think cooler. it('fires save event', function() { el.save(); expect(el).to.have.firedevent('save'); }); }); am going right way? there better approach or custom matcher library should using? how spying on fire function...? not sure stubbing/spying library you're using lets sinon.js . like... var spy = sinon.spy(el, 'fire'); el.save(); expect(spy.calledwith('save')).to.be.true;

eclipse - Java: reading configuration: Unable to create lock manager -

i getting following error. have eclipse mars , jre v 1.7 (i had installed v1.8 not compatible uninstalled , installed version.) i facing issue when invoking eclipse itself. eclipse.buildid=4.5.0.i20150603-2000 java.version=1.7.0_80 java.vendor=oracle corporation bootloader constants: os=win32, arch=x86_64, ws=win32, nl=en_us !entry org.eclipse.osgi 4 0 2015-07-14 11:20:39.006 !message error reading configuration: unable create lock manager. !stack 0 java.io.ioexception: unable create lock manager. @ org.eclipse.osgi.storagemanager.storagemanager.open(storagemanager.java:698) @ org.eclipse.osgi.storage.storage.getchildstoragemanager(storage.java:1750) @ org.eclipse.osgi.storage.storage.getinfoinputstream(storage.java:1767) @ org.eclipse.osgi.storage.storage.<init>(storage.java:127) @ org.eclipse.osgi.storage.storage.createstorage(storage.java:86) @ org.eclipse.osgi.internal.framework.equinoxcontainer.<init>(equinoxcontainer.java:75) @ org

Matlab - how to analyse sequences of binary behavioural responses? -

i interested in effect of previous responses on current response in behavioural test. example if on 3 previous trials in test participant answers 'no', 'yes', 'yes' likelihood of 'yes' response on current trial different if had answered 'yes', 'yes', 'no' , , on. to analyse need find instances of particular sequences of responses in dataset. e.g. every time yes yes yes occurs, every time yes yes no occurs..., , forth possible permutations of yes/no sequences. to can hard code long chain of if/else statements in matlab (to work on fixed number of previous trials), or can write each possible sequence out , search both methods slow write. rather code hand fixed number of previous trials, i.e. previous 3 responses, there sensible solution use instead previous n trials? i.e. want analyse, say, previous 5 trials, rather previous 3, chain of if/else statements required becomes unbearable! nb. response data binary (i.e.

c# - Implementing a pool with a time limit -

continuing question: correct way implement resource pool i'm thinking implementing maximum amount of time user of pool allowed continue hold on object pool, i'm not sure of right way implement such thing. so, have this: ifoo getfoofrompool() { if (_sem.wait(waittimeout)) { return pop(); } throw new waittimeoutexception("timed out waiting foo instance"); } so _sem semaphore , pop pop off instance stack (initializing if needed), far good. when caller done ifoo , return stack so: void releasefoo(ifoo p) { if (p == null) { throw new argumentnullexception("foo parameter null"); } push(p); _sem.release(); } and wrap wrapper class using idisposable ensure foo gets returned pool. client side, looks this: using (var f = mypool.getdisposablefoo()) { // stuff... } what i'd have such if // stuff takes long (or hangs), ifoo recycled , calling code throw exception. so thought of doin

php - Magento system log 2015-07-14T14:48:34+00:00 ERR (3): Warning: Mage_Core_Model_App::dispatchEvent(): Node no longer exists -

we receiving following error on , on , filling system.log file: 2015-07-14t14:48:34+00:00 err (3): warning: mage_core_model_app::dispatchevent(): node no longer exists in /chroot/home/website/html/app/code/core/mage/core/model/app.php on line 1281 this line 1281 1287. how fix this? i'm sure means. foreach ($eventconfig->observers->children() $obsname=>$obsconfig) { $observers[$obsname] = array( 'type' => (string)$obsconfig->type, 'model' => $obsconfig->class ? (string)$obsconfig->class : $obsconfig->getclassname(), 'method'=> (string)$obsconfig->method, 'args' => (array)$obsconfig->args, ); we have flushed cache, re indexed, re run , disable compiler.

ruby - Rails performance loading entire table -

i have table has thousands of entries. putting each entry "datatable" shown here: http://learning.aws.ipv4.ro/html/essential-tables.html basically when page loads controller saying @query = table.all can each entry. okay? should concerned performance issues when table large? yes, should concerned loading data @ once. for situations makes sense (probably most), consider adding pagination. kaminari gem favorite such purposes.

python - CherryPy server running on windows gives random locking error -

i'm running cherrypy server using file based sessions. when run server on mac works fine, when run on windows machine have problems. i have web app makes many requests (~50) server on page load. on 1 or more of requests i'll below error message @ server. doesn't happen same request each time, seems random. loads without problems @ all. 14-07-2015 10:42:16 : info : (cp server thread-81) : (_cplogging ) : 127.0.0.1 - - [14/jul/2015:10:42:16] "get /static/scripts/jquery-2.1.4.min.js http/1.1" 500 823 "http://127.0.0.1:8099/" "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.132 safari/537.36" 14-07-2015 10:42:16 : info : (cp server thread-80) : (_cplogging ) : 127.0.0.1 - - [14/jul/2015:10:42:16] "get /static/scripts/moment.js http/1.1" 304 - "http://127.0.0.1:8099/" "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.

jsf - PrimeFaces custom text on Menubar -

i using <p:menubar> . i've seen can use 'facet' render custom content, shown in showcase. what want now, put text left first menuitem. <h:form> <p:menubar autodisplay="false"> <f:facet name="options"> <p:outputlabel value="my company"/> </f:facet> <p:menuitem value="home" outcome="index.xhtml" icon="ui-icon-pencil" style="float: right;"/> <p:menuitem value="register" outcome="register.xhtml" icon="ui-icon-pencil" style="float: right;"/> <f:facet name="options"> <p:commandbutton action="login.xhtml" value="login" icon="ui-icon-extlink"/> </f:facet> </p:menubar> </h:form> i hope it's clear mean. in case, outputlabel showing on right side of menubar. i

ember.js - In Ember Data how do I set a relationship field by id without it sending null to the server? -

i have order model export default ds.model.extend({ account: ds.belongsto('account', {async: true}), address: ds.belongsto('address', {async: true}), orderitems: ds.hasmany('orderitem', {async: true}), orderstatus: ds.belongsto('orderstatus', {async: true}), specialinstructions: ds.attr('string'), creationdate: ds.attr('date') }); this has order status, has model: export default ds.model.extend({ value: ds.attr('string'), orders: ds.hasmany('order', {async: true}) }); in order/create route use model account , aftermodel create new order in db straight away. want create in aftermodel this: var order = this.store.createrecord('order', { account: model, orderstatus: 1 }); return ember.rsvp.hash({ order: order.save().then(function() { self.set('order', order); }), products: this.store.findall('product').then(function(result) { self.set('products'

Cycling through JavaScript Objects in a JSON -

i'm requesting data website via post request , isolated needed data/key pair setting relevant_listings = data["listings"]; if print listings console bunch of objects lot of different properties , values: object {350503275519564011: object, 359510012249522033: object, 358384527390382582: object, 826758911669189345: object, 827884358724814556: object…} i know how access properties first object returned: for (var key in relevant_listings) { console.log(relevant_listings[key]["property1"]); however can't find way cycle through different objects , property1 second object example. would kind me out correct syntax/way approach this? kind regards, if use single for loop cycle though parent object won't able access child object's properties. can, among many strategies, use nested loops. instance, var data = { obj1: { dog: "retriever", name: "bob" }, obj2: { dog: &q

curl - Jenkins Remote Trigger Not Working -

i getting following error when try triggering build using following command: curl http://jenkins_server:port/jenkins/job/job_name/build?token=token_name output: authentication required <-- authenticated as: anonymous groups in: permission need have (but didn't): hudson.model.hudson.read ... implied by: hudson.security.permission.genericread ... implied by: hudson.model.hudson.administer -> i have admin rights , have enabled 'authentication token'. have build, discover , read rights on job. using jenkins 1.614. i did check several posts online not find works me. tried few options such as 1) curl -x post http://jenkins_server:port/jenkins/job/job_name/build?token=token_name 2) curl -u user:api (prints long html page) any suggestions. i install build token root plugin solve issue before https://wiki.jenkins-ci.org/display/jenkins/build+token+root+plugin then same, setup authentication token finally, either

vb.net - NotifyIcon onClick event not firing -

could tell me why onclick event in code isn't working? else works. onclick event isn't! also, how can pass filename can used this: balloontiptext=filename code: delegate sub invokedelegate() public sub ondocumentsucceeded(filename string) if not me.ishandlecreated me.createhandle() end if invoke(new invokedelegate(addressof handle_ondocumentsucceeded)) end sub public sub handle_ondocumentsucceeded() notifyicon1.icon = systemicons.exclamation notifyicon1.balloontiptitle = "your document has been generated" 'notifyicon1.balloontiptext = filename notifyicon1.balloontiptext = "testing...." notifyicon1.balloontipicon = tooltipicon.info notifyicon1.visible = true notifyicon1.showballoontip(5000) end sub private sub notifyicon1_mouseclick(sender object, e mouseeventargs) handles notifyicon1.mouseclick messagebox.show("text clicked") 'this not working!!! end sub how sol

wpf - What Windows 10 Control does the Alarms & Clock app use? -

Image
i'm making first step in creating universal applications - know top bar control in alarms , clock app? i noted middle section pivot , it's switching between pivotitems - when change top icons highlighted based on pivotitem is grid different buttons highlighted depending on selectedindex of pivot control? or specific control hasn't been documented yet? they're using pivot custom header template. this should provide insight: https://msdn.microsoft.com/en-us/library/windows/apps/dn997788.aspx

c# - Can Autofixture.Create<int> return a negative value? -

actually, following method returns positive integer: var fixture = new fixture(); var someint = fixture.create<int>(); is possible 1 day, feature evolves , begins return negative integer? or there official reason returns positive integer if not, there documentation hidden somewhere telling it? to keep on using autofixture, i'd know if changes foreseen. the author of autofixture discusses on blog . post specifies current implementation return positive numbers since deemed "safer" in general, don't think change in near future. the whole point of autofixture generate anonymous test data. asking integer can negative number. 100% safe, wouldn't rely on implicit assumption future implementations return positive numbers. can make more explicit providing custom specimenbuilder: fixture.customizations.add(new positiveintegerbuilder()); more information custom specimen builders can found here .

php - How can I don't use global variables in this page? -

on php document, made function. function getprices($url) { global $pricelist; // declare global . point of this. $src = file_get_contents_curl($url); $dom = new domdocument(); $selector = new domxpath($dom); $results = $selector->query('//table/tr/td/span'); foreach($results $node) { array_push($pricelist, $node->nodevalue); } } and bottom of page, called several. $pricelist = array(); getprices("http://finance.naver.com/item/sise_day.nhn?code=005930"); getprices("http://finance.naver.com/item/sise_day.nhn?code=005930&page=2"); getprices("http://finance.naver.com/item/sise_day.nhn?code=005930&page=3"); and display it. echo $pricelist[1]; echo $pricelist[2]; echo $pricelist[3]; the problem i'm using cms kinds of joomla, wordpress, , not support using global variable don't know how make without using global. how can make it? need many pages scrapping, i'm afraid. if sc

c++ - Kerberos administrator authorization -

i'm writing linux application integrates ms active directory. purpose i'm using kerberos. i've implemented mechanism authenticates domain user given credentials, want check if user member of administrators group. so have creds obtained function. error = krb5_get_init_creds_password(context, &creds, principals, password.c_str(), null, null, 0, null, null); and here want implement logic authorizes user/administrator if(!error) { // admin check } i'm thinking of using krb5_verify_init_creds function i'm not sure how can that. kerberos not authorization, authentication. (i.e. can figure out are, not allowed do). in general, once have kerberos id, ask authorization service id allowed do. in case, straightforward thing make ldap query find out if user member in group interested in. ms kerberos violates principle adding group information ad knows kerberos service tickets. however, not aware of standard kerberos api's provide

c# - IdentityServer3 SSO after login how to get user data back from FB (email from FB user) -

https://localhost/connect/authorize?client_id=myclientid&redirect_uri=https%3a%2f%2fredirect.local.com2f&response_type=id_token token&scope=openid profile email&state=dxpwzfvsdorcprdw&nonce=00000000000000000000000000000000&acr_values=idp%3afacebook this call identityserver3 , server redirect me fb login. when enter data fb login back id_token=xxx, access_token=xxx, token_type=bearer, expires_in=360, scope=openid, state=dxpwzfvsdorcprdw, session_state=z6lgn2qw-bcvapk2u4-vn_n2l_xlxgmhf8fut5mxm6m.7ad2e65fb56117dd4db5174802d6ef05 then token want connect fb api https://graph.facebook.com/me?access_token=xxx but back "message": "invalid oauth access token.", if cange token type jwt back "message": "bad signature", what doing wrong?

Django : Unable to import model from another App -

i hoping seek assistance on problem i'm having. i'm still learning django (and python) , come across particular issue i'm unable locate answer for. i've created new app called "news" , setup model app. using admin interface have created data. "pages" app, i'm trying import news_article class , getting error no module named news.models . i struggling see what's going wrong here. any assistance appreciated. dir structure bolton_gc [folder] - bolton_gc [folder] - news [folder] - migrations [folder] - __init__.py - __init__.pyc - admin.py - admin.pyc - models.py - models.pyc - tests.py - views.py - pages [folder] - migrations [folder] - __init__.py - __init__.pyc - admin.py - admin.pyc - models.py - models.pyc - tests.py - views.py - views.pyc - static [folder] - templates [folder] - __init__.py - __init__.pyc - settings.py - settings.pyc

bash - Linux: Append Word Count to Each Line of a File -

quite new linux @ moment, i've seen straightforward answers appending constant/non-changing word/component end of file e.g. shell script add suffix each line however, i'd know how append word count each line of .csv file end of each line, that: word1, word2, word3 foo1, foo2 bar1, bar2, bar3, bar4 becomes: word1, word2, word3, 3 foo1, foo2, 2 bar1, bar2, bar3, bar4, 4 i working comma separated values, if there quicker/simpler way making use of commas rather items, work well. cheers! simple awk solution: awk -f ',' '{print $0", "nf}' file.csv -f argument can used specify field separator, , in case. $0 contain entire line nf variable contains number of fields in line

javascript - sending url in ajax jquery and getting response null -

i have client url , getting response url through browser. while sending through ajax getting null response. right working .net application. here given script. please guide me proper response , in advance. response: { "resultflag": false, "message": "dealer not found", "info": [] } $.ajax({ type: "get", //get or post or put or delete verb url: url, //data: data, datatype: "json", contenttype: "application/json; charset=utf-8", // content type sent server success: function (result) { // json.stringify(result); alert(json.stringify(result)); }, error: function () { alert('error'); } });

angularjs - ui-gmap-window with directives and expressions -

i'm trying put html template in ui-gmap-window . html contains directives such ng-click , ng-repeat not work. <ui-gmap-google-map bounds="map.bounds" center="map.center" zoom="map.zoom" options="options"> <ui-gmap-window options="windowopt" show="windowopt.show" closeclick="closewindow"> <div class='map-popup'> <div><a ng-click='doit()' href='#'>action</a></div> <div ng-repeat="item in list"> {{item.content}} </div> </div> </ui-gmap-window> </ui-gmap-google-map> or maybe need use way create carousel inside of ui-gmap-window ? thanks here sample: http://plnkr.co/edit/k8vvw3 googled around sli

mechanize - perl how to find time for http request completion -

i have form fill , on submit, return result. now, want calculate time taken fulfill request ie time when result got displayed-time clicked submit. i have no idea, how so. please feel free use module. dont know parameter use check response page displayed. have used reading title of result page check response displayed correctly. my code: use www::mechanize; use lwp::useragent; $m = www::mechanize->new(); $m->get( "http://en.wikipedia.org/wiki/main_page" ); $m->submit_form( form_number => 1, fields => { search => 'honey', }, button => 'go' #my time1 should start @ moment ); #my time 2 should recorded result page displayed, dont know use time $tmp=$m->title; print "$tmp\n"; you use www::mechanize::timed

asp.net mvc - How Data is posted (POST) to Service in Servicestack , is it through URL? -

i have complex requstdto composed of other list of dto's (entity framework entities) [route("/demoservice/{username}/{employerid}/{report}/{selecteddatalist}/", "post")] public class reportdemo : ireturn<string> { public string username { get; set; } public int employerid { get; set; } public userreport report { get; set; } public list<selectedidlist> selecteddatalist{ get; set; } } where userreport follows public class userreport { public string username { get; set; } public datetime createdon{ get; set; } } when try post request gives me following error a potentially dangerous request.path value detected client (:) i think gives error due : in createdon field ( time part). is post values sent through url servicestack url ? if yes 1) if have large , complex requestdto resulting

apache - using functions in a php file through URL rewrited by htaccess -

i have php file function add_user inside it. i want call fuction browser, , works if use url user.php?rquest=add_user , want access same function (and others in same file too) following url user/add_function . within .htaccess file in same directory have following rule: rewriteengine on rewriterule ^user/(.*)$ user.php?rquest=$1 [qsa,nc,l] but 404 error. apparently doesnt ^user/ part, think. maybe because file. how can access add_user function using user/add_user ? thank you. i fixed adding options -multiviews in .htaccess file in subdirectory. i still think it's hosting provider related though.

Indexing domain object using elastichsearch, spring data and JPA -

im working on application using spring data , jpa implement rest-based service. want use elastcsearch indexing engine. domain object: @document(indexname="elastic",type="user_demo") @entity @table(name="user_demo") public class userdemo { @org.springframework.data.annotation.id @id @generatedvalue(strategy = generationtype.identity) private long userid; private string emailaddress; private string name; private string login; private string password; ... } on execution following exception: org.springframework.data.mapping.propertyreferenceexception: no property save found type userdemo! if has comined jpa, spring data , spring data elasticsearch same domain object can share example. separate repository packages above @configuration @enableelasticsearchrepositories(basepackages = "demo.elasticrepository") @enablejparepositories(basepackages = "demo.repository") public class repoconf

java - "No common protection layer between client and server" error when connecting to LDAP using GSSAPI I got -

when connecting ldap using gssapi hashtable<string, string> env = new hashtable<>(); env.put(context.initial_context_factory, ldapctxfactory.class.getname()); // must use qualified hostname env.put(context.provider_url, ldapuri); // request use of "gssapi" sasl mechanism // authenticate using established kerberos credentials env.put(context.security_authentication, "gssapi"); i got javax.security.sasl.saslexception: no common protection layer between client , server @ com.sun.security.sasl.gsskerb.gsskrb5client.dofinalhandshake(gsskrb5client.java:251) ~[na:1.8.0_40] @ com.sun.security.sasl.gsskerb.gsskrb5client.evaluatechallenge(gsskrb5client.java:186) ~[na:1.8.0_40] @ com.sun.jndi.ldap.sasl.ldapsasl.saslbind(ldapsasl.java:133) ~[na:1.8.0_40] you have specify qop env.put("javax.security.sasl.qop", "auth-conf");

encryption - "Unrecognized attribute 'configProtectionProvider'. Note that attribute names are case-sensitive." -

i'm encountering above mentioned error when application trying access appsettings configoverrides.config file. required me encrypt config settings. have used below mentioned command line. aspnet_regiis.exe -pef "connectionstrings" "*path config file resides*" after running command line in cmd prompt config values getting encrypted expected. when browse application through inetmgr above error in below mentioned line in config file. <appsettings configprotectionprovider="rsaprotectedconfigurationprovider"> note: encrypting file before placing in web folder in server i'm not doing in code. i'm encrypting running cmd prompt in admin mode. edit:this question might seem duplicate 1 isn't. reason every place have searched solution above error have encountered issue while encrypting @ beginning of application run. suggested in accepted answers here : unrecognized attribute 'configprotectionprovider' after encrypting app.

c# - Entity Framework calculated property -

Image
i have following classes in ef6 items ------------- public int itemid public string itemname public decimal itemprice public virtual list<listpricesitems> listpricesitems public decimal itemdiscountedprice (need calculate this) listprices ---------------- public int listid public string listdescription public date listvaliduntildate listpricesitems ----------------- public int lprid public int listid public int itemid public decimal itemdiscountedprice what need have itemdiscountedprice in items following [notmapped] public decimal itemdiscountedprice { { if(listpricesitems.listprices.listvaliduntildate > date.now()){ return listpricesitems.itemdiscountedprice ?? itemprice; } } } is possible ? if discount policy still active, check if itemdiscountedprice null , give standard itemprice if null. upda

python - Extract substrings from logical expressions -

let's have string looks this: mystr = '(txt_l1 (txt_l2)) or (txt2_l1 (txt2_l2))' what obtain in end be: mystr_l1 = '(txt_l1) or (txt2_l1)' and mystr_l2 = '(txt_l2) or (txt2_l2)' some properties: all "txt_"-elements of string start uppercase letter the string can contain more elements (so there txt3 , txt4 ,...) the suffixes '_l1' , '_l2' different in reality; cannot used matching (i chose them demonstration purposes) i found way first part done using: mystr_l1 = re.sub('\(\w+\)','',mystr) which gives me '(txt_l1 ) or (txt2_l1 )' however, don't know how obtain mystr_l2 . idea remove between 2 open parentheses. when this: re.sub('\(w+\(', '', mystr) the entire string returned. re.sub('\(.*\(', '', mystr) removes - of course - far , gives me 'txt2_l2))' does have idea how mystr_l2 ? when there "and" instead of &qu

CometD jQuery client not working IE9 -

i working on cometd jquery client, works different channels. trying to listen messages cometd server on channels after publishing message not able receive message on subscribed channel (the callback of subscribe not execute). note : working fine gc, ff , ie10 onwards. appreciated! in advance:) log : log: 20:53:53.064transportlong-pollingreset log: 20:53:53.064transportcallback-pollingreset log: 20:53:53.064new advice[object object] log: 20:53:53.064initial transport islong-polling log: 20:53:53.064statusdisconnected->handshaking log: 20:53:53.064handshake sent[object object] log: 20:53:53.064send[object object] log: 20:53:53.064transportlong-pollingsending request1envelope[object object] log: 20:53:53.064transportlong-pollingreceived errorerrorno transport log: 20:53:53.065transportlong-pollingwaiting @ most10000ms response, maxnetworkdelay10000 log: 20:53:53.071addingsubscriptionon/channel-1 scopeundefinedand callbackfunction _handlerusersession(message) {

loops - Looping through a directory in DOS and performing a command on them -

i have folder of pdf documents want strip first page off. have found tool command line , works successfully. command using: pdftk 1.pdf cat 2- output 1_stripped.pdf where 1.pdf original filename, , have 1_stripped.pdf output file. it take me forever each file, i'm sure within dos there must way of looping around every file in directory , doing command them. (passing in filename automatically , having output having "_stripped" @ end. i'm struggling it. i thought trick: for file in *.pdf pdftk "$file" cat 2- output "$file"stripped; done but i'm getting error messages. could point me in right direction?

javascript - FadeIn & FadeOut Conflicting Jquery -

i trying show paragraph on click h1 tag. when user clicks h1 paragraphs shows, it's not working when click h1 paragraph shows , when click again hides, when same thing again fade in , fade out effects works @ same time. here jsfiddle example: https://jsfiddle.net/9plnkqz8/ here html: <h1>reveal</h1> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> here jquery: (function(){ $('p').hide(); var object =

java - SessionAttributes cause problems with multiple tabs -

i have spring web app (spring 3.2) , have used following scenario handle edit pages: @controller @sessionattributes(value = { "packet" }) public class packetcontroller { @requestmapping(value = "/edit-packet/{packet_id}", method = requestmethod.get) public string editpacketform(@pathvariable(value = "packet_id") long packet_id, model model) { model.addattribute("packet", packetservice.findbyid(packet_id)); return "packets/packetedit"; } post method: @requestmapping(value = "/edit-packet/{packet_id}", method = requestmethod.post) public string packeteditaction(model model, @valid @modelattribute(value = "packet") packet packet, bindingresult result, sessionstatus status) { if (result.haserrors()) { return "packets/packetedit"; } packetservice.update(packet); status.setcomplete(); return "redirect:/"; }

Bootstrap integration into PHP(CodeIgniter) - Setup? -

the results when google bit outdated. how should integrate sb admin 2 bootstrap theme php framework codeigniter? from more noob perspective, how set server environment test out locally? xampp not appear work me on lubuntu 14.04(lxde), apache server never starts up. i use phpstorm ide. sorry beginner question, i've started on over project 5 times because things mess up. this tutorial can setup environment, apache included in php package http://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/

jQuery UI Tooltip won't close after click on IE11 -

Image
i have following code: <a class="btndelete" href="linkhere" onclick="opendialog(this); return false;" title="delete">delete</a> function opendialog() { $("#dialog-item-could-not-be-deleted").dialog({ modal: true, title: 'delete', zindex: 10000, autoopen: true, width: 'auto', resizable: false, closetext: 'close', buttons: { ok: function () { $(this).dialog("close"); $('.btndelete').tooltip("close"); } }, close: function (event, ui) { $(this).hide(); $('.btndelete').tooltip("close"); } }); } the code above isn't complete, that's not point. the idea on firefox, tooltip closes after call $('.btndelete').tooltip("close"); . on ie do

c++ - Is a C-style enum typedef in C++11 invalid in some cases? -

am having stupid typo can't find? or why typedef : typedef enum errorcode_e { no_error, general_error, uninitialized_data_access, allocation_error, read_write_error, no_filestream } errorcode_t; this error: error: expected identifier before numeric constant no_error, ^ if not typo, i'm pretty sure did many times in c different in c++? i'm explicitly compiling c++11 if matters.

java ee - docker with wildfly HA in domain mode -

with docker, have create new image when want redeployment. how fit wildfly high availability mode in domain mode? in domain mode host controller, deploy application host controller, , host controller take care of propagating deployment slaves, making sure entire cluster still , can serve request, regardless of current deployment status. how work docker, if have create image of wildfly new release, , restart host controller? host controller shouldn't down. or in scenario, should ignore docker altogether, considering fast becoming programmer's paradise in deployment arena. if want achieve zero-downtine service common solution first starting container new image, after important has been migrated new container(the old container has no more open connections etc.) can shutdown old container.

c# - Change background on mouse over for default button -

in wpf application want change background of button on mouseover . triggers isdefault , ismouseover adjusted. possible define separate trigger reacts on both of isdefault , ismouseover triggers. <controltemplate.triggers> <trigger property="isdefault" value="true"> <setter property="background" value="#1ba1e2" /> </trigger> <trigger property="ismouseover" value="true"> <setter property="background" value="#9a9ea1" /> </trigger> <trigger ??? property="isdefault" value="true" && property="ismouseover" value="true" /> <setter property="background" value="#9a9e88"/> </trigger> </controltemplate.triggers> you can use multitrigger , example of multi trigger in wpf . this: <window.resources> <st

visual studio - How do I see output from UnitTests in VS2013? -

i'm using xunit, , in both visual studio test explorer window , resharper unit test runner window, i'm no longer seeing "output" hyperlink show contents of writeline commands. is there setting in ide need change? this change in xunit2. no longer captures output console.writeline , etc. because runs tests in parallel, in multiple threads, , there's no way of knowing test output comes from. still possible capture output, need use xunit's itestoutputhelper in order so. see xunit docs more details.

java - Export DXL to Richtext item causes 64k errors -

Image
i have java agent exports design elements documents in separate database (one document per element). if elements complex , produced dxl becomes bigger export works errors when opening document form: this code (excerpt): dxlexporter exporter = session.createdxlexporter(); richtextitem dxl = designdoc.createrichtextitem(designelement.item_dxloutput); dxl.appendtext(exporter.exportdxl(doc)); dxl.setsavetodisk(true); dxl.compact(); designdoc.save(); any suggestions on how avoid this? if set field in form store contents mime , used computewithform, resolve problem breaking content up?

ios - Getting Dictionary Keys for the Filtered Values -

i having nsmutabledictionary (subjectvalue) contains value , keys. want filter based on values searched in search bar. so, used code below. nsarray *allvalues = [subjectvalue allvalues]; nsarray *filteredvalues = [allvalues filteredarrayusingpredicate:predicate]; now, filteredvalues have values based on search word. now, want keys filtered values got above result. know how values , all, want keys filtered result. please advise how can that? this not duplicate of question. existing query link what has been asked in above link is, how retrieve values based on predicate search. i'm asking beyond that. have got filtered values, want keys filtered values. question different. there function keysofentriespassingtest in nsdictionary . looking for? example: nsdictionary *subjectvalue = @{@"1":@"a", @"2":@"b", @"3":@"c", @"4":@"d"}; nsarray *filteredvalues = @[@"b", @"d&

java - How to generate List in a clearer way? -

i have following list of elements (call lst ), instance: [1, 2, 2, 5, 78, 768, 6823, 43, 234] i need create list<container> public class container{ private int value; private list<integer> children; public container(int i){ //impl } //other staff } as follows: container(1) has no children, therefore children filed = null . both container(2) same , has 1 child container(1) . container(5) has 2 children container(2) , 1 more container(2) . container(43) has 1 child container(5) . and forth. so, write if-else condition follows: list<integer> lst; //the list of integers list<integer> leastelems = new arraylist<integer>(); integer leastelem = collections.min(lst); for(integer e : lst){ if(e.equals(leastelem)) leastelems.add(e); } list<integer> withourleastelems = new arraylist<>(lst); withourleastelems.removeall(leastelems) ; collections.sort(withourleastelems); list<conta

ios - Headphone volume issue when using AvAudioEngine output -

i using avaudioengine capture user's voice while applying real-time effects(like reverb or sth) voice.here's code import uikit import avfoundation class viewcontroller: uiviewcontroller{ var audioengine:avaudioengine! var audioreverb:avaudiounitreverb! var audioinputnode:avaudioinputnode! override func viewdidload() { super.viewdidload() let session = avaudiosession.sharedinstance() session.setcategory(avaudiosessioncategoryplayandrecord, error: nil) session.setactive(true, error: nil) } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func recordwithreverb(sender: anyobject) { audioengine = avaudioengine() audioengine.stop() audioengine.reset() audioinputnode = audioengine.inputnode audioreverb = avaudiounitreverb() audioreverb.loadfactorypreset(.largeroom) audioreverb.wetdrymix = 50 audioengine.attachnode(audioreverb) let

javascript - How to remove trlabel value and tlLabel value from the square but it should be there in tooltip in heatmap chart? -

i want add description value x , y axies in tooltip of heat map data plots. achieved using trlabel , tllabel properties used show values in top left , top right inside square box. don't want values inside data plot boxes. want these in tooltips. if i'm doing wrong way, please suggest me correct way. fiddle showing approach. any appreciated. i tried solving issue, hope you.. fusioncharts.ready(function() { var saleshmchart = new fusioncharts({ type: 'heatmap', renderat: 'chart-container', width: '550', height: '270', dataformat: 'json', datasource: { "chart": { "caption": "top smartphone ratings", "subcaption": "by features", "xaxisname": "features",