Posts

ios - UISearchDisplayController Issue -

Image
i trying implement uisearchdisplaycontroller in existing tableview whenever try search covers view. please check below screen shot more detail idea. i using xcode 7 beta , ios9 simulator. here when start searching covers screen. i search none of solution worked me. just tried similar test project on xcode 7 without auto layout , works fine me: what view hierarchy like? perhaps top bar on view preventing search bar moving up?

php - Implement a State Pattern with Doctrine ORM -

i have class using state pattern. here's simple example /** * @enitity **/ class door { protected $id; protected $state; public function __construct($id, doorstate $state) public function setstate(doorstate $state) { $this->state = $state; } public function close() { $this->setstate($this->state->close()) } ... } interface doorstate { public function close; public function open; public function lock; public function unlock; } class dooraction implements doorstate { public function close() { throw new doorerror(); } ... } then several classes define appropriate actions in states class openeddoor extends dooraction { public function close() { return new closeddoor(); } } so have thing like $door = new door('1', new openeddoor()); doctrinedoorrepository::save($door); $door->close(); doctrinedoorrepository::save($door); how implement mapping in doctrine can persist it? i'm hung o...

php - Can't install laravelcollective/html in Laravel 5.1 -

i have problem when install laravelcollective/html in laravel 5.1 install laravelcollective/html document . first, install through composer: composer require illuminate/html message: using version ~5.0 illuminate/html ./composer.json has been updated loading composer repositories package information updating dependencies (including require-dev) but it's version 5.0 remove it. composer remove illuminate/html and install version 5.1 "require": { "laravelcollective/html": "5.1.*" } next, update composer terminal: composer update next, add new provider providers array of config/app.php: 'providers' => [ // ... collective\html\htmlserviceprovider::class, // ... ], finally, add 2 class aliases aliases array of config/app.php: 'aliases' => [ // ... 'form' => collective\html\formfacade::class, 'html' => collective\html\htmlfacade::class, // ... ...

linux - Exploring a directory using a for loop in python - does the order change? -

one of folders has json files, , i'm reading data contain classification svm. question had based on code: filename in os.listdir(os.getcwd()): if re.search('.json$',filename): try: open(filename) json_data: print filename each time pipe output, find filenames printed in same order, so: 95231464576.json 131777220274261.json 17151210249.json 122624927762214.json 159287900855286.json 155273941171682.json 5265971983.json 169635939813776.json 159429967503904.json 169114363192327.json 170797436313930.json 155963124522916.json there few text files, , python files in directory. question here is: determines order in these files printed? for loop have way of looking files? tried examining whether order based on size (max min or min max) or last modified(i had no reason these tests,i tried them since can't think of other insight). tried snippet 4 times, , order ...

ios - The network connection was lost when calling PHP API -

var submitdic = nsmutabledictionary () submitdic.setobject (loginmerged, forkey: "module" ) submitdic.setobject (kedahe-tutorapp, forkey: "wskey" ) submitdic.setobject (112211, forkey: "passwd" ) submitdic.setobject (form04, forkey: "username" ) var request : nsmutableurlrequest = nsmutableurlrequest() request.url = nsurl(string: http://kedah-etutor.com/component/module/ws_function2.php) request.httpmethod = "post" request.httpbody = nsjsonserialization.datawithjsonobject(submitdic, options: nsjsonwritingoptions() , error: nil) println(nsjsonserialization.datawithjsonobject(submitdic, options: nsjsonwritingoptions() , error: nil)?.description) request.setvalue("application/json; charset=utf-8", forhttpheaderfield: "content-type") nsurlconnection.sendasynchronousrequest(request, queue: nsoperationqueue.mainqueue(), completionhandler:{ (response:nsurlresponse!, data...

rest - Firefox Add-on RESTClient - How to send data-binary file in the request? -

i trying use restclient firefox add on post equivalent this: curl -s -s -x post -h "content-type: application/zip" \ --data-binary @./cluster-config.zip \ http://${joining_host}:8001/admin/v1/cluster-config the idea using firefox addon (restclient) debug stuff until works. stuck because don't find way add file request (equivalent --data-binary parameter of curl) how can include file in request in restclient firefox add-on?

How to write trigger in oracle to check for one specific condiition -

i have 1 table name user_count_details. there total 3 columns in table. msisdn=which uniquely defines row 1 specific user user_count= stores count of user. last_txn_id= stores last transfer id of txn user has performed. the user_count column of table user_count_details gets updated every transaction performed user. but here logic of system select sum(user_count ) user_count_details will gives 0 , considered system in stable state , fine. now want write trigger check first when new request update user_count come ,will hamper sum(user_count )=0 or not , if hampers msisdn details captured in separate update table. based on last comments, check if works. replace other_table_name per scenario. create trigger trgcheck_user_sum before insert on user_count_details each row begin if (select sum(user_count) user_count_details) > 0 insert other_table_name(msisdn) values(new.msisdn) end if end