links · people · groups · tags | My: links · tags · groups · watchlists · notes login · sign up now! | help · blog
Simpy simpy
 
Michael Shook, member since May 27, 2004
.
Search Everyone: "example",
1 - 10 of 67 next »   Watch mshook
 
# 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()
by mshook 2009-11-14 18:27 test · python · udp · example · code · simple · useful · works
http://www.evolt.org/node/60276 - cached - mail it - history
/*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 .... }
by mshook 2009-10-15 22:15 ethernet · 802 · packet · howto · code · mac · ip · c · example
http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html - cached - mail it - history
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.
by mshook 2009-10-14 22:20 wiki · sites · google · api · gdata · example · usecase · export · backup · import · xml · static · enterprise · lotus · notes · lotusnotes
http://googleenterprise.blogspot.com/2009/09/import-export-and-more-with-new-google_24.html - cached - mail it - history

* is Unix

Jacob Kaplan-Moss

October 7, 2009

by mshook 2009-10-08 00:07 c · ruby · python · example · code · minimal · server · viapopular · good · linux · perl · how · network · socket · process
http://jacobian.org/writing/star-is-unix/ - cached - mail it - history

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.

by mshook 2009-10-05 23:10 twitter · api · via · twit · gae · rank · hype · app · example
http://personalhypequotient.appspot.com/3 - cached - mail it - history
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:

by mshook 2009-10-01 16:40 scheme · android · javascript · compiler · lisp · java · mobile · example · code · interesting
http://benjisimon.blogspot.com/2009/03/plt-scheme-meets-android-platform.html - cached - mail it - history
(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

[PDF] Creating a Smart Energy Device Using Digi's xbee SE RF Module
By default, the xbee smart energy firmware responds to all received ZDP request messages. However, ..

www.alcom.be/binarydata.aspx

by mshook 2009-09-23 21:49 google · mobile · search · zigbee · smartenergy · cell · sms · texting · example
http://m.google.com/u/AmuAXV - cached - mail it - history
SELECT CONCAT( "[", GROUP_CONCAT( CONCAT("{name:'",`name`,"'"), CONCAT(",email:'",`email`,"'}") ) ,"]") AS json FROM users; CREATE TABLE `user`( `id` int not null auto_increment, `name` varchar(100), `email` varchar(50), PRIMARY KEY(id) ) ENGINE = InnoDB; INSERT INTO `user` (`name`, `email`) VALUES ('Cesar', 'cesar@craftyman.net'), ('Maria', 'maria@gmail.com'), ('Jose', 'j0s3@hotmail.com'), ('Albert','albertpr@yahoo.com');
by mshook 2009-08-10 08:54 via · json · popular · mysql · sql · howto · code · example
http://craftyman.net/mysql-to-json/ - cached - mail it - history
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);
                  
by mshook 2009-08-05 18:46 jquery · javascript · useful · tips · tip · example · code · short
http://www.myinkblog.com/2009/08/04/10-tips-for-writing-better-jquery-code/ - cached - mail it - history
1 - 10 of 67 next »  
Related Tags
 
- exclude ~ optional + require
Add Dates