# Server program from socket import * # Set the socket parameters host = "localhost" port = 21567 buf = 1024 addr = (host,port) # Create socket and bind to address UDPSock = socket(AF_INET,SOCK_DGRAM) UDPSock.bind(addr) # Receive messages while 1: data,addr = UDPSock.recvfrom(buf) if not data: print "Client has exited!" break else: print "nReceived message '", data,"'" # Close socket UDPSock.close()
# Client program
from socket import *
# Set the socket parameters
host = "localhost"
port = 21567
buf = 1024
addr = (host,port)
# Create socket
UDPSock = socket(AF_INET,SOCK_DGRAM)
def_msg = "===Enter message to send to server===";
print "n",def_msg
# Send messages
while (1):
data = raw_input('>> ')
if not data:
break
else:
if(UDPSock.sendto(data,addr)):
print "Sending message '",data,"'....."
# Close socket
UDPSock.close()
OneFileCMS is just that. It's a flat, light, one file CMS (Content Management System) entirely contained in an easy-to-implement, highly customizable, database-less PHP script.
Coupling a utilitarian code editor with all the basic necessities of an FTP application, OneFileCMS can maintain a whole website completely in-browser without any external programs. Screenshots
* Validating, semantic, and commented markup. Tested in FF, Safari, and IE7/IE8.
* Small footprint (20.4 kb)
* Possibly the easiest installation process ever
* All the basic features of an FTP application like renaming, deleting, copying, and uploading
uploads/deletions, you're going to want to break out an actual FTP program.)
* Gracefully degrading CSS and Javascript
* 100% re-brandable with page title stored in variable and a modifiable filename
Requirements
* UNIX/Linux host, Apache
* PHP5 (PHP4 untested)
* File permission privileges
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="simple image gadget" />
<UserPref name="myname"
display_name="Module title"
default_value="Image"
required="true"/>
<UserPref name="targetimg"
display_name="URL of your image"
default_value="http://www.google.com/images/logo_sm.gif"
required="true"/>
<UserPref name="imgwidth"
display_name="Width"
default_value="100%"
required="true"/>
<Content type="html"><![CDATA[
<!-- Simplification of bashennekam.googlepages.com/google_gadget_image.xml -->
<div align="center">
<a href="__UP_targetimg__" target="_blank">
<img src="__UP_targetimg__" border="0" align="center" width="__UP_imgwidth__">
</a>
</div>
]]></Content>
</Module>
This tutorial will demonstrate the following development process: Write C programs in AVR Studio. Compile them into a .hex file using the AVR-GCC compiler (which integrates into AVR Studio). Simulate the target AVR chip and debug the code within AVR Studio. Program the actual chip using the AVRISP mkII USB device, which is attached to our target chip with a special 6-pin cable. Once programmed, the chip runs the program in your circuit.