Posts

iphone - How can i upload Photo from imagePickerController using ASIFormDataRequest? -

iphone - How can i upload Photo from imagePickerController using ASIFormDataRequest? - i utilize delegate of uiimagepickercontroller choosing photo , set server problem don't know how can using asiformdatarequest , don't know key should utilize info parameter? - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { nsstring *str = [nsstring stringwithformat:@"http://www.siteweb.com/api/v2/businesses/%@/pics.xml",entry.permalink]; nsurl *url = [nsurl urlwithstring:str]; asiformdatarequest *request = [asiformdatarequest requestwithurl:url]; request.delegate = self; [request startasynchronous]; [self dismissmodalviewcontrolleranimated:yes]; } like this: [request addfile:(nsstring *)filepath forkey:(nsstring *)key]; get image beforehand: uiimage *image = (uiimage *) [info valueforkey:uiimagepickercontrolleroriginalimage]; [uiimagejpegrepresentation(image, 1.0) writetofi...

php - measure relevance of a search term returned matched against results -

php - measure relevance of a search term returned matched against results - is there php or mysql function check how relevant matching field is? review string , match against percentage of characters? for illustration doing basic search script pulling results how can create more relevant results appear @ top? a lot depends on info , type of searches expecting. basically, looking fuzzy search. soundex , levenshtein distance 2 of many functions can utilize string matches http://php.net/manual/en/function.levenshtein.php php mysql

iphone - Is couchDB mobile stable or good to use in ios production app? -

iphone - Is couchDB mobile stable or good to use in ios production app? - we developing social news feed ios app, , need store lot of news feed items (image,text) , chat history items (audio or text message) offline use. since couchdb document database questions are: are there ios apps (in apple store) using database (couchdb mobile)? is couchdb mobile stable plenty use? how performance in ios? i have never been fan of thought you'd have total piece of database software running on mobile device. maybe in few years when there's more capacity. instead i've been much bigger fan of using browser's pre-existing storage containers. pouchdb great illustration of how work, still in development. depending on sensitivity , amount of info have, store info in localstorage. at end of day it's question of whether requiring total queryability locally on device. ie., need have indexes beingness built on phone? or can instead work database close device p...

c# - Writing file paths into XML file with XmlWriter -

c# - Writing file paths into XML file with XmlWriter - i'm hoping can help me annoying little problem i'm having. i'm trying write file path xml settings file, nil happens. don't error messages or in time debugging windows, doesn't execute code block. the programme feature 1 setup user accounts, , select file each account. if leave file paths blank, xml file created no problems. however, if there 1 path written file never gets created. here sample of function: private void savesettings() { xmlwritersettings xml_settings = new xmlwritersettings(); xml_settings.indent = true; xml_settings.indentchars = (" "); using (xmlwriter xml_settings_file = xmlwriter.create("settings.xml", xml_settings)) { xml_settings_file.writestartelement("main_node"); xml_settings_file.writeelementstring("settinga", properties.settings.default.settinga.tostring()); ...

msbuild - TFS Build: Files being packaged for certain configurations but not others -

msbuild - TFS Build: Files being packaged for certain configurations but not others - when utilize tfs team build compile , create deployment packages each of configurations project (dev, test, uat, live) (to necessary transformed web.config each environement). in order include files outside of project deployment bundle have added next in csproj file: <content include="filestoincludefolder\**\*" /> this works 1 of configurations. ie files included in 1 of packages. the difference between configuration works , 1 doesn't name , fact have different web.config transform each. ideas why happening? in log file created msbuild configuration acts correctly has our files listed under section collectfilesfromcontent: gather files project items @(content). adding: when doesn't work aren't. seems files within @content become different different configurations. why should be, there nil in our build process or csproj file treats them different...

c# - Using generic func signature -

c# - Using generic func signature - i implement simple (testing purposes only) in memory repository below. interfaces implements generic. 1 of methods "delete" used in sample code below. the cast of predicate throws exception. how can implement deleted method correctly? public class inmemoryreportingrepository : ireportingrepository { private readonly list<idto> m_dtos; public inmemoryreportingrepository() { m_dtos = new list<idto>(); } // ommitted stuff public void delete<tentity>(expression<func<tentity, bool>> predicate) tentity : class, idto { var delete = m_dtos.firstordefault((func<idto, bool>) predicate.compile()); m_dtos.remove(delete); } } try following: public void delete<tentity>(expression<func<tentity, bool>> predicate) tentity : class, idto { var compiled = predicate.compile(); var todelete = m_dtos.firstordefault(dto =...

Calling a Class function without using $this->function_name() -- PHP -- -

Calling a Class function without using $this->function_name() -- PHP -- - so have class: class a{ public function do_a(){ homecoming 'a_done';}; public function do_b(){ homecoming 'b_done';}; } so require php file , create instance of class: require_once("a_class.php"); $system = new a(); require_once("user_calls.php"); //here import user file function calls. user_calls.php contents: echo 'this result of '.$system->do_a(); echo 'this result of '.$system->do_b(); so, work, don't want user have utilize $system->do_a(); , do_a(); . any solutions? edit: want limit functions user phone call in user_calls.php file, basic native php functions , in class a. disclaimer: while code works, , requested, doesn't mean advocate coding this. it's hard follow other developers (and maybe in future...), , makes utilize of eval() , bad thing(tm). said, here go: <?php cla...