Computing desk | ||
---|---|---|
< June 28 | << May | June | Jul >> | June 30 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
function show(e) { $.ajax({ type:"POST", url:"select.php", data:{action:e}, success: function(data) { $("#content").html(data); } }); }
I'm calling this function onClick on any button and passing value from there to the function, using this function show() the control goes to another file select.php from where the result come back to the current page, everything is working fine, I want to pass all the values from all the buttons or select options or checkboxes which all are already selected, and remove the variable when any option is deselected, ? how to do this ?? — Preceding unsigned comment added by 106.51.131.180 (talk) 07:58, 29 June 2015 (UTC)
Hi, I need to get the exact guidelines used in a document on another one in Photoshop. How could I do it..?--Joseph 15:28, 29 June 2015 (UTC)
Hello everyone. How would I send strings between python consoles in python 3.4? I think I would use the TCPServer class in the socketserver module. I am running Python 3.4.3 under windows 7. I basically want to run a function on PC A and have it send an argument to PC B and have the console on PC B display the message that it just received. Thanks for your help in advance, —SGA314 I am not available on weekends (talk) 19:30, 29 June 2015 (UTC)
Edit: I have managed to get a TCP/IP server that allows the client to send a message to the server. However, I can't seem to get the client to send messages after it has connected. Here is my client and server code: Server:
import socket
import threading
import socketserver
ConnectedClients = {}
class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
data = str(self.request.recv(1024), 'ascii')
message = data.split(":")
if message[0] == "ConnectClient":
if not message[1] in ConnectedClients:
ConnectedClients[message[1]] = self.request.getsockname()
response = bytes("Added " + str(ConnectedClients[message[1]]) + " To the server.", "ascii")
self.request.sendall(response)
else:
#print(message[0])
exec(message[0])
cur_thread = threading.current_thread()
response = bytes("{}: {}".format(cur_thread.name, "recived " + data), 'ascii')
self.request.sendall(response)
class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
pass
if __name__ == "__main__":
# Port 0 means to select an arbitrary unused port
HOST, PORT = "localhost", 9999
server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)
ip, port = server.server_address
# Start a thread with the server -- that thread will then start one
# more thread for each request
server_thread = threading.Thread(target=server.serve_forever)
# Exit the server thread when the main thread terminates
server_thread.daemon = True
server_thread.start()
print("Server loop running in thread:", server_thread.name)
Client:
import socket
import __main__
def client(message, ip = "localhost", port = 9999):
if not hasattr(__main__, "Connected"):
setattr(__main__, "Connected", False)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((ip, port))
data = bytes("ConnectClient" + ":" + "Client1", "ascii")
#print(data)
if __main__.Connected == False:
sock.sendall(data)
__main__.Connected = True
sock.shutdown(socket.SHUT_WR)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((ip, port))
#response = str(sock.recv(1024), 'ascii')
#print("Received: {}".format(response))
try:
msgdata = bytes(message, 'ascii')
#print(msgdata)
sock.sendall(msgdata)
response = str(sock.recv(1024), 'ascii')
#print("Received: {}".format(response))
finally:
pass
#sock.close()
—SGA314 I am not available on weekends (talk) 20:16, 29 June 2015 (UTC)
Hi there,
I've been trying to install SimpleSaml on wamp:
https://simplesamlphp.org/
But when I try to install it, I get 404 error, about welcome_page.php.
After I checked the web it seems I should have added virtualhost to apache.conf.
Unfortunately, whenever I do it, all of the rest of the files on my server isn't available.
1)Does anyone have a solution to the described problem?
2)Does anyone know a good way to implement Saml into php? — Preceding unsigned comment added by Exx8 (talk • contribs) 21:53, 29 June 2015 (UTC)