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: ("macro") "code",

Top ("macro") "code" experts: econnews, glassesofkekkonen, myspacelayoutgraphics, fredb, adski, brillig,

1 - 10 of 61 next »   Watch mshook
 

jqGrid doesn't have very good documentation. You have to get everything from the demos, but the actual demo files are hidden in ajax code. This file is the data file used to build the demo navigation menu on the left. It has the name of the individual demo .html files along with the visible text. There is a corresponding .js file for each demo. All the files are in the http://trirand.com/blog/jqgrid/ directory.

Example:
http://trirand.com/blog/jqgrid/searching.html
http://trirand.com/blog/jqgrid/searching.js
by mshook 2009-12-15 16:23 jqgrid · jquery · tip · demo · code · javascript · html · how · howto · mynote · grid · plugin
http://trirand.com/blog/jqgrid/tree.xml - cached - mail it - history
The first thing I did was create a "gvoice.py" module with several helpful classes. These allow you to:
  1. Log in
  2. Gather all Google Contacts into separate groups
  3. Selectively narrow down the contacts in a group
  4. Gather the phone numbers that you have entered
  5. Send SMS messages
  6. Place Calls
I am by no means a seasoned Python developer, but what I have created works well for my purposes. I tried to make the classes as loosely coupled with the UI as possible in case I want to put a GUI around it sometime, but for now I am doing everything at the command line (which I often prefer).
by mshook 2009-11-26 20:13 python · google · voice · gvoice · api · code · voip · telephone · phone · howto · csv · gdata · sms · cli
http://everydayscripting.blogspot.com/2009/08/python-google-voice-mass-sms-and-mass.html - cached - mail it - history
# 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

* 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://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
//dirt cheap wireless TX
//generates 38kHz carrier wave on pin 9 and 10
//sends data via TX every 500ms
void setup()
{
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);

  // Clear Timer on Compare Match (CTC) Mode
  bitWrite(TCCR1A, WGM10, 0);
  bitWrite(TCCR1A, WGM11, 0);
  bitWrite(TCCR1B, WGM12, 1);
  bitWrite(TCCR1B, WGM13, 0);

  // Toggle OC1A and OC1B on Compare Match.
  bitWrite(TCCR1A, COM1A0, 1);
  bitWrite(TCCR1A, COM1A1, 0);
  bitWrite(TCCR1A, COM1B0, 1);
  bitWrite(TCCR1A, COM1B1, 0);

  // No prescaling
  bitWrite(TCCR1B, CS10, 1);
  bitWrite(TCCR1B, CS11, 0);
  bitWrite(TCCR1B, CS12, 0);

  OCR1A = 210;
  OCR1B = 210;

  Serial.begin(2400);
}

void loop()
{
  Serial.println("testing testing testing");
  delay(500);
}


by mshook 2009-09-27 21:21 arduino · avr · code · timer · ir · infrared · receiver · transmitter · serial · howto · circuitled · modulation · c
http://tthheessiiss.wordpress.com/2009/08/05/dirt-cheap-wireless/ - cached - mail it - history
via http://tinyurl.com/ir-remote-control
To decode what the remote was sending, I used an oscilloscope and a small photodiode. The photodiode generates a small amount of voltage when light hits it, and responds to changes in light level quickly enough that the oscilloscope can draw a really nice plot of the signal. I have a Parallax USB oscilloscope, which is perfect for showing the command pulses and is just fast enough to find the modulation frequency. As an aside, I’m really happy with the Parallax oscilloscope for projects like this. It is simple to use and I love being able to save images to share with people.
Here’s what two of the commands from the dimmer remote look like. The top signal is the “fade lights up” command, and the bottom one is “fade lights down”:
oscilloscope image of 2 commands
by mshook 2009-09-22 22:48 ir · howto · oscilliscope · modulation · avr · arduino · project · code · infrared · control · wishlist · remote · usb
http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/ - cached - mail it - history
I'm working on a project that uses data in JSON format  (www.json.org).  It took me a while to get it going in processing, so I thought I'd post what I did here.  If there's a better way (which undoubtedly there is!), please let me know.

Andrew Odewahn

--
Here are the steps I took (on Windows):

1.  Download http://www.json.org/java/json.zip from json.org.  Save it in a some directory, which I'll call %DOWNLOAD_HOME%.

2.  Unzip it.  Be sure you preserve the archive's directory structure (/org/json/) when you unzip the file.  

3.  Change directory into %DOWNLOAD_HOME%orgjson
by mshook 2009-09-22 10:48 processing · howto · json · java · code · library · emon
http://processing.org/discourse/yabb2/YaBB.pl?board=Integrate%3Baction=display%3Bnum=1163101573 - cached - mail it - history
1 - 10 of 61 next »  
Related Tags
 
- exclude ~ optional + require
Add Dates