Posts

jboss7.x - JBAS014601 Error booting the container -

when run project on eclipse appears this 21:24:52,883 infos [org.jboss.modules] jboss modules version 1.1.1.ga 21:24:53,056 info [org.jboss.msc] jboss msc version 1.0.2.ga 21:24:53,103 info [org.jboss.as] jbas015899: jboss 7.1.0.final "thunder" starting 21:24:53,442 error [org.jboss.as.controller] jbas014601: error booting container: java.lang.runtimeexception: org.jboss.as.controller.persistence.configurationpersistenceexception: jbas014676: failed parse configuration @ org.jboss.as.controller.abstractcontrollerservice$1.run(abstractcontrollerservice.java:161) [jboss-as-controller-7.1.0.final.jar:7.1.0.final] @ java.lang.thread.run(unknown source) [rt.jar:1.7.0_03] caused by: org.jboss.as.controller.persistence.configurationpersistenceexception: jbas014676: failed parse configuration @ org.jboss.as.controller.persistence.xmlconfigurationpersister.load(xmlconfigurationpersister.java:125) [jboss-as-controller-7.1.0.final.jar:7.1.0.final] @ org.jboss.as....

scala - Complexity estimation for simple recursive algorithm -

i wrote code on scala . , want estimate time , memory complexity. problem statement given positive integer n , find least number of perfect square numbers (for example, 1, 4, 9, 16, ...) sum n . for example, given n = 12 , return 3 because 12 = 4 + 4 + 4 ; given n = 13 , return 2 because 13 = 4 + 9 . my code def numsquares(n: int): int = { import java.lang.math._ def traverse(n: int, ns: int): int = { val max = ((num: int) => { val sq = sqrt(num) // perfect square! if (sq == floor(sq)) num.toint else sq.toint * sq.toint })(n) if (n == max) ns + 1 else traverse(n - max, ns + 1) } traverse(n, 0) } i use here recursion solution. imho time complexity o(n) , because need traverse on sequence of numbers using recursion. right? have missed anything?

angularjs - how to have ui-select placeholder return when ui-select is disabled -

i using ui-select dropdown select follows example demo code closely. ui-select working great. adding angular-material checkbox. intent have checkbox enable/disable dropdown select. setting ng-disabled property of ui-select element state variable use in checkbox. working fine, when uncheck box, dropdown select disabled, when check box, dropdown select enabled. i want default placeholder (when no items have been selected yet) return whenever dropdown select disabled. is, after selecting dropdown item, displayed in ui-select replacing default placeholder. when dropdown select disabled, want placeholder replace selected item. way when dropdown enabled again, starts placeholder. have tried different approached, not conversant enough angular work. if enable clear functionality, 'x' , indeed clear selection , return placeholder, need programatically checkbox callback. so how force placeholder of ui-select element togglesession click callback of checkbox element? i impress...

php - Mysql select from multiple rows in one query -

i have mysql database table (that stores settings app): table name: settings id param_name param_value -------------------------------- 1 ringtone 12.mp3 2 user nick 3 email nick@example.com 4 location athens, greece 5 phone 0123456789 6 time_offset gmt+3 the "id" column auto-incremental , gets value mysql. the column "param_name" has initial values (such as: ringtone, user ...etc) the column "param_value" takes it's values dynamically "settings" form each parameter has it's unique value. i want select these rows 1 query , turn each 1 of them variable such as: $this_ringtone = "12.mp3"; $this_user = "nick"; $this_email = "nick@example.com"; $this_location = "athens, greece"; $this_phone = "0123456789"; $this_time_offset = "gmt+3"; i can multiple queries since rows lot more, prefer single mysqli ...

objective c - iOS Rotation Gesture after animation -

first question take easy! creating simple ios app. have view contains rotating dial (a uiimageview) (rotates through rotation gesture) , uibutton when pressed uses uiview animatewithduration move button 1 of 3 locations. my issue.. rotating dial fine, moving button fine, but.. when move button, rotate dial, location of button "reset" original frame. how can stop rotation effecting location of button / movement of button. viewcontroller.h #import <uikit/uikit.h> #import <avfoundation/avfoundation.h> @interface viewcontroller : uiviewcontroller <uigesturerecognizerdelegate>{ iboutlet uiimageview *lock; iboutlet uilabel *number; iboutlet uilabel *displaynumber1; iboutlet uilabel *displaynumber2; iboutlet uilabel *displaynumber3; iboutlet uibutton *slider; avaudioplayer *theaudio; } @property (retain, nonatomic) iboutlet uiimageview *lock; @property (retain, nonatomic) iboutlet uilabel *number; @property (retain, nonatomic) iboutlet uilabel *...

haskell - Is it really a default practice to make every monad transformer an instance of MonadTrans? -

so real world haskell says: every monad transformer instance of monadtrans but i'm playing scotty , found out base monad transformer scottyt not instance of monadtrans . looking @ release notes seems deliberate design decision: here . quote: the monad parameters scottyt have been decoupled, causing type of scottyt constructor change. result, scottyt no longer monadtrans instance ... i hope understand confusion. nevertheless, try formulate strict questions: why 1 not want monad transformer instance of monadtrans ? how explain aforementioned change in scottyt design? p.s.: understand can define instance of monadtrans scottyt myself, should i? (links questions) scottyt not monad transformer. let's inline (simplified) definition: newtype scottyt' m = scottyt' { runs :: state [ (request->m response) -> request->m response ] } to define lift need, general m a action , such middlewares list, have obtain actual a ...

android - addProximityAlert is not working if Location service is disabled -

i'm using locationmanager#addproximityalert function alert user when enter range of places, if location service enabled works fine , notifications, when location disabled nothing. need receive alerts if location not enabled, here code: locationmanager = (locationmanager) getsystemservice(context.location_service); locationmanager.requestlocationupdates(locationmanager.network_provider, minimum_time_between_update, minimum_distancechange_for_update, new locationlistener()); public void preparenotifications() { // nearproductslocs array of locations (int = 0; < nearproductslocs.length; i++) { log.d(tag, "order" + + " " nearproductslocs[i]); // +++++++++++++++++++++++++++++++++++++++++++++++++ // add addproximityalerts location loc = nearproducts[i]; addproximityalert(loc.getlatitude(), loc.getlongitude()); } } private void addproximityalert(double latitude, double longtitude, int productid) { intent inten...