Posts

Showing posts from January, 2015

phpbrew switch does not change PHP version -

if run "phpbrew switch 5.6.3" followed "php -v", 5.9.3 (php system version) current php version. if run phpbrew "use 5.6.3", 5.6.3 php -v. is there solution problem? php version 5.6.3 installed , built phpbrew , working after using use command. i using elementary os freya (ubuntu 14.04) latest phpbrew version. if getting red error line "you should not see this, if see this, means didn't load ~/.phpbrew/bashrc script, please check if bashrc sourced in shell.", need run source ~/.phpbrew/bashrc . it's idea run echo "source $home/.phpbrew/bashrc" >> ~/.bashrc , in future automatic.

php - Adobe Edge Animation doesn't show on whmcs -

Image
i have edge animation. using whmcs header template. <!--adobe edge runtime--> <meta http-equiv="x-ua-compatible" content="ie=edge"> <script type="text/javascript" charset="utf-8" src="templates/{$template}/edge.5.0.1.min.js"></script> <style> .edgeload-navalti { visibility:hidden; } </style> <script> adobeedge.loadcomposition("untitled-1", "navalti",{ scaletofit: "none", centerstage: "vertical", minw: "1024px", maxw: "undefined", width: "1920px", height: "250px" }, {"dom":{}}, {"dom":{}}); </script> <!--adobe edge runtime end--> and editing animation area <div> : <div id="stage" class="navalti">

android - How to add in the parameter for MotionEvent -

i have written codes location imageview. below code: private void touchlocation(motionevent e){ float x = e.getx(); float y = e.gety(); string message = "location x = " + x + ", y = " + y "."; context context = getapplicationcontext(); int duration = toast.length_long: toast toast = toast.maketext(context, message, duration); toast.show(); } in oncreate() method, how shall call function? suggestion appreciated. how shall instantiate object class motionevent? imageview.setontouchlistener(new ontouchlistener(){ @override public boolean ontouch(view v, motionevent e) { float x = e.getx(); float y = e.gety(); string message = "location x = " + x + ", y = " + y "."; // more code return true; } });

HTTP 404 Not Found after successful Spring Security authentication -

i trying implement spring security authentication , authorization using database. spring security authentication working good. getting http 404 not found page url /sample_app/j_spring_security_check, instead of default-target-url should goto. here spring-security file <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> <beans:import resource="im-jndi-datasource.xml" /> <http pattern="/inventory/auth/login" security="none"/> <http pattern="/inventory/auth/deny" security=&

WPF Clickonce update failing - Why is Trust Not Granted? -

trying clickonce application work correctly, keep encountering "trust not granted" exceptions, , i'm not yet seeing why happening. the exe signed code signing certificate verisign, both setting "sign clickonce manifests" option in signing tab, implementing pre-publish approach metioned here: http://robindotnet.wordpress.com/2013/02/24/windows-8-and-clickonce-the-definitive-answer-2/ . have verified certificate installed on client machine correctly. have verified exe signed after build well. i have taken same approach setting explicit trusts stackoverflow answer: https://stackoverflow.com/a/16816341/97879 i presently deploying network share, , expected path updates until we're prepared take application production. my application can see there update available, fails when trying update. happens same way on both windows 7 , 8 machines. what missing?

sudo - Linux: Running a specific command as root -

i need run command "some_user" without being asked password, type: $ sudo visudo adding line does work: some_user all=nopasswd: but adding line (with specific command "whitelisted") not work: some_user all=nopasswd: /etc/init.d/"some_service start" $ sudo /etc/init.d/"some_service start" ...will still ask password. doing wrong? edit: corrected (but still asks password) some_user all=nopasswd: /etc/init.d/"some_service start" $ sudo /etc/init.d/some_service start the problem quotes, both on command line , in sudoers file. quotes make sudo , shell think there should file in /etc/init.d named " some_service start ", rather seeing start argument /etc/init.d/some_service .

vba - Excel userform deleting entire row not just intended selction -

Image
i have userform has drop down box in person can select record have deleted off list. the code below deleting entire row. not want that. want cells between a:e cleared on spreadsheet. i not sure how else describe apologize in advance. here code: private sub checkbox1_click() end sub private sub commandbutton1_click() dim lrw long activeworkbook.sheets("rawdata").visible = xlsheetvisible 'get row number. add 2 because listindex starts @ 1 lrw = me.combobox1.listindex + 2 activeworkbook.sheets("rawdata").select cells(lrw, 1).entirerow.clearcontents activeworkbook.sheets("rawdata").visible = xlsheethidden end sub private sub commandbutton2_click() combobox1.value = "" combobox1.clear combobox1.clear unload me end sub private sub userform_initialize() 'assumes data starts in a1 , has header row me.combobox1.list = activeworkbook.sheets("rawdata").cells(1, 2).currentregion.offset(1, 2).value end sub

Wordpress WooCommerce admin-custom-order-fields -

Image
i install admin-custom-order-fields after enabling, add 3 fields admin area. not showing on frontend checkout page. i read documentation, , set attributes suggest.but no luck. can please guide me right path. i'm using http://cardinal.swiftideas.com/documentation/changelog/?tb_iframe=true&width=1024&height=800 if make change. you can start disableing other plugins , clear caches have. second can check debug.log file wp-content. tell me if still have proablem.

javascript - Algorithm for consecutive n-head -

i have tackle statistics problem current project: given series of coin flips, calculate percentage of consecutive n-heads runs. data bellow, 1 head , 0 tail. found this reference probability of n-heads , have no clue of how apply deride algorithm (javascript prefered). appreciate hints. thanks! flips = [1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0. 0]; edit: the coin not fair coin next outcome of flip based on history. example, don't see 3-tails run (3 zeroes in row) in history chance of next outcome 0%. so, interpretation of percentage of consecutive n-heads runs probability of outcome of next flip. :)

Oracle NOT BETWEEN for string comparison does not give same result as <= and >= -

using oracle 11gr2 expression edition. data looks following ordertype --------- zoco zosa zost we trying find out records column not between range of values. if run query <= , >= operators: select * table ordertype <= 'zaaa' or ordertype >= 'zzzz'; 0 results. this right answer. however, if use not between: select * table ordertype not between 'zaaa' , 'zzzz'; , gives multiple hits. my understanding both syntax should give same result not. missing? reason want use not between because lot of our existing code has syntax , not want change without understanding reasons. thank you. thanks posted. ran queries again , after fixing "or" in first query, results same. still have question of why oracle character sorting not recognizing expected, question difference between not between , <> false alarm. apologize confusion. select * table ordertype <= 'zaaa' , ordertype >= 'zzzz'; no

ios - Modify app name in default splash screen -

by default xcode create default splash screen app name on it. default splash screen looks enough application. except need change app name displayed there. fro can change app name displayed on default splash screen? go launchscreen.xib under project files, click on file, interface editor should load, click on app name label, change text want or other attributes screen.

java - sql - way to only update 1 (the first the query finds) value when i got 2 or more with the same value? -

i have code in java replace minimum score in highscore table if got more 2 or more same score , minimum score in table replace of them, wanna replace 1 of them (anyone of them). preparedstatement preparedstatement = conn.preparestatement("update highscore set name = ?, score = ?, time = ?, level = ? score = (select top 1 score highscore order score > asc)"); preparedstatement.setstring(1, name); preparedstatement.setint(2, score); preparedstatement.setint(3, time); preparedstatement.setstring(4, level); int updatecount = preparedstatement.executeupdate(); hey woundering if there way update 1 (the first query finds) value when got 2 or more same value. this not seem question related java rather 1 related database design. colloquially, every row in table must uniquely identifiable (according relational model theory); called data integrity. easiest way achieve add attribute serving primary key in table. com

node.js - Heroku and Nodejs: How to server static files(css and js over) https connection? -

when run app locally(on localhost) goes expected, when create git , publish heroku , access browser see html file , css , js not loaded. console says: that html loaded on https , requesed static files 'insecure script' , blocked! which means cannot serve static files on https. supposing have pretty basic node , epxress setup wrong, or should change?

java - How do i get the image from my jlable to auto scale or resize to the size of the JLabel -

this question has answer here: java: jpanel background not scaling 2 answers im trying add image jlabel , have encountered problem image big jlabel i'm looking way make image automatically scale size of jlabel. here main body of code call guimain class: public class main { public static void main(string[] args) { int = 0; int t = 0; int st = 0; int h = 0; texts textobject = new texts(); textobject.textlist(); commands commandobject = new commands(); commandobject.commands(); guimain guiobject = new guimain(); guiobject.displaygui(); } } and here code guimain class, include 1 image button because there allot of objects in code. import java.awt.eventqueue; import java.awt.graphics; import java.awt.image; import java.awt.image.bufferedimage; import javax.swing.im

spring - java.lang.NoClassDefFoundError: org/springframework/web/context/ContextCleanupListener issue -

i error severe: exception sending context destroyed event listener instance of class org.springframework.web.context.contextloaderlistener java.lang.noclassdeffounderror: org/springframework/web/context/contextcleanuplistener @ org.springframework.web.context.contextloaderlistener.contextdestroyed(contextloaderlistener.java:80) @ org.apache.catalina.core.standardcontext.listenerstop(standardcontext.java:5035) @ org.apache.catalina.core.standardcontext.stopinternal(standardcontext.java:5687) @ org.apache.catalina.util.lifecyclebase.stop(lifecyclebase.java:232) @ org.apache.catalina.core.containerbase.removechild(containerbase.java:1028) @ org.apache.catalina.startup.hostconfig.undeploy(hostconfig.java:1498) @ org.apache.catalina.startup.hostconfig.checkresources(hostconfig.java:1425) @ org.apache.catalina.startup.hostconfig.check(hostconfig.java:1646) @ org.apache.catalina.startup.hostconfig.lifecycleevent(hos

r - Getting a 2x2 facet_grid with varying scales -

Image
i have data in nice format ideally plot on 2x2 frame, each individual plot having it's own x , y scales. here's code using of now: p <- ggplot(data=temp,aes(x=variable,y=value,group=custno,color=cluster)) + geom_path(alpha=0.4) + theme_bw() + theme(legend.title=element_blank(),axis.text.y=element_text(hjust=0, angle=0), axis.text.x = element_text(hjust=1, angle=45),plot.title=element_text(size=20)) + ylab('revenue') + xlab('') + ggtitle('') + scale_color_manual(values=c('#66c2a5','#fc8d62','#8da0cb','#e78ac3')) + facet_grid(.~cluster,scales='free',space='free') p here's plot get: i want have 2x2 grid separate scales, category 3 little more glorified , differences more pronounced. here's sample data custno variable value cluster 100 month1 169.15 3 250 month1 4012.15 1 303 month1 2731.08 1 312 month1 890.40 2

python - Usage of unary operators applied to ternary operator arguments (eg *operator argument applied to string) -

here's doing: def func(a,b=1,*args): print('a:',a,'b:',b,'args:',*args if args else 'no args') func(1,2) here's expected: #a:1 b: 2 args: no args here's got: #a:1 b: 2 args: n o r g s the * operator unpacking 'no args' string. here's should have been doing: #produces expected result: def func(a,b=1,*args): print('a:',a,'b:',b,'args:',*args if args else ['no args']) so * operator gets applied entire ternary statement. not seem happen - operator: def func(a,b=1,*args): print('a:',a,'b:',b,'negative args[0]:', -args[0] if args else 1000000) func(1,2) #expected result: #a:1 b: 2 negative args[0]: -1000000 #actual result: #a:1 b: 2 negative args[0]: 1000000 the negative - operator not apply entire ternary statement, whereas * operator does. why? special * operator? you found right way write code in your own answer : def func

java - Array index out of bounds - 2d to 1d -

i working algs4 8-puzzle program presented princeton. getting array index out of bounds exception in second loop. see issue throwing exception? board class + relevant method looks this: public class board { private final int[][] blocks; private final int n; // construct board n-by-n array of blocks // (where blocks[i][j] = block in row i, column j) public board(int[][] blocks){ n = blocks.length; this.blocks = new int[n][]; (int i=0; i<n; i++){ this.blocks[i] = arrays.copyof(blocks[i], n); } } // board dimension n public int dimension(){ return this.n; } //is board solvable? public boolean issolvable(){ int inversions = 0; list<integer> convert = new arraylist<>(); // convert 2d 1d (int = 0; < blocks.length; i++){ (int j = 0; j < blocks[i].length; j++){ convert.add(blocks[i][j]); } } (int = 0; < blocks.length; i++){ //counts nu

How can I do pagination when downloading facebook posts via javascript and FB.api? -

i trying download facebook wall posts via javascript sdk. managed call first 25 posts, trouble when trying paging.next , feed new call using loop, , iterate on until no more pages available. the code produces same page 10 times not understand. should give next page , next page , next page..? fb.login(function(response){ // first call calls pagename/feed fb.api(request, function (response) { // prints log , declares x next page console.log(response.paging.next); var x = response.paging.next; // loop preferably should continue until no more pages // deal later (i = 0; < 10; i++) { // calls x gives me rhe next page // reason code not manage change // x , new call fb.api(x, function (res){ console.log(i); console.log(res.paging.next); // here respecify x

javascript - How to determine whether floated element has wrapped -

i have 4 divs. of them float:left; example, can be: [div id=1][div id=2][div id=3][div id=4] or [div id=1][div id=2][div id=3] [div id=4] in second case last div put next line there no space in parent. how can check if div id=4 next line. pure js or jquery. please, help. there no easy way, have check position. comparing bottom value of element top value of element b safest method because errors can occur , top value isn't alway same. this code check if div 4 in other line div 1 : var = $('#1'), b = $('#4'); var posa = a.offset().top + a.height(), posb = b.offset().top; if(posb > posa){ //div 4 in other line. }

driver - powershell pass .inf files to pnputil -

i trying recursively search directory, find .inf files within , pass files pnputil add drivers windows drivers directory. i have following: cd /drivers $x = ls -path . -filter "*.inf" -recurse -erroraction silentlycontinue foreach ($i in $x){ pnputil /a $i } and following error pnputil: adding driver package failed : invalid inf passed parameter. i assuming it's failing because pnputil doesn't object it's getting. suggestion pass it, or modify? thank you! you knew issue was. passing object command line. need extract full path system.io.fileinfo object pass pnputil foreach ($i in $x){ & pnputil /a $i.fullname } that should results looking for. thing have done change $x array of file names. -expandproperty being important part. $x = ls -path . -filter "*.inf" -recurse -erroraction silentlycontinue | select-object -expandproperty fullname foreach ($i in $x){ pnputil /a $i }

c# - Prevent page reload when setting session variable -

i have asp button, , on click event session variable set , page redirected. problem process requires 2 clicks - once set session , redirect. how can set session , redirect in 1 click? code follows: protected void btn_login_click(object sender, eventargs e) { httpcontext.current.rewritepath("anotherpage.aspx"); session.add("user-id", _id); } protected void btn_login_click(object sender, eventargs e) { session.add("user-id", _id); response.redirect("anotherpage.aspx"); }

multithreading - How to prevent the threading module from slowing down your programs performance in Python? -

when click button on tkinter, python program, button freeze , wouldn't able else on program. actual command button still work, functionality of entire program went away. combat issue, implemented threading, in turn fixed problem. after implemented threading, performance of program slowed way down. does know causes this? , how can fix it? edit----------------------------------------edit this tried when using multiprocessing module opposed threading module. from multiprocessing import process def initplaylist(self): #code here def playplaylist(self): p = process(target = initplaylist) p.start() p.join() it's hard without seeing code, reason performance hit global interpreter lock , or gil. python interpreter isn't thread-safe, uses gil protect bugs , crashes caused concurrency issues. lock allows single thread execute python instructions time, means don't true parallelism across cpu cores way can in other, gil-less languages. effectively, 1 t

html - Web content such as Images not showing up in Google App Engine Proxy? -

i making proxy google app engine (gae) , running problem. have added app.yaml ; application: appname version: secureable runtime: python27 api_version: 1 threadsafe: true handlers: - url: /robots\.txt static_files: static/robots.txt upload: static/robots\.txt - url: /(.*\.(gif|png|jpg|ico|js|css|swf|php)) static_files: \1 upload: (.*\.(gif|png|jpg|ico|js|css|swf|php)) - url: /images\.ico static_files: images/db_favicon.ico upload: images/db_favicon\.ico - url: /static static_dir: static secure: optional - url: /.* script: mirror.app secure: optional as can see has of general stuff, have added; - url: /(.*\.(gif|png|jpg|ico|js|css|swf|php)) static_files: \1 upload: (.*\.(gif|png|jpg|ico|js|css|swf|php)) which has made of webpage images disappear of formatting/css. well, returns html , it. error has occured when added want swf files , other things work (like gif's , other stuff). - thanks here advice. delete regex stuff:

javascript - xsl expand and collapse after "N" child elements -

i have xml can has variable number of child elements. need way add expand / collapse feature when there more "n" number of child elements. example xml <?xml version="1.0"?> <testxml> <n>test</n> <ntlist> <nt> <nt1>nt1 test 1</nt1> <nt2>nt2 test 1</nt2> </nt> <nt> <nt1>nt1 test 2</nt1> <nt2>nt2 test 2</nt2> </nt> <nt> <nt1>nt1 test 3</nt1> <nt2>nt2 test 3</nt2> </nt> </ntlist> </testxml> so in example add expand / collapse if there more 2 "nt" inside "ntlist". think this close can't find way determine when add expand / collapse after "n" records has been reached. basic html output: n : test ntlist nt (1) nt1 : nt1 test 1

r - Shiny Error: arguments imply differing number of rows -

i'm trying develop simple app fetches local classified ads kijiji website. have made similar app pretty same exact script i'm not getting error described below don't know has gone wrong script. tried think of, couldn't work. the structure of df dataframe in server.r follows: (note have truncated values make more readable) 'data.frame': 38 obs. of 7 variables: $ title : chr "baby-boy 3-6 month" ... $ price : num 0 6.92 8 10 10 15 15 15 20 20 ... $ short.description: chr "give free ..." $ address : chr "calgary, ab t2z 0v6" "341 ..." $ date : date, format: "2014-12-05" "2014-10-28" "2014-12-05" ... $ full.description : chr "give free ..." $ link : chr "http://www.kijiji...." and can replicated follows:(a sample 5 records demonstration purposes) df <- data.frame( title= c("baby-boy 3-6

Subactor (worker) still works after Main actor Timeout in Java Akka -

i have implemented application in akka framework using java. have main actor calls sub-actor using 'ask' method , timeout after 60 seconds, worker calls java class method once receives message main actor. now problem though main actor timed-out after 60 seconds still worker able talk java class method , in-turn method performing operations not required main actor cannot receive response though sub-actor returns due timeout. is there anyway can kill worker or stop further processing if main actor timeout? checked methods recievetimeout() , context.stop() , poisonpill still no use. appreciate support code below public class mainactor extends untypedactor { actorref subactorref; final timeout timeout = new timeout(duration.create(60, timeunit.seconds)); @override public void prestart() { subactorref = getcontext().actorof( springextprovider.get(actorsystem).props( "subactor"), "subactor");

java - null not allowed for column in join table with one entity extending another -

i have situation have entity vcenterdistributedvirtualportgroup extends vcenternetwork , both entities in onetomany relationship inside entity vcenterfolder. i'm getting following error: caused by: org.h2.jdbc.jdbcsqlexception: null not allowed column "network_type"; sql statement: insert folder_network (folder_type, folder_val, distributedvirtualportgroups_type, distributedvirtualportgroups_val) values (?, ?, ?, ?) [23502-182] vcenternetwork: @entity @embeddable @table(name="network") @discriminatorcolumn(name="discriminator") @discriminatorvalue("network") public class vcenternetwork { @transient private network network; @transient private static map<mor, vcenternetwork> networkmap = new treemap<mor, vcenternetwork>(); @embeddedid private mor id; public mor getid() {return this.id;} public void setid(mor id) {this.id = id;} ... } vcenterdistributedvirtualportgroup: @entity @tab

ios - Autolayout Dumbness (Mine)? -

i'm using auto layout in 1 of projects , having trouble thought should trivial task. as example, have 2 text boxes below each other. have created vertical spacing constraint between two, of 5 points. i expect if move top text box (using setframe), constraint mean bottom 1 automatically move enforce constraint? is thinking correct? or using auto layout in way not meant to. ie. have misunderstood purpose. or should moving top text box using different manner other setframe? any input great. in advance :-) ps. have played around using: settranslatesautoresizingmaskintoconstraints seems work. however, doesn't seem proper way this. initial thoughts auto layout supposed handle size/position relationships little code, in case, expect handled 0 code. you can't use setframe that. auto-layout decides frame. if change after fact constraints aren't automatically updated. you reference constraint decides y position (either when create programmatically or usin

c++ - How to add Botan library to VS 2013 project -

as result of installing botan library i've got these files: botan.dll botan.exp botan.lib and headers path include/botan/*.h, 1 of them botan.h must incuded in i've added botan.lib , botan.h following this example "botan/botan.h: no such file or directory" error while building project. #include <botan/botan.h> int main() { botan::libraryinitializer init; } if include #include "c:/include/botan/botan.h" it's okay botan.h can't rewrite headers using full path. e.g. botan.h file looks like: #include <botan/init.h> #include <botan/lookup.h> ... #include <botan/rng.h> ... so can't figure out how include these files properly.

wordpress - Limit category depth to parent level -

there's couple of problems need solved here. 1) can't seem list parent categories. 2) there way can show number of trashed posts next echo $live_posts <ul> <?php $categories = get_categories(); foreach ($categories $cat) { $posts = new wp_query( array( 'depth' => 1, 'post_status' => array('publish'), 'cat' => $cat->cat_id)); $live_posts = $posts->post_count; ?> <li> <a href="#"><?php echo $cat->cat_name; ?> (<?php echo $live_posts; ?>)</a> </li> <?php } ?> </ul> regarding first problem, thought 'depth' => 1 supposed limit parents, reasons unknown it's not working. unless i'm missing obvious? thanks in advance! $args = array( 'taxonomy' => 'category', 'orderby' => 'name', 'order' => 'asc', 'p

c - Infinite loop in iterative preorder traversal of BST -

i trying iteratively traverse bst in preorder, function getting stuck in infinite loop while printing. please tell me why happening? 1 typedef struct node_{ 2 int data; 3 struct node_* left; 4 struct node_* right; 5 }bst; 22 void preorder(bst* tree){ 23 if(tree==null){ 24 return; 25 } 26 // create stack 27 stack* stack=create_stack(); 28 // push data onto stack 29 push(stack,tree->data); 30 while(isempty(stack)==0){ 31 struct node_ *node; 32 node->data=top(stack); 33 printf("%d ",node->data); 34 // pop value off stack 35 pop(stack); 36 if(node->right!=null){ 37 //push right child onto stack 38 push(stack,node->right->data); 39 } 40 if(node->left!=null){ 41 // push left child onto stack 42 push(stack,node->left->data); 43 } 44 } 45 } your loop never ends because n

Couchdb installation not working on Mac OSX -

i trying couchdb on mac osx machine per following guide link. http://guide.couchdb.org/draft/mac.html i received following errors onscreen. 192-168-182-129:~ andywong$ brew install couchdb warning: seem have osx-gcc-installer installed. homebrew doesn't support osx-gcc-installer. causes many builds fail , unlicensed distribution of old xcode files. please install clt or xcode 5.1.1. ==> downloading https://downloads.sf.net/project/machomebrew/bottles/couchdb-1.6 downloaded: /library/caches/homebrew/couchdb-1.6.1_1.mountain_lion.bottle.tar.gz ==> pouring couchdb-1.6.1_1.mountain_lion.bottle.tar.gz ==> caveats test couchdb run: curl http://127.0.0.1:5984/ reply should like: {"couchdb":"welcome","uuid":"....","version":"1.6.1","vendor":{"version":"1.6.1- 1","name":"homebrew"}} have launchd start couchdb @ login: ln -sfv /usr/local/opt/couchd

Obtain WebApplicationContext in Spring 3.1 Junit test -

due custom framework dependencies, cannot upgrade spring 3.2+. i'm stuck on 3.1.x. trying obtain webapplicationcontext in spring junit test so: @runwith(springjunit4classrunner.class) @contextconfiguration(locations = "file:src/main/webapp/web-inf/spring/context.xml") public class webintegrationtest { @autowired private webapplicationcontext ctx; this, expected, not load webapplicationcontext. i realize in spring 3.2 or later use @webappconfiguration tell spring want web context provided, how can achieve dependency constraints? i stuck on 3.1, @ least until can enough testing around code upgrade - can't test enough until can working webapplicationcontext... it isn't hard construct webapplicationcontext, whole morning of trial , error. so, test like @runwith(springjunit4classrunner.class) @contextconfiguration(loader = myloader.class, locations = { "file:web-inf/springcontexts/spring-security-common.xml",

Custom Android keyboard with Material Design Style -

i have updated app implement material design. make app backwards compatible, changed appbasetheme "theme.holo.light.darkactionbar" "theme.appcompat.light.darkactionbar". however, have custom keyboard keeps popping in old holo theme. i think have use style called "widget.material.light.keyboardview", message: error: resource not public when try use in theme attribute of keyboardview. want keyboard similar new lollipop keyboard. can me? i somehow missed answer, should cover you're trying do. setting flat color keys or background give material look, depending on color palette choose. how change background color of key android soft keyboard?

sql-server to mysql translation -

i'm trying recreate in mysql created in ms sql. i'm having heck of time getting syntax right. know equivalent mysql query following: create table #tmp (id int, ran varchar(10), result int, ref_id int) insert #tmp values (1, 'object1', 4.0, 1) insert #tmp values (2, 'object2', 100, 1) insert #tmp values (3, 'object1', 6.0, 2) insert #tmp values (4, 'object3', 89.0, 2) select * #tmp select t.ref_id ,tk = max(case when t.ran ='object1' t.[result] end) ,crp= max(case when t.ran ='object2' t.[result] end) ,hpt= max(case when t.ran = 'object3' t.[result] end) #tmp t group t.ref_id thank taking look! this doesn't seem difficult: create temporary table tmp ( id int, ran varchar(10), result int, ref_id int ); insert tmp(id, ran, result, ref_id) values (1, 'object1', 4.0, 1); insert tmp(id, ran, result, ref_id) values (2, 'object2', 100,

Foxpro form "stopping" work after report call -

i have form call report, form contant btnprint in "print" button click, call report btnprint.click report form rpthocbong preview after button clicked, button "print" "flat-down" , cannot click again have tried adding after report form call? this.enabled = .t.

python - Trouble starting a Mezzanine/Cartridge project on an Ubuntu VPS -

Image
i keep getting same traceback error when trying start new mezzanine project cartridge on ubuntu vps: it looks mezzanine cannot find cartridge, not sure how fix it. looks permission issue me. not have write privilege on '/projects/mezzanine/jess_site' you can either work root user, not suggest or use '~/projects/mezzanine/jess_site' rather '/projects/mezzanine/jess_site'. as might know, ~ refers home directory have read/write permission.

Python 2.7.8 How to restart the game code -

i looking on how restart code without restarting game. want able have game restart on on. print 'welcome game of nim: ' player=1 state=21 print 'the number of objects ',state while true: print 'player ',player while true: move=input('what move? ') if move in [1,2,3] , move<state: break print 'illegal move.' state=state-move print 'the number of objects ',state if state==1: print 'player ',player,' wins!' break if player==1: player=2 else: player=1 print 'game over.' you can put code in function, , call function in while loop: from sys import exit #to exit if user not want try again print 'welcome game of nim: ' def game(): player=1 state=21 print 'the number of objects ',state while true: print 'player ',player while true: move=input

R Create a Spatial Bubble Plot That Overlays A basemap of the US and other spatial layers as needed -

Image
i'm trying produce nice bubble plot overlaid on top of basemap of (i import shapefile if preferred i've been using r basemaps. library(ggplot2,sp,raster,maps,mapdata,maptools,ggmap,rgeos) mydata = data.frame(name=c("florida","colorado","california","harvard","yellowstone"), lat=c(28.1,39,37,42,44.6), long=c(-81.6,-105.5,-120,-71,-110), pop=c(280,156,128,118,202)) using code below, adapted stack overflow post ( create bubble plot in r using satellite map ), able overlay bubble plot on map of us. renders slowly, extent tight, bounded in box, i'm not able add other layers plot can tell, , base map thick , not visually clean. xy <- mydata[,c("long", "lat")] nl <- getdata('gadm', country="usa", level=1) #raster data, format spatialpolygonsdataframe nl <- gsimplify(nl, tol=0.01, topologypreserve=true) # coercing polygon outlin

statistics - Anova test for GLM in python -

i trying f-statistic , p-value each of covariates in glm. in python using stats mode.formula.api conduct glm. formula = 'propno_pred ~ geography + log10bmi + cat_opcavity + catles_neles + catrural_urban + \ catpred_control + catnative_intro + midpoint_of_study' mod1 = smf.glm(formula=formula, data=a2, family=sm.families.binomial()).fit() mod1.summary() after trying anova test model using anova in statsmodels.stats table1 = anova_lm(mod3) print table1 however getting error saying: 'glmresults' object has no attribute 'ssr' looks anova_lm function applies linear model there module in python anova test glms? there isn't, unfortunately. however, can roll own using model's hypothesis testing methods on each of terms. in fact, of anova methods not use attribute ssr (which model's sum of squared residuals, undefined binomial glm). modify code glm anova.

math - Are these test cases correct? -

while working on google foobar problems, ran 1 following prompt: professor boolean, notorious mad scientist, found out precious rabbit specimen has escaped! rushes call security minions on lab phone. however, rabbit escapee hacked phone speed escape! left sign following clues: each digit dialed has number can reached knight chess piece last digit dialed - is, must move precisely 2 spaces in 1 direction, , 1 space in perpendicular direction dial next correct number. can dial number want start with, subsequent numbers must obey knight's move rule. the lab phone has numbers arranged in following way: 1, 2, 3 in first row; 4, 5, 6 in second row; 7, 8, 9 in third row; , blank, 0, blank in fourth row. 1 2 3 4 5 6 7 8 9 0 for example, if dialed 1, next number dial has either 6 or 8. if dialed 6, next number must 1 or 7. professor boolean wants find out how many different phone numbers can dial under these conditions. write function called answer(x, y, z) computes number o

How do i get this kind of time format when "now" in javascript? -

i have need put kind of format when doing action: 2014-11-19t10:07:25.000z like when in press of action button, need alert current time in format above, in javascript, plain , simple... what correct way so? this returned format of toisostring method of date instance. new date().toisostring(); //"2014-12-06t08:10:55.713z" more on date , time iso, see mdn , wikipedia .

plot - Plotting time and date in different axis in R -

Image
i have data looks head(data1,10) id time type value1 value2 value3 1 1612 7/1/2014 10:15 activity none 2 76308 7/1/2014 10:17 battery discharging 3 1613 7/1/2014 10:17 activity none 4 1614 7/1/2014 10:17 activity none 5 1615 7/1/2014 10:17 activity none 6 1616 7/1/2014 10:17 activity none 7 1617 7/1/2014 10:17 activity none 8 325200 7/1/2014 10:17 wifi linksys 00:1a:70:5b:8f:21 -86 9 1618 7/1/2014 10:19 activity none 10 1619 7/1/2014 10:19 activity none the complete data can download in this link format data csv size around 1.6 mb. data has 5 important columns (time, type, value1, value2, value3). type contain : activity means use

sql - categories for each data in database by a specific id and only allow get 2 for each categories mysql -

possible duplicated mysql query: select top 3 rows table each category . i'm not clear answer why asked again. this database +-------+----------+-------------+ | id | app_id | content | +-------+----------+-------------+ | 1 | 19 | hello peer | +-------+----------+-------------+ | 2 | 20 | hello peer | +-------+----------+-------------+ | 3 | 19 | hello peer | +-------+----------+-------------+ | 4 | 19 | hello peer | +-------+----------+-------------+ | 5 | 21 | hello peer | +-------+----------+-------------+ | 6 | 20 | hello peer | +-------+----------+-------------+ | 7 | 19 | hello peer | +-------+----------+-------------+ | 8 | 20 | hello peer | +-------+----------+-------------+ | 9 | 21 | hello peer | +-------+----------+-------------+ now how can select record categories app_id , limit 2 each categories , order appid desc if statement above not clear.here e