protocols

How to make it run the `exec()` command in PHP to edit some file in Mac OS X?

别来无恙 提交于 2019-12-11 16:41:28
问题 When I have this PHP script. <?php exec('/usr/local/bin/mate hello.txt'); ?> It doesn't work on web browser with http://abc/hello.php, for example. The command of mate is 'TextMate app', and it's just for editing hello.txt. Is this some php permission problem? I just need to run some commands on my local web server (I'm the only user), so I can open the permission to run this seemingly dangerous exec() function. Q : How can I make it run the PHP exec() function? I use Mac OS X 10.6.6/Apache

Connecting a desktop application with a website

你。 提交于 2019-12-11 16:14:00
问题 I made an application using Qt/C++ that reads some values every 5-7 seconds and sends them to a website. My approach is very simple. I am just reading the values i want to send and then i make an HTTP POST to the website. I also send the username and password to the website. The problem is that i cannot find out if the request is successful. I mean that if i send the request and server gets it, i will get an HTTP:200 always. For example if the password is not correct, there is no way to know

Pass data from collectionCell inside tableCell to secondVC use protocol

你离开我真会死。 提交于 2019-12-11 15:14:23
问题 I have two viewController's. The first VC has collectionCell inside tableCell . The second VC has collectionCell , and I have swift File with Model have a class. I need to pass data from the first VC ( collectionCell ) to the second VC. Pass data need from collectionCell because collectionCell has images (from swift File - Model). I think need use a protocol, but I don't really understand how to work with a protocol. Please help. My code: 1stVC ( viewController ): class ViewController1:

getting an error "ns_error_unknown_protocol

我与影子孤独终老i 提交于 2019-12-11 15:04:43
问题 im getting an error "ns_error_unknown_protocol" when i run this code in firefox.whats the problem with my code?i run this in google chrome,but it runs without any problem.it doesnt display any error messages?please help me out. my javascript is <script> $(document).ready(function() { var wrong="nnnn.htm"; var name = prompt("Please type in the password",''); $.ajax({ type: 'POST', dataType: 'json', url: 'password.php', data: { name: name }, success: function(data) { if (data.success == "good")

NTP client is not syncing with server in broadcast mode

痴心易碎 提交于 2019-12-11 14:48:21
问题 I have configured NTP version 4.2.6 server on fedora 20 machine. server side I am using local system time and given a broadcast subnet and all other options are disabled and on client's side I enabled only broadcast client. I haven't given server's address as according to my understanding server should broadcast NTP packets and client will automatically listen NTP packets and will get sync. but my NTP client is not syncing with server. please help me with all possibilities. 回答1: you can just

sending email using http protocol?

谁都会走 提交于 2019-12-11 13:07:53
问题 i've read on argosoft.com that it would be possible sending email using the http protocol - where can i find info about it? i'm looking for a way to send a personalized newsletter off my server withouth putting heavy traffic on my webserver. would this be possible? thx 回答1: You cant. smtp or imap. At best you can have an http server which accepts mail and then talks smtp/imap with some mail server. Why do you think http would be less overhead? In fact you don't have to increase the load on

Short-circuit when using a Swift protocol

ε祈祈猫儿з 提交于 2019-12-11 12:54:58
问题 As known, it is not possible to include the interface header file from a file in the -Header.h. My actual problem is that I have the definition of a class one protocol of which is a Swift one: @protocol arrivingDelegate; @interface palettaTraffic : NSObject<MKMapViewDelegate, arrivingDelegate> { } If I import the *-Swift.h file I get into the ugly cycle when the file is included in another one that is included in the header file. This is what happens when I use the @protocol directive: it is

macOS Swift master-detail delegate/protocol not working

自古美人都是妖i 提交于 2019-12-11 12:28:41
问题 This question must be simple, but I am a newbie. I have a splitView that I am trying to manage as a Master-Detail relationship. The user clicks on an OutlineView item in the Master and that triggers a need to update the content of a PopUp button on the Detail side. I have tried several tests of the arrangement in the larger code from which the code below is extracted (See TEST 1, TEST 2, TEST 3, TEST 4 marked in the code below. The one that fails is TEST 3 and it fails because

Fatal error when casting array of types to protocols: cannot be bridged from Objective-C

江枫思渺然 提交于 2019-12-11 11:32:19
问题 There's similar questions out there, but this one is on the latest Swift 2.2 version. Hopefully there's a solution by now because this seems like a big obstacle to Protocol-Oriented Programming in my mind. The below fails on assigning to let results with an error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0X0). protocol P: class { var value:Int {get} } class X: P { var value = 0 init(_ value:Int) { self.value = value } } func getItems() -> [P] { let

Extension to constrained Dictionary Conforming to Protocol

拈花ヽ惹草 提交于 2019-12-11 10:09:42
问题 I am trying to create a protocol that allows any object to be instantiated using JSON NSData. I am trying to create an extension to [String: String] dictionary that conforms to this protocol. Unfortunately for some reason the following code doesn't work: public protocol InitializableWithData { init(data: NSData?) throws } extension Dictionary: InitializableWithData where Key: String, Value: String { public init(data: NSData?) { self.init() // Parse NSData into a [String: String] } } I get the