Posts

Showing posts from March, 2013

java - Custom jndi name for ejb3.X with Jboss 7.1 -

i migrating 1 application weblogic jboss7.1 , ejb2.0 ejb3.x. application using jndi name ejb lookup. could me find out how can configure custom jndi name ejb3.0 , jboss 7.1. i have read on internet in jboss 7.1 there no concept of jndi-name. if true. let me know how can lookup jndi name, getting registered jboss ejbs present in ejb-jar.xml java:global/pirptfe/rrmsessionfacadeejb!com.bfm.app.pirptfe.heatmap.ejb.rrmsessionfacadehome java:app/pirptfe/rrmsessionfacadeejb!com.bfm.app.pirptfe.heatmap.ejb.rrmsessionfacadehome java:module/rrmsessionfacadeejb!com.bfm.app.pirptfe.heatmap.ejb.rrmsessionfacadehome java:jboss/exported/pirptfe/rrmsessionfacadeejb!com.bfm.app.pirptfe.heatmap.ejb.rrmsessionfacadehome java:global/pirptfe/rrmsessionfacadeejb!com.bfm.app.pirptfe.heatmap.ejb.rrmsessionfacaderemote java:app/pirptfe/rrmsessionfacadeejb!com.bfm.app.pirptfe.heatmap.ejb.rrmsessionfacaderemote java:module/rrmsessionfacadeejb!com.bfm.app.pirptfe.heatmap.ejb.rrmsessionfacaderemote j...

How to capture float and decimal numbers after equal sign REGEX -

i'm try float or decimal numbers grep -p example= jrockit.gc.latest.yc.number = 5034 ; i want 5034 . here regex => (?:\s*=\s*)([0-9.]+) equal sign. how number? use \k keeps text matched far out of overall regex match. grep -op '\s*=\s*\k[0-9.]+' file or grep -op '\s*=\s*\k\d+(?:\.\d+)?' file

android - OMX_FreeBuffer for buffer header 0x66a4cc30 successful, but not so successful -

i've been spending day trying find message comes from: [omxnodeinstance] omx_freebuffer buffer header 0x66a4cc30 successful i'm running mediacodec decoder feeds mediacodec encoder, , after 1 run, starts crash message appearing 20 times, application crashes. what omx, , can origin of warning , crash? [update] this crashes comes disparition of exception handling when running code. i've found crash (a null array), it's not handled, nor showing crash output in ide.

jquery - How to retain the dropdown values after selection -

the below code set select 2 dropdown values on page, works fine, however, since page refreshed when 1st dropdown selected, dropdpwn values not retained. how retain dropdown values ? $(document).ready(function() { $('.boxy').hide(); var drop1value = ''; var drop2value = ''; var cntys = geturlvars()['cntry']; var pis = geturlvars()['pi']; $("#drop1").on("change", function() { var drop1value = $('#drop1').val(); if (drop1value == "") { $('#content').hide(); } else { drop1value = $('#drop1').val(); } var burl = document.location.origin + document.location.pathname + '?cntry=' + drop1value + '&pi=' + pis; window.location.href = burl; }); $("#drop2").on("change", function() { var drop2value = $('#drop2').val(); if (drop2value == "") { $('#content').hide(); ...

java - How come I am getting InvalidSelectorException when trying to click a button using Selenium? -

Image
i new @ working selenium. trying click on following select button: here code: import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.firefox.firefoxdriver; public class firsttest { private static webdriver driver; public static void main(string[] args) throws exception { driver = new firefoxdriver(); driver.manage().window().maximize(); driver.navigate().to("http://www.metro.ca/flyer/index.en.html"); webelement postalcodeinputbox = driver.findelement(by.name("postalcode")); postalcodeinputbox.sendkeys("l6r1a1"); postalcodeinputbox.submit(); string pagesource = driver.getpagesource(); if(pagesource.contains("setstore btn")) system.out.println("setstore btn found"); webelement selectbutton = driver.findelement(by.classname("setstore btn")); ...

javascript - How could i include one tempate in another with html? -

i have code this: <script id="innertemplate" type="text/template"> hello world </script> and code this: <script id="outertemplate" type="text/template"> name john! <p> /*here want include code of innertemplate*/ </p> </script> does sombody know how it? thanks! you can try that: <script id="innertemplate" type="text/ng-template"> hello world </script> <script id="outertemplate" type="text/ng-template"> name john! <p ng-include="'innertemplate'"></p> </script> <div ng-include="'outertemplate'"></div> http://plnkr.co/edit/vmjhmzornqhpxyao7e9z

ios - Override an existed Property List -

i want override property list specific dictionary. nsdictionary *plist = [[nsdictionary alloc]initwithcontentsofurl:url]; nsstring *path = [[nsbundle mainbundle] pathforresource:@"routes" oftype:@"plist"]; nsmutabledictionary *lastdict = [[nsmutabledictionary alloc] initwithcontentsoffile:path]; [lastdict setvalue:[plist objectforkey:@"routes"] forkey:@"routes"]; [lastdict writetofile:path atomically:yes]; ps: plist (dictionary ok) after writetofile method, nothing happend property list path ... files added main bundle cannot modified (they supposed static), that's reason why code load plist file won't able overwrite it. you not noticing write operation failing because not checking result. ( - writetofile:atomically: returns bool tells whether operation completed or not.) if want have plist file can dynamically edit, should add document folder of app. here sample code show...

jms - "Channel not defined remotely" issue when connecting from camel to a WebSphere MQ server -

i have configured 2 servers side, 1 active mq , 1 websphere mq 8.0, in order communicate each other i've configured apache camel in middle, receives messages active mq , send them websphere. right camel able receive messages active mq server, when tries send them websphere mq throws error: caused by: com.ibm.mq.jmqi.jmqiexception: cc=2;rc=2540;amq9204: connection host '10.0.0.122(1414)' rejected. [1=com.ibm.mq.jmqi.jmqiexception[cc=2;rc=2540;amq9520: channel not defined remotely. [3=channel.test]],3=10.0.0.122(1414),5=remoteconnection.analyseerrorsegment] i able connect camel websphere queuemanager user, not the channel created, configuration camel side in order connect websphere server is: <bean id="weblogicconnectionfactory" class="com.ibm.mq.jms.mqconnectionfactory"> <property name="hostname" value="10.0.0.122"/> <property name="port" value="1414"/> <propert...

swing - Change button text after click, then revert the changes after clicking again using JAVA ActionEvent -

i displaying code wrote changing text when button clicked. trying default text clicking button again, unable so. please advice. import javax.swing.*; import java.awt.event.*; public class actions extends jframe implements actionlistener{ jpanel pnl=new jpanel(); imageicon ic1=new imageicon("/home/mudit/downloads/duke.png"); jbutton btn1=new jbutton("click",ic1); jtextarea ta=new jtextarea(5,37); public static void main(string[]args) { actions gui=new actions(); } public actions() { super("swing window"); setsize(500,300); setdefaultcloseoperation(exit_on_close); add(pnl); btn1.sethorizontaltextposition(jbutton.center); btn1.setverticaltextposition(jbutton.bottom); ta.setlinewrap(true); ta.setwrapstyleword(true); pnl.add(btn1); pnl.add(ta); btn1.setenabled(true); ta.settext("button enabled");...

python - Subprocess module for remote command(s) -

i trying use subprocess module executing remote command. need execute program called 'upgrade' located on remote server. also, need use argument in call. here how tried that: import subprocess p=subprocess.popen(['ssh', '15.36.77.1', './home/upgrade -u' ],stdin=subprocess.pipe, stdout=subprocess.pipe,stderr=subprocess.pipe, shell=true) stdout,stderr=p.communicate(input='\n') when try execute command , return code form it, 255, means command failed. me issuse? no third part libraries should used. sorry bad english. i think you're problem when using shell=true execute give subprocess.popen string. 2 ways , without shell=true follows: subprocess.call(["ls", "-l"]) subprocess.call("exit 1", shell=true) so in case string need give popen is: ['ssh 15.36.77.1 ./home/upgrade -u'] or can remove shell=true make command: p=subprocess.popen(['ssh', '15.36.77.1', './...

jquery - When i copy the HTML from DOM to template it works, otherwise not -

i have wordpress template , want add menu "wp_list_pages" , ready made script ( http://www.webpulse.com.br/menuzord/index.html ). when go website menu loses elements should added jquery $(menu).children("li").children("a").each(function(){ if($(this).siblings(".dropdown, .megamenu").length > 0){ $(this).append("<span class='indicator'>" + settings.indicatorfirstlevel + "</span>"); } }); (this part of menu script). ignored. when copy source code template works. idea happens here? don't understand why same code works when hard coded , doesn't work when included dynamically? this jquery call script: $(document).ready(function(){ $("#menuzord").menuzord({ align: "left", scrollable: true }); }); since wordpress uses jquery.noconflict() removes $ alias window try using following instead of $(document).ready(){}) jquery(fun...

if statement - How to use ifelse inside the for loop in R -

i have check names of variables in data.frame , if match found, need replace na values in variable median, else others replace nas mean. the data.frame cyl_spec has 11 variables , have replace na below: viscosity: impute median wax: impute median others: impute mean i can picking variables 1 @ time trying following code : attach(cyl_spec) var <- colnames(cyl_spec) for(val in var) { if(val == 'viscosity'){viscosity[is.na(viscosity == t)] <- median(viscosity, na.rm = t)} else if(val == 'wax'){wax[is.na(wax == t)] <- median(wax, na.rm = t)} else {val[is.na(val == t)] <- mean(val, na.rm = t)} } detach(cyl_spec) somehow code not doing , still getting same no of na in variable using command : sum(is.na(cyl_spec$viscosity) also, when run code following warning message : warning messages: 1: in mean.default(val, na.rm = t) : argument not numeric or logical: returning na 2: in mean.default(val, na.rm = t) : argument not numeric or l...

Qt4: how to send QString inside a struct via QSharedMemory -

i have struct struct control_data{ int column_number; qstring cell; }; i need send thread of qsharememory. read can't because qstring contains pointers inside. other ways? you have serialize struct byte array. can convert qstring const char* this: mystring.tostdstring().c_str(); but serializing qstring should work. the first step serialize struct qdatastream using qt, example here . then once struct can read , written can pass shared memory. a complete example of using qsharedmemory can found here . here relevant code: // first, test whether shared memory segment attached process. // if so, detach if (sharedmem.isattached()) { sharedmem.detach(); } ... qbuffer buffer; buffer.open( qbuffer::readwrite ); qdatastream out( &buffer ); out << youstruct; int size = buffer.size(); // size of int + size of qstring in bytes if ( !sharedmem.create( size ) ) { return; } // write shared memory sharedmem.lock(); char *to = (char*...

c# - Correct way to create custom "Todo Items"? -

resharper allows me create custom "to-do items" under options -> tools -> to-do items . these todo items include color value. but there color found under visual studio -> tools -> options -> environment -> fonts , colors -> display items -> resharper todo item . my todo items use latter color (the vs one); color chosen in to-do items dialog nothing. if set resharper todo item color default or automatic , not use 1 set specific todo item. why there 2 apparently contradicting colors this, , how 1 to-do items dialog used instead? this looks bug in resharper - custom colour todo items ignored, , uses setting in visual studio's fonts , colours settings page. i've opened issue can use vote , track: https://youtrack.jetbrains.com/issue/rsrp-445641

Put many resources and paths under subdomain (Rails Routes) -

i'd forward bunch of stuff subdomain in rails applications (including nested resources), without going through views update link_to _path links. possible? edit so far have following. problem is, can access either or without subdomain, without being redirect once enter or leave resource should on subdomain. e.g. example.com/apps same connect.example.com/apps , , site root can either example.com or connect.example.com scope '/' with_options :conditions => {:subdomain => 'connect'} |site| site.resources :contracts site.resources :bills site.resources :feedbacks site.resources :newsletters site.resources :contacts site.resources :apps site.resources :elements, controller: 'apps/elements' site.resources :features, except: [:index], controller: 'apps/elements/features' member site.post 'complete' end end end site.resources :comments, controller: 'comments' ...

c# - How to close a sqlite file opened with System.Data.SQLite and DbContext? -

in my ef6 recreation of this walkthrough creating , accessing sqlite database using system.data.sqlite, found access database leaves file handle open database file long after i've disposed of disposable object created: dbcontext. this prevents me deleting database file when i'm done (e.g. @ conclusion of unit test, or when user of app requests it). you can see how simple use of dbcontext , how file.delete after closing fails: using (var context = new chinookcontext()) { var artists = in context.artists a.name.startswith("a") orderby a.name select a; foreach (var artist in artists) { console.writeline(artist.name); } } // i've disposed of dbcontext. handles sqlite database file should // have been released now. // yet, next line fails because file still locked. file.delete("chinook_sqlite_autoincrementpks.sqlite"); ( full project context on github ) any...

sql - Adding two tables with no column in common in MySQL -

i have 2 tables database. want append these 2 tables. not able find solution it table 1 - names first_name last_name navjot singh ram gopal naveen kumar table 2 - address address pin delhi 90007 lucknow 90003 mumbai 60008 how data these 2 tables in following format: first_name last_name address pin navjot singh delhi 90007 ram gopal lucknow 90003 naveen kumar mumbai 60008 these sample tables. want thing on 50,000 rows. number of rows same in both tables. have tried cross join. have tried following sql well: select * names,address; it increases total number of rows. tried union, did not work. it cbind.data.frame in r. how in mysql? appreciated. the problem have no column join. assuming have column specify ordering, can do: select t1.*, t2.* (selec...

javascript - how i will extract month and year from month year picker,i am using jquery -

i want month , year seperate month/year picker. tried this. i want insert month , year database,for want seperate.i using codeigniter frame work var month= $("#ui-datepicker-div .ui-datepicker-month :selected").val(); window.write(' month'); its not working. <!--<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">--> <script src="../monthyear/jquery-ui.js"></script> <link rel="stylesheet" href="jquery-ui.css"> <label for="monthyearpicker">date :</label> <div class="monthyearpicker" name="mydate" ></div> <!--<input name="mydate" class="monthyearpicker" />--> <script> $(document).ready(function () { $(function () { $('.monthyearpicker').datepicker({ changemonth: true, ...

c# - Why does this Regex match? -

i have written regular expression match following criteria any digit (0-9) hyphen whitespace in order length between 10 , 25 ([0-9\-\w]{10,25}) i using detect payment card numbers, works: regex.ismatch("34343434343434", "([0-9\\-\\w]{10,25})"); // true but works: regex.ismatch("logmethodcomplete", "([0-9\\-\\w]{10,25})"); // true what doing wrong? this c# take @ regular expression language - quick reference , section character classes. \w matches word character including underscore, not whitespace. to match whitespace, can use \s . to match digits, can use \d .

C# Updateing object references and multithreading -

after reading how it, i'm quite confused. so here want do: have datastructure/object holds kinds of information. tread datastructure if immutable. whenever need update information, make deepcopy , changes it. swap old , newly created object. now don't know how right. let's @ side of reader/consumer threads. myobj temp = datasource; var = temp.a; ... // many instructions var b = temp.b; .... as understand reading references atomic. don't need volatile or locking assign current reference of datasource temp. garbage collection. understand gc has kind of reference counter know when free memory. when thread updates datasource @ moment when datasource assigned temp, gc increase counter on right memory block? other thing compiler/clr optimization. assign datasource temp , use temp access data members. clr do? make copy of datasource or optimizer use datasource access .a , .b? let's assume between temp.a , temp.b lot's of instructions reference temp/dataso...

inheritance - Strange interface design Java -

at work came across following design in java project: consider interfaces foo , bar , , baz follows: interface bar { public int a(); } interface baz { public int b(); } interface foo extends bar, baz { public int c(); } now, consider class fooimpl : public class fooimpl implements foo { private bar bar; private baz baz; public int a() { return bar.a(); } public int b() { return baz.b(); } public int c() { return 0; } } what use cases kind of class hierarchy? seems me introduces lot of boilerplate , not add in terms of abstraction, other breaking large file smaller files. it allows things this: foo foo = new fooimpl(); usebar(foo); public void usebar(bar bar) { bar.a(); } whether useful depends on real context. example code classes , methods meaningless names not support rational judgement. the other thing note fooimpl implemented kind of wrapper bar , baz instances. that's not (st...

ruby - Rails upgrade to 4.1.12 causes ActiveAdmin crash -

we have app we're upgrading rails 3.2.x 4.1.x. after tweaking, app runs now, trying load activeadmin dashboard, error: showing /users/xxx/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activeadmin-1.0.0.pre1/app/views/active_admin/page/index.html.arb line #2 raised: undefined method `call' #<pano::activerecord_relation:0x007fd869a3c138> extracted source (around line #2): 1 insert_tag active_admin_application.view_factory["page"] rails.root: /users/xxx/google drive/code/xxxx/xxxx-rails the code causing crash in activeadmin code itself: /users/xxxx/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activeadmin-1.0.0.pre1/app/views/active_admin/page/index.html.arb i'm not sure i'm missing here, can potentially point me in right direction?

sql - select row from multiple tables with least performance impact -

i have 2 tables same columns . eg workinfo 1 table , oldworkinfo table. columns can - id , branch , product , data . (id unique primary key.) when transaction completed deleted workinfo , move oldworkinfo . i write query optimally search workinfo first , oldworkinfo, have perform join operations in other tables. ie first search in workinfo table , if record available return , otherwise search in oldworkinfo , return record. following sample query have written using union search in both tables. with squery (select * workinfo union select * oldworkinfo) select * squery squery.id=key; kindly suggest possible in single query . cannot use plsql option overall joins , other queries become complicated. as understand, main idea avoid unnecessary scan on big table historical data. query can avoid it: select * workinfo id = key union select * oldworkinfo not exists ( select null workinfo wi wi.id = key ) , id = key

xcode6 - Xcode's IB cannot show up my custom view? -

xcode's ib cannot show custom view? recently, updated xcode version 6.4 (6e35b) , encounter ib problem. before update xcode, custom view (extend uiview) can show in ib. required init(coder adecoder: nscoder) { // 1. setup properties here // 2. call super.init(coder:) super.init(coder: adecoder) // 3. setup view .xib file xibsetup() } currently, cannot see custom view in ib. can work during run time. how can make them show in ib? finally, got solution. not caused update of xcode. caused closed "auto-refresh" feature within ib. so solution is: xcode -> editor -> refresh views think see custom view within ib.

sql - Increment all Employees Experience by 1, using month-day from date in postgreSQL -

Image
we've employee's doj(date of join) , need increment employee's experience "1". we've consider "sysdate" , "sysdate+7days(week)" condition. whom ever falls in week experience should incremented while considering " month , day " , ignoring year dates. suppose:- date= 20-08-2015 , we've select records 20-08(dd-mm) 26-08(dd-mm) dates ignoring year . the expected result can dummy column experience. thanks in advance ok, real beast first meat, tooth pick: with chk ( select to_timestamp('12-28', 'mm-dd') dt ), doj_doy ( select workername, workerdoj, extract('doy' workerdoj) doy my_table ), date_tails ( -- mm/dd in year 0 select workername, workerdoj, (workerdoj - extract('year' workerdoj) * interval '1 year') date0 doj_doy union -- add doj in year (year +1) select workername, workerdoj, (workerdoj - (extract('year' workerdoj...

ajax - How to catch http error response in Angular -

background my angular application communicates database through set of api endpoints. "user/authenticate" endpoints accepts username , password , returns success (200) or bad request (400) http response. controller authservice.login(email, password) .success(function (response) { /* go application */ }) .error(function (response) { /* display proper error message */ }); auth service factory.login = function(email, password) { return $http({ method: 'post', url: "http://myserver/user/authenticate", data: $.param({email: email, password: password}), headers: {'content-type': 'application/x-www-form-urlencoded'} }); } problem when username , password fails , api returns 400 response, though i'm catching error , i'm displaying proper message user, error appears in browser console. post http://myserver/user/authenticate 400 (bad request) can ha...

c++ - Leaking resource from a RAII object -

i'm reading scott meyers' effective c++ , i'm @ item 15, providing access raw resource in resource-managing classes. here example: class font { // raii class public: explicit font(fonthandle fh) // acquire resource; : f(fh) // use pass-by-value, because {} // c api ~font() { releasefont(f ); } // release resource ... // handle copying (see item14) private: fonthandle f; // raw font resource }; he proposed introduce explicit conversion member function getting access raw resource: class font { public: ... fonthandle get() const { return f; } // explicit conversion function ... }; here said: some programmers might find need explicitly request such conversions off-putting enough avoid using class. that, in turn, would increase chances of leaking fonts , thing font class designed prevent. i didn't understand how providing acces raw-resource increase chances of leaking fonts? returned copy of raw pointer resour...

When I use a UIScrollView to zoom out an UIImageView, can I get the zoomed ImageView's position? -

i init scrollview's frame according imageview's frame, contentsize. set imageview child in order zoom out , works well. but, method below can (uiview *)view 's relative location father(scrollview).actually, view.frame.origin = (0, 0) , weird me. how explain situation? can zoomed imageview's absolute position(to rootview) ? (void)scrollviewdidendzooming:(uiscrollview *)scrollview withview:(uiview *)view atscale:(cgfloat)scale parameter view what changes when uiscrollview scrolling contentoffset & bounds not subviews' frame s.

php - Class not found -

i made research results not related problem : have model associated table contains underscore. <?php use phalcon\mvc\model; use phalcon\mvc\model\query; class tableclient extends model { public function getsource() { return "table_client"; } function lireparcritere($critere) { $ssql = " select c.table_code,s.salle_code,s.salle_lib,c.table_lib,c.table_nb_couvert,c.table_comment table_client c inner join salle s on s.salle_code = c.salle_code 1 = 1 "; if(isset($critere["table_code"]) && $critere["table_code"] != "") { $ssql .= "and c.table_code = '" . $critere["table_code"] . "' "; } $query = new query($ssql,$this->getdi()); $ret = $query->execute(); return $ret; } function ajouter($tab) { $champs= ""; ...

swing - Is there a limit to audio file size java can play? -

i'm writing program loop audio file on java (bluej) continuously when button pressed. code working fine wav audio files less 1mb,but not of size greater 1mb. there limit size of file can play? , if so, how can work around this? great, thanks. here code:- import javax.swing.*; import sun.audio.*; import java.awt.event.*; import java.io.*; public class sound { public static void main(string args[]) { jframe frame = new jframe(); frame.setsize(200,200); jbutton button = new jbutton("button name"); frame.add(button); button.addactionlistener(new al()); frame.show(true); } public static class al implements actionlistener { public final void actionperformed(actionevent e) { music(); } } public static void music() { audioplayer mgp = audioplayer.player; audiostream bgm; audiodata md; continuousaudiodatastream loop = null; ...

sql - Rename column for all tables in mysql database -

i need rename column tables in databse. list of columns using query: select table_name information_schema.columns column_name= <column name>; but how rename simple possible , not write alter table <table name >rename column <old name> <new name>; for each table. i've tried write procedure: delimiter $$ drop procedure if exists renamecolumn $$ create procedure renamecolumn(in oldname tinytext, in newname tinytext) begin declare @name varchar(255); declare exit_loop boolean; declare tablename_cursor cursor select table_name information_schema.columns column_name=oldname; declare continue handler not found set exit_loop = true; open tablename_cursor; rename_loop: loop fetch tablename_cursor @name; alter table @name rename column oldname newname; if exit_loop leave rename_loop; end if; end loop rename_loop; end $$ d...

How to convert a jpeg image to an svg in octave? -

Image
i have black n white image first convert png transparent background such black part of image remains. using output image want convert svg. of through code can connected back-end of server. how can achieve this? i not work, may started. suggest imagemagick , potrace both of free , available os x, linux , windows. can integrate them php , run them library functions, now, using terminal/commandline. let's start making chessboard image imagemagick convert -size 200x100 pattern:checkerboard chess.jpg we can threshold make pure black , white, this: convert chess.jpg -threshold 50% chessbw.jpg then want send potrace make svg , needs pbm format file, convert pbm this: convert chess.jpg -threshold 50% chessbw.pbm now tell potrace convert svg potrace -b svg chessbw.pbm -o result.svg but not easy see, imagemagick convert result.svg jpeg red background can see transparent areas: convert -background red result.svg result.jpg ok, more of explanat...

web - How to make a jQuery plugins hierarchy (nested plugins) -

i working on small project these days, , needed work kind of home-made plugins based on jquery. i have 5 plugins , want wrap them in 1 big plugin avoid extensive includes in html in way make hierarchy this: jquery.bigplugin.nestedplugin and wanna know how call nested plugin methods. if want avoid extensive includes should merge source files of plugins 1 file. have include 1 file , don't need change api of these plugins. here you'll find hints how that: combine , minify multiple css / js files .

How can I load external jar libraries in the Moqui project? -

i trying integrate apache solr moqui. not able access solr api. have placed solr jar in framework/lib directory getting exception when trying run service tools section. error running groovy script (org.codehaus.groovy.control.multiplecompilationerrorsexception: startup failed: general error during class generation: java.lang.noclassdeffounderror: unable load class org.apache.solr.client.solrj.impl.httpsolrclient due missing dependency org/apache/http/entity/mime/content/contentbody is there other configuration need do, use solr api? in general best not modify under framework directory, configuration files such properties files should overridden adding them in runtime/classes directory or in /classes directory. in case have jar framework/lib directory have add framework/build.gradle file , gradle build jar file added moqui war file. the better approach add runtime/lib directory or better when using jar file in code in component add /classes directory (the making app...

Python regex for integers combination from 01000 to 95999 -

i've been trying build regular expression match french zipcodes in python. a french zipcode composed of department code (from 01 95) followed 3 digits subregion (let's 000 999) large. i'm trying 1 : 0[1-9][0-9]{3}$|[1-8][0-9]{4}$|9[0-5][0-9]{3}$ i split problem in three 01xxx 09xxx, 1xxxx 8xxxx, 90xxx 95xxx any idea make better ? edit : (0[1-9][0-9]{3}$)|([1-8][0-9]{4}$)|(9[0-5][0-9]{3}$) : match if input number has 5 digits. and final version : ^((0[1-9]{1})|([1-8]{1}[0-9]{1})|9[0-5]{1})[0-9]{3}$ "factorize" [0,9]{3} endpart. debuggex demo you can(/ should / must ) test regex on the official list of french postal codes . import collections codes = collections.defaultdict(list) line in open('code_postaux_v201410.csv'): if not line[:1].isdigit(): continue row = line.strip().split(';') codes[row[2]]+= [row[1].strip()] def test_failures(regexp): r = re.compile(regexp) return [code code ...

RecyclerView height issue in API 17 and API 16 - Android -

i implementing recyclerview in app show list of stuff. on lg nexus 5 (android 5.1 m), if set target sdk 16 or 17 (basically simulate what's happening on phones api 16, 17) row height of list changes dramatically. however, doesn't occur on api 18 or 18+. cannot figure out why happens , optimal approach tackle issue. one more thing: use imageview inside list row. happening when in imageview loading images server. use imageloader library this. if use static images, don't have issue "if use static images, don't have issue" when using static images, loaded in during onlayout() imageview . when image loaded in during layout, affects measured size in onmeasure() pass. when image isn't set statically(i.e. pulled down on network async), imageview can't rely on size of image determine measured size. when image loaded, shrunk fit within existing measured imageview . solutions: specify minheight on imageview or row layout or spec...

maven - How to restrict a programmer to use a dependency in the pom.xml for spring boot? -

for example undertow (spring boot - using undertow container) jetty (spring boot - using jetty container) <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> <exclusions> <exclusion> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-tomcat</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-jetty</artifactid> </dependency> i wanted restrict programmer use undertow or jetty dependency in code.

ios - Swift UICollectionViewCell resize with content -

i have problem uicollectionviewcell , hard newbie me. need help. working on dictionary. have search bar, collection view, labels , text view. can not resize neither collection view cell nor text view when showing search results. view controller: import uikit class sozlukcontroller: uiviewcontroller, uisearchbardelegate, uicollectionviewdatasource, uicollectionviewdelegate{ @iboutlet var wordsearchbar: uisearchbar! @iboutlet var collection: uicollectionview! var worddatalist = [string]() var meaningdatalist = [string]() var dictionarydatalist = [string]() var yeardatalist = [string]() override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } override func viewdidload() { super.viewdidload() } func searchbarsearchbuttonclicked(searchbar: uisearchbar) { worddatalist = [] meaningdatalist = [] dictionarydatalist = [] yearda...

php - how to write SQL Query for 3 column values in one field? -

i want answer yuvi yuvi@gmail.com 9874563214, if user search name email mobile means ans come this. $sql=mysql_query("select name,email_id,mobile_number user_information (name '".$user_search."%'or email_id '".$user_search."%' or mobile_number '".$user_search."%') , (status='active')"); $res=mysql_num_rows($sql); you can try below code $sql=mysql_query("select concat_ws(' ', name,email_id,mobile_number) details user_information (name '".$user_search."%'or email_id '".$user_search."%' or mobile_number '".$user_search."%') , (status='active')");

ios - WatchConnectivity session in more than one view controller -

i developing watch app using watchos 2 , parent app on ios 9 beta. using watchconnectivity sessions pass data apple watch iphone. need have session in 2 different view controller files, there problems start new wcsessions in each of view controllers , use them? basically trying navigate 1 view controller other view controller using performseguewithidentifier , works fine when put in viewdidload , put inside session method, starts breaking, , suspecting has wcsessions. following part of code in trying navigate: - (void)session:(nonnull wcsession *)session didreceivemessage:(nonnull nsdictionary *)message replyhandler:(nonnull void (^)(nsdictionary * __nonnull replymessage))replyhandler { nsstring *msg = [message objectforkey:@"msg"]; // nsdictionary* replyvalues = @{@"session":@"established between phone , watch"}; if ([msg isequaltostring:@"fromwatch"]) { iswatch = true; [self performseguewithidentifier: ...

Chaining multiple array methods in javascript -

i trying chain multiple methods in array. original array: this.array = [1, 2, 3, 4, 5, 6]; clone: this.array.slice(0); change first element this.array.splice(0, 0, 10); running these individually works. combining both: this.array.slice(0).splice(0, 0, 10); this doesnot work. why? because this.array.splice(0, 0, 10); return new array(containing removed elements - in case empty array since no element removed) not source array on called on. in case using clone of original array, loosing reference cloned instance. so this.array.slice(0) return clone on .splice(0, 0, 10) performed(it update cloned object) splice operation return new array(with removed objects) not cloned instance looses reference it so solution use temp reference like var tmp = this.array.slice(0); tmp.splice(0, 0, 10)

java - Insufficient String Buffer Declaration -

i use tool check coding style , got many advise : stringbuffer constructor initialized size 16, has @ least 35 characters appended. here of code: final stringbuffer contents = new stringbuffer(); why whould happen? how did count 35 characters ? how can edit size of stringbuffer ? or method should use solve problem?? changing capacity of stringbuffer after has been created more costly creating expected needed capacity. use constructor remove warning: /** * constructs string buffer no characters in , * specified initial capacity. * * @param capacity initial capacity. * @exception negativearraysizeexception if <code>capacity</code> * argument less <code>0</code>. */ public stringbuffer(int capacity) { super(capacity); }

node.js - node js - debugging the event loop -

in express.js project works fine, having several routing files other function files, feel bit drowning in functions, not knowing functions run, when, , caller. for example, have 2 functions may run many times in event loop: router.use see constructor related routes (from want filter out some), , verify token function should run when conditions met, such api calls, or regular calls detect admin cookie etc. i'm trying generate log can me find functions called more once , caller. sort of map per event. i use console.log see order , current call url when firing event, , use node-inspector's breakpoints see how many times functions router.use called, when manually following functions in node-inspector, many node core files involved in process, makes task more tedious because interested debug functions... , doesn't let me see bigger picture, more readable information on zoomed out perspective. what preferable method generate such log/report?

android voally exception error not showing on the log cat -

i have below code using volley, having blank page when opening app , when click on php link returning values. why showing white blank on opening ? getting exception not able read can me ? this line of error d/volley(4754): [1] 2.onerrorresponse: mainactivity this code jsonarrayrequest moviereq = new jsonarrayrequest(url, new response.listener<jsonarray>() { @override public void onresponse(jsonarray response) { log.d("r", response.tostring()); hidepdialog(); system.out.print(response); // parsing json (int = 0; < response.length(); i++) { try { jsonobject obj = response.getjsonobject(i); movie movie = new movie(); movie.settitle(obj.getstring("name")); movie.setthumb...

sitecore6 - Sitecore 7.0 Upgrade: The connection was reset error -

Image
i have sitecore 6.6 installed in server.i getting below error while installing update package sitecore 7.0 rev.130424. has else faced issue? error everytime reach processing 1936 of 2056 stage. we solved issue. there 2 things doing wrongly. sitecore update installation wizard had issue mozilla firefox. frame in picture says 'the connection reset' iframe keeps getting updated actions performed. if not updated while firefox closes connection. so solution use supported version of internet explorer . the reason why stuck @ process 1936 , not updating iframe content because sitecore trying update files , did not had privileges required update it. so solution give iis worker process access data , website folders. select website folder -> right click -> properties -> security tab -> edit -> add -> type iis_wpg -> check names -> ok -> give full control iis_wpg user -> ok. same data folder , restart installation.

unicode - Support for C-Functions in Future Version of C++ / CString vs. LPCTSTR / Binary Datatypes -

we have migrate mfc-project (multibyte code/ansi) unicode/windows 7. in project many c-functions _tcschr, _tcsncpy, _stprintf, _tcslen... used. lpctstr used instead of cstring. char* used make binary operations. i think there many pitfalls lpctstr , unicode(example: _tcslen).so want replace lpctstr cstring/ const cstring. new function should use string-methods of cstring. char should replaced tchar, because cstring based on tchar. don't care char , binary operations in future. length of 8 bit seems stall 8 bit, encodings, ..?   so questions are: how long planned support old c-funktions in future (vs 2013, vs 2015,...)? is there tested library based on cstring replace old c-functions (less effort)? what datatype should use binary operations future support? is there reason not replace lpctstr through cstring (with cast operator lpctstr)?

ruby on rails - How can I write a shortcut for signing a user in in my integration tests? -

motivated discussion in question , want write log-in method integration tests. in test_helper.rb found such method, defined inside activesupport::testcase class, , test inherits actiondispatch::integrationtest . copied method , put (inside test_helper.rb ) actiondispatch::integrationtest class. doesn't work , tests fail message: capybara::expectationnotmet: expected "data:," include "study | word up" it never opens app in browser before. so question is, can use such shortcut @ in integration tests, , if yes, how? i using build in authentication has_secure_password , mechanism shown michael hartl in railstutorial. here test_helper.rb : env['rails_env'] ||= 'test' require file.expand_path('../../config/environment', __file__) require 'rails/test_help' require 'minitest/rails' require 'minitest/rails/capybara' require 'capybara/rails' require 'capybara/poltergeist' class activesupp...

Set default language inside Google Maps -

i want set property using google maps api dynamically set specific language display. i have following script: <iframe src="https://www.google.com/maps/embed"></iframe> i set language such ru. tried this: <iframe src="https://www.google.com/maps/embed&language=ru-ru"></iframe> it still not work. can me? from the documentation : language defines language use ui elements , display of labels on map tiles. note parameter supported country tiles; if specific language requested not supported tile set, default language tileset used. default, visitors see map in own language. there aren't tiles in russian new york city, if pan russia, see russian tiles. example map

sql server - Capture single SQL Select statement -

hello sql coders , gurus i’ve been coding sql few years , i’ve wondered how can grab first sql statement user executes against db each day say. user might have number of select statements highlighted when hit f5 (to execute 1 after another) i’m trying first one. i’ve got couple of efforts below return please see. example . .. select 'blah first select' select 'blah second select' declare @sqltext varbinary(128) select @sqltext = sql_handle sys.sysprocesses spid = @@spid select text sys.dm_exec_sql_text(@sqltext) ---------------------------------------------- which when executed returns of . .. ‘select 'blah first select' select 'blah second select' declare @sqltext varbinary(128) select @sqltext = sql_handle sys.sysprocesses spid = @@spid select text sys.dm_exec_sql_text(@sqltext)’ but result want first select statement executed db.. .. ‘select 'blah first select'‘ there may many long , complex select statemen...

matlab - Working interactively in Python -

is there way switch 'interactive' mode within python script, similar "keyboard" function in matlab? aware of ipython, don't think allow me 'pause' @ point in script, e.g., within for-loop, switch interactive mode based on if-statement. in matlab like: for = 1:100 % stuff if == 55 keyboard end % more stuff end i think want debugger. import pdb; pdb.set_trace() this dump debug session can inspect , edit variables, , call functions.

javascript - How to make jQuery function executable with Spring MVC? -

i have spring project values interval jquery function doesn't work. new jquery , ajax , don't know how fix it. this controller class: @controller public class chooseform { @requestmapping(value = "/choose", method = requestmethod.get) public modelandview selectvalue() { try{ file file = new file("c:/program files/apache software foundation/tomcat 8.0/tmpfiles/canon.xml"); jaxbcontext jaxbcontext = jaxbcontext.newinstance(canon.class); unmarshaller jaxbunmarshaller = jaxbcontext.createunmarshaller(); canon canon = (canon) jaxbunmarshaller.unmarshal(file); list<table> table = canon.gettable(); for(table tables: table){ list<string> row = tables.getrow(); list<string> first = new arraylist<string>(); list<string> second = new arraylist<string>(); list<s...