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: "python",

Top "python" experts: stargaming, tomz, cetoli, masterchef, lena, denilw,

Groups about "python": Python, Python, django, Naveen, Zope,

1 - 10 of 17 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

* 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
Examples
Here are some PDF output examples that give an idea of what can be done with dblatex and dbcontext.
Dblatex

    * Some examples of the features supported by dblatex:
          o DocBook Examples
          o MathML Examples
          o Sources of the Examples
          o Sources + PDF Examples
    * The dblatex User Manual is a good example of a default DocBook book output rendering.
    * The User Manual in DB2LaTeX style shows the DB2LaTeX style applied to the same document.
    * The User Manual in Simple style shows a quite basic latex layout applied to the same document.
    * A W3C MathML Test Suite 2.0 Excerpt (bzipped) demonstrates the large MathML 2.0 support included by dblatex.
    * The DocBook Definitive Guide (gzipped) compiled with dblatex and the tdg-dblatex.xsl stylesheet.

Dbcontext

    * The dblatex User Manual done by dbcontext can show how dbcontext handles the same manual.
by mshook 2009-05-30 23:15 very · cool · docbook · typography · publish · book · markup · xml · latex · tex · example · manual · python · subversion
http://dblatex.sourceforge.net/ - cached - mail it - history
1. created mathematical models of data coming from mobile devices and an algorithm that analyzed this data from his sample of 100 students and could predict what each would do next. ..he has been working with much larger mobile data sets from up to 250 million people in Europe, Asia, and Africa to help telecom companies ..understand their customers and .. create a model of contagion dissemination. 2. past two years in Kenya. The majority of the mobile phone user market lives in developing countries and is under-served, a condition which motivated MIT to start EPROM, Entrepreneurial Programming and Research on Mobiles, to make sure computer science students in Africa learn how to program mobile phones. ..describes 2 .. projects... – one in which mobile text messaging has been used for hospital blood supply management across the country and a second in which an SMS bulletin board was created allowing low-end mobile handsets to access web content similar to craigslist."
by mshook 2009-04-21 12:30 mit · itconversations · africa · python · mobile · course · eclectic · podcase · mp3 · good · ai · emergence · sms · texting · links · list
http://itc.conversationsnetwork.org/shows/detail3874.html - cached - mail it - history
"Simple example >>> import jsontemplate >>> jsontemplate.expand('Hello {name}', {'name': 'world'}) 'Hello world' This Python example should look familiar to many people.* The JavaScript version is a straightforward translation of this API. "
by mshook 2009-04-09 15:31 html · template · declarative · via · json · popular · javascript · python · cool
http://json-template.googlecode.com/svn/trunk/doc/Introducing-JSON-Template.html - cached - mail it - history
"Details In MySQL, our entities are stored in a table that looks like this: CREATE TABLE entities ( added_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id BINARY(16) NOT NULL, updated TIMESTAMP NOT NULL, body MEDIUMBLOB, UNIQUE KEY (id), KEY (updated) ) ENGINE=InnoDB; For example, a typical entity in FriendFeed might look like this: { "id": "71f0c4d2291844cca2df6f486e96e37c", "user_id": "f48b0440ca0c4f66991c4d5f6a078eaf", "feed_id": "f48b0440ca0c4f66991c4d5f6a078eaf", "title": "We just launched a new backend system for FriendFeed!", "link": "http://friendfeed.com/e/71f0c4d2-2918-44cc-a2df-6f486e96e37c", "published": 1235697046, "updated": 1235697046, } "
by mshook 2009-03-31 15:55 via · couchdb · popular · mysql · python · json · howto · document · good · database · architecture
http://bret.appspot.com/entry/how-friendfeed-uses-mysql - cached - mail it - history
by mshook 2009-03-05 23:06 slides · ibm · python · framework · template · why · joegregorio · dynamic
http://bitworking.org/projects/cascon06/1.html - cached - mail it - history
"A recursive-descent parser consists of a series of functions, usually one for each grammar rule. Such parsers are easy to write, and are reasonably efficient, as long as the grammar is “prefix-heavy”; that is, that it’s usually sufficient to look at a token at the beginning of a construct to figure out what parser function to call. For example, if you’re parsing Python code, you can identify most statements simply by looking at the first token."
by mshook 2008-07-15 08:34 viapopular · parse · python · howto · code · why
http://effbot.org/zone/simple-top-down-parsing.htm - cached - mail it - history
" * A resource-oriented architecture, as described in the great book RESTful Web Services * A Drupal converter/uploader that queries a local MySQL database and uploads the data to a Bloog through REST calls. * A datastore deletion utility that can clear out your entities in your Bloog's datastore. * Arbitrary URL aliases, which can be created by the drupal uploader, that provide redirection from legacy urls. There's also a programmatic aliasing function that can take a regex like 'node/(.*)' and map it to legacy IDs stored with the blog entries. (http://foo.com/node/4 is a typical Drupal url.) * Dynamic per-article sidebars. (in progress) * A Yahoo UI AJAX front-end for posting and managing entries in a RESTful way. (in progress) "
by mshook 2008-06-26 18:02 rest · appengine · example · blog · cms · python · code · roa
http://bloog.billkatz.com/ - cached - mail it - history
1 - 10 of 17 next »  
Related Tags
 
- exclude ~ optional + require
Add Dates