Posts

Swift UICollectionView at starting -

in swift trying view like that . when user tap on + button image add view , view height increase dynamically , if user tap on image delete view , other elements rearrange position. try uicollectionview. in initial position there plus button , tapping on image pick image gallery. can 1 please suggest me how can it?

java - String.replaceAll does not apply to any kind of characters -

this question has answer here: string.replaceall() not working 6 answers so i've got simple method should remove characters except upper , lowercase letters , numbers string. public static string tosimple(string arg) //redurziert einen string auf buchstaben und ganze zahlen { string string = arg; int = 0; while ( < string.length()) { if (((int)string.charat(i) >= 48 && (int)string.charat(i) <= 57)||((int)string.charat(i) >= 65 && (int)string.charat(i) <= 90)||((int)string.charat(i) >= 97 && (int)string.charat(i) <= 121)) i+=1; else { int = string.length(); string = string.replaceall(""+string.charat(i), ""); if (!(string.length() < a)) //just in case { i+=1; } ...

xcode - NSImages to PDFs and merge them in Swift -

i have array nsimages in it. want convert nsimage pdf. so, can show me how in swift. if possible, guys show me how merge pdfs 1 , output well? thank much. here rough steps create pdf document images, should started. use pdfkit (import quartz) framework. // create empty pdf document let pdfdocument = pdfdocument() // load or create nsimage let image = nsimage(....) // create pdf page instance image let pdfpage = pdfpage(image: image!) // insert pdf page document pdfdocument.insert(pdfpage!, at: 0) // raw data of pdf document let data = pdfdocument.datarepresentation() // url save data let url = url(fileurlwithpath: "/path/to/your/pdf") // save data url try! data!.write(to: url) you may need tinker page's bounds , image size's exact pdf page sizes need. you can use other pdfdocument / pdfpage api insert, remove , reorder pages.

issues about json format returned by spring restful? -

class entitydataset { public list<entityrow> getdata() { return rowlist; } class entityrow { private map<string, object> rowdata; public map<string, object> getrowdata() { return rowdata; } } i wrote method in restful controller below. @requestmapping(value = "/entitydata", method = requestmethod.post, headers = "accept=application/json") public entitydataset getentitydata(@requestbody queryobject query) throws exception{ return entitymanager.generateentitydatabyname(query); } the returned json looked below. { "data": [ { "rowdata": { "fiscal_year_end": null, "home_country": null } }, { "rowdata": { "fiscal_year_end": null, "home_country": "10" } }, ..........

angularjs - How can I set data to field with CKEditor in Protractor test? -

my issue got message, "element not visible" in protractor when tried set data field ckeditor. application working angularjs. element(by.model("question.translations[lang.locale].answer")).sendkeys("test answer e2e!!!"); how can set (or get) data field ckeditor in protractor test? html code: <div ng-repeat="lang in languages"> <div class="col-md-4"> <div class="input-icon right"> <div ckeditor="ckoptions" ng-model="question.translations[lang.locale].answer"></div> </div> </div> </div> when try this var value = 'hello'; browser.executescript(function (arguments) { window.ckeditor.instances.html_editor.setdata(arguments[0]); }, value); i error: failed: unknown error: cannot read property 'setdata' of undefined i found solution browser.switchto().frame(element(by.c...

sql server - How do i assign 2 values from different tables into 1 variable name as foreign key using Entity Framework-Code First -

i'm confused foreign key concept. i'm trying arrange key relationships in each database class according code first concept in entity framework. i have 3 tables: a, b , c. table has aid primary key(pk), table b has bid pk, table c has cid primary key. relationship between table is: a-b : many-to-one, a-c : one-to-one, b-c : one-to-many table has variable refid can hold both bid or cid values. <foreignkey("bid")> public property refid b <foreignkey("cid")> public property refid c refid highlighted red saying the properties cannot overload each other because differ return types. what doing wrong? edited public class public property aid string // primary key public property refid string <foreignkey("refid")> public property b b <foreignkey("refid")> public property c c end class public class b public property bid string // primary key //...

centos - Tomcat 8.5.6 is giving "403 Access Denied" Error in cent OS 7 -

i getting problem given $subject when trying access through external browser. have changed context.html in ../manager/meta-info/context.html. content looks follows. <context antiresourcelocking="false" privileged="true" > <valve classname="org.apache.catalina.valves.remoteaddrvalve" allow="^.*s" /> </context> in addition, have allowed port 8080 tcp in firewall. possible solution? thanks in adavance