Posts

ios - Clear modal views from memory -

i'm having problem storyboard has beside navigation controller modal views separate them main "route" in app. when press button modal segue opens other view. the problem is: when go navigation controller , press button open modal view again, creates new instance of view controller without deleting old one. is possible clean memory when leaving modal view or something? i found solution: when finished separated modal view part, use [[self presentingviewcontroller] dismissviewcontrolleranimated:yes completion:nil]; , app goes last view controller, in case uinavigationcontroller. , this, deallocates old views.

java - Can you list interface methods in the service registry OSGI -

i have osgi bundles provide services , require services . if have service implements interface , interface provides variety of methods can have reference these methods in service registry or somewhere other bundles can aware of these methods. if service implements interface method on interface implemented service, definition in java. other bundle knows service (and interface) aware of these methods. if want advertise bundles not know interface, register properties. however, definition accessing methods require reflection. in general not way go in java, nicer stay type safe , use interface anchor.

authentication - Security model: log in to third-party site with user's credentials -

Image
i develop service (service) automates actions users can on third-party site (3rd party site). my service provides following functionality users: the user registers @ service the user provides his/her 3rd party site username/password service the service uses credentials log in 3rd party site on user's behalf the service stores cookie issued 3rd party site in database from on, service starts log in 3rd party site regularly (cron) on user's behalf using stored cookie (the username/password 3rd party site not saved anywhere) , performs actions on users behalf on 3rd party site notes: before registering on service, user presented full information describing interaction between service , 3rd party site there value in automating user's login 3rd party site , users interested in automating logins , actions on 3rd party site, i.e. interested in service doing work them @ 3rd party site there no oauth functionality on 3rd party site there no user authenticat...

objective c - Segue causes breakpoint when clicking the cell to Detail view -

the cell in collection view causes breakpoint when clicked show larger image in detail view. cells display images should detail view isn't displaying image. if need more info form part, let me know. clues provided are. (lldb) { @autoreleasepool { return uiapplicationmain(argc, argv, nil, nsstringfromclass([appdelegate class])); [breakpoint] } } code generates cell information , passes through segue. - (uicollectionviewcell *)collectionview:(uicollectionview *)cv cellforitematindexpath:(nsindexpath *)indexpath; { // code custom cell created: cell *cell = [cv dequeuereusablecellwithreuseidentifier:kcellid_biffy forindexpath:indexpath]; // load im...

php - How to pass an array of string using ajax? -

i'm using ajax pass array of strings page. this array on nomes.php [ 'home','a empresa','funcionarios','quem somos?','historia','inicio',] this code, alert doesn't work - can help? $.ajax({ type: 'post', url: 'nomes.php', beforesend: function(x) { if(x && x.overridemimetype) { x.overridemimetype("application/j-son;charset=utf-8"); } }, datatype: "json", success: function(data){ v=data; alert(v); } }); you need encode php-array json-array. <?php echo (json_encode($myphparray)); ?>

vba - Putting all elements of an array variable onto their own line in a message box -

Image
the code below fragment of macro i'm writing alert users may not have sufficient number of compatible installation equipment on order. n shortfalls (i.e., each instance of equipment item not having compatible installation equipment saved in yankees() array in elements 1 n. want prompt users message box stating "please review order ensure have sufficient compatible installation equipment- detected following shortfalls" and below that include each element of yankees(1 n) on separate lines in message box 2 options below "this okay, i'll submit order now" , "let me go back,i want modify order". how can create such message box? i have: msgbox "please review order ensure have sufficient compatible installation equipment- detected following concerns" & yankee(1), vbokcancel currently includes first shortfall. how can include elements of yankee() , put them on own line? this question boils down to: "how put non-bl...

database - Slick lifted update on an Object -

i updates on lifted entities using slick. code updates firstname of contact object: def updatecontact(id: int, firstname: option[string]): unit = { val q1 = { c <- contacts if c.id id } yield c.firstname // update value same or new value q1.update(firstname.getorelse(q1.list().head)) } the option here useful updating value in case (although nicer if update happened if there new value). what looking way query object id, updates in memory using getorelse , update on whole object. else have run above each field of object works know, feels dirty hack. instead of q1.update(firstname.getorelse(q1.list().head)) can write firstname.foreach{ fn => q1.update(fn) } shorter, simpler, 1 instead of 2 queries :). using foreach on option stops looking weird when think of collection 1 or 0 elements. regarding idea fetch whole object, modify , save back, can this: def updatecontact(id: int, firstname: option[string], lastname:option[string], ...): unit ...