# 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()
/*send the packet*/
send_result = sendto(s, buffer, ETH_FRAME_LEN, 0,
(struct sockaddr*)&socket_address, sizeof(socket_address));
if (send_result == -1) { errorhandling... }
Example 1.6. Receive a RAW ethernet frame
void* buffer = (void*)malloc(ETH_FRAME_LEN); /*Buffer for ethernet frame*/
int length = 0; /*length of the received frame*/
...
length = recvfrom(s, buffer, ETH_FRAME_LEN, 0, NULL, NULL);
if (length == -1) { errorhandling .... }
The use cases are plentiful for businesses:
* Update Google Sites from 3rd party applications – e.g. your sales
team's Google Sites pages can update automatically when new leads are
added to your CRM system.
* Migrate files and content from workspace applications like
Microsoft SharePoint and Lotus Notes to Google Sites.
* Export Google Sites pages, edit them offline, and re-import the
updated content.
* Export your sites, including every page revision, for backup.
* Easily monitor changes across your important internal and public
sites, all from a single gadget.
* Push new content like changes to employee policies or a new
corporate logo to any site on your domain, even sites created by
individual employees.
* is Unix
Jacob Kaplan-Moss
October 7, 2009
via http://wiki.twit.tv/wiki/This_WEEK_in_GOOGLE_5
Personal Hype Quotient for:
Michael Shook On a scale of 0-10, your ranking is
Level 3: Stupidly unaware of my social climbing and hyping possibilities..How we did it:
We took your follower count which is 49,
along with your last 422 tweets:
Where you hyped in 4 of them,
you re-tweeted in 0 of them
and you self-linked in 0 of them.
We munged all these together in our secret algorithm to come up with a level 3 score.
via http://twitter.com/programmingjoy Javascript as Compiler Target: Clamato, GWT Smalltalk, Python, Scheme http://www.infoq.com/news/2009/09/javascript-compilation-target (require moby/stub/world) (define WIDTH 320) (define HEIGHT 480) (define (render w) (place-image (text "Hello World" 10 "Black") 20 20 (empty-scene WIDTH HEIGHT))) (big-bang WIDTH HEIGHT 10 0) (on-redraw render)
After a few minutes of poking around, I was able to compile this to Java and then run it on the Android Emulator:
(1/2)Web: * Creating a Smart Energy Device Using Digi's xbee SE RF Module www.alcom.be By using the xbee SE module as part of a Smart Energy device, ... The From Google Receive:WED 9:26pm 09/23/09 (2/2)xbee Smart Energy firmware is a firmware load for xbee Series 2 RF module. This means ... View all results: http://m.google.com/u/AmuAXV From: Google Receive:WED 9:26 pm 09/23/09
1. $(document).ready () All The Way
2. Use $(window).load ()
3. Load Only What You Really Need
4. Learn What The ‘data’ Method Is And Use It
5. Built-In Custom Selectors
6. Flag With Classes
7. Don’t Call the Same Selector Hundreds of Times
8. Chain (Almost) Everything
9. toggleClass Utility
10. Store jQuery Results
var $p = $('p.hello');
$p.css ('color', '#000000');
$p.text ('hello');
$p.addClass ('paragraph');
$p.fadeTo (1000, 1);
$('p.hello').css ('color', '#000000').text ('hello').addClass ('paragraph').fadeTo (1000, 1);