Posts

ios - How to protect swift code with framework or static lib? -

usually can protect source code implementation wrapping static lib or dynamic lib, or framework open header files etc. for swift, got knowing "swift not support static lib". does mean there no way protect swift source code such legacy lib way ? question here clarify , find out approach. thanks,

jboss7.x - MSC00001: Failed to start service jboss.deployment.subunit."oneflexi.ear"."LinkWEB.war" -

what's reason following error, , how can solved? 10:54:14,546 info [org.jboss.as.server.deployment] (msc service thread 1-7) jbas015876: starting deployment of "oneflexi.ear" 10:54:14,998 info [org.jboss.as.server.deployment] (msc service thread 1-3) jbas015876: starting deployment of "linkweb.war" 10:54:14,998 info [org.jboss.as.server.deployment] (msc service thread 1-1) jbas015876: starting deployment of "linkejb.jar" 10:54:15,225 error [org.jboss.msc.service.fail] (msc service thread 1-4) msc00001: failed start service jboss.deployment.subunit."oneflexi.ear"."linkweb.war".parse: org.jboss.msc.service.startexception in service jboss.deployment.subunit."oneflexi.ear"."linkweb.war".parse: failed process phase parse of subdeployment "linkweb.war" of deployment "oneflexi.ear" @ org.jboss.as.server.deployment.deploymentunitphaseservice.start(deploymentunitphaseservice.java:119) [jbo...

angularjs - issue when set parent form valid manually by setting each child form field valid -

i have nested , repeated forms on ui. <form class="form-horizontal" name="registration"> <form ng-repeat = "s in students" name="studentregisteration"> <input type="number" id="input" name="input" model="input" ng-change="validate()"> </form> </form> i trying $setvalidity() specific field of child form following $scope.validate = function (index) { if (condition true) $scope.registration.studentregisteration.input.$setvalidity('integer', false); } it works fine until have 1 form on ui i.e. set integer (property) valid , parent forms become valid. it not work when have multiple forms on ui... parent forms not become valid... not sure how set field valid individual child form parent becomes valid. any idea? i think if pass form controller in function parameter validate work. like <form class="form-horizont...

database - How to make the association in model so I can get all places of user_places's id in rails console? -

Image
i have 2 tables example: user_places ---------------- | id | place_id| ---------------- | 1 | 1 | ---------------- | 1 | 5 | ---------------- | 1 | 6 | ---------------- | 2 | 8 | and places table -------------------------------------------- | id | title | description | image_url | -------------------------------------------- | 1 | 1 | description1 | image1 | -------------------------------------------- | 2 | 5 | description2 | image2 | -------------------------------------------- | 3 | 6 | description3 | image3 | -------------------------------------------- | ...| ... | description4 | image4 | how make association in both models can places of user_places's id = 1 in rails console? you'll want foreign_keys , pertaining rails. rails way interact relational database. such, if know how correctly structure relational db, you'll able better understand rails' activerecord assoc...

validation - How to validate input in javascript for numbers -

this question has answer here: html text input allows numeric input 53 answers here trying validation html input form. here want return false if input not number. want return false if else other number supplied input. how can this? pattern number validation <form class="form-horizontal" name="product-form" method="post" action="go.php" role="form" enctype="multipart/form-data" onsubmit="return validateform();"> <div class="form-group"> <label class="control-label col-sm-2" for="product_price">product price</label> <div class="col-sm-10"> <input type="text" class="form-control" name="product_price" id="product_price" placeholder=...

regex - gunzip or decompress the file in perl and capture the file name in variable -

i have 9001_20150921113547_00041.xml.gz , want gunzip or can decompress 9001_20150921113547_00041.xml ... have many ways in perl, have use system() , qw , qx , backtick well, decompress file , stored file in path want store new decompress file name variable how can ? you can use archive::zip cpan execute job bits under control. not need fork out unzip command, , control output file name yourself. documentation on page has code examples.

audio - Setup AVAudioPlayer with swift 1.2? -

when tried setup avaudioplayer last time, used code: func setupaudioplayerwithfile(file:nsstring, type:nsstring) -> avaudioplayer { var path = nsbundle.mainbundle().pathforresource(file, oftype:type) var url = nsurl.fileurlwithpath(path!) var error: nserror? var audioplayer:avaudioplayer? audioplayer = avaudioplayer(contentsofurl: url, error: &error) return audioplayer! } var buttonbeep = avaudioplayer() buttonbeep = self.setupaudioplayerwithfile("buttonpush", type:"m4a") and worked perfectly. swift 1.2 seems can't that. i tried code: var button : avaudioplayer? in didmovetoview: if let button = self.setupaudioplayerwithfile("button", type:"m4a") { self.button = button } func setupaudioplayerwithfile(file:nsstring, type:nsstring) -> avaudioplayer? { let path = nsbundle.mainbundle().pathforresource(file string, oftype: type string) let url = nsurl.fileurlwithpath(path!)...