Jump to content
Team Avolition


  • Content Count

  • Joined

  • Last visited

Community Reputation

175 Excellent

About mmaton

  • Rank
    Servant of Chuck Knoblock the one armed long arm of the Law
  • Birthday 03/09/1993

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
  1. mmaton

    how 2 sql

  2. mmaton


    [00:31:10] <mmaton> IRC IS FOR SPOTTY NERDS [00:31:12] <mmaton> !ROULETTE [00:31:13] <Warden> *click*, there are 5 untouched slots. You have a 20.0% chance to die. [00:31:13] <mmaton> !ROULETTE [00:31:13] <Warden> *click*, there are 4 untouched slots. You have a 25.0% chance to die. [00:31:14] <mmaton> !ROULETTE [00:31:14] <Warden> *click*, there are 3 untouched slots. You have a 33.33% chance to die. [00:31:14] <mmaton> !ROULETTE [00:31:15] <Warden> *click*, there are 2 untouched slots. You have a 50.0% chance to die. [00:31:15] <mmaton> !ROULETTE [00:31:15] <Warden> *click*, there are 1 untouched slots. You have a 100.0% chance to die. [00:31:18] <mmaton> fucking hell
  3. Computer Networking/Security 'nuff said
  4. mmaton

    So if anyone wants to make me a profile image...

    Join me in my quest to piss Sirenfal off with hipstergirl
  5. Still b& from shoutbox

  6. mmaton

    Speedtest Thread

    Yes lads, that's a mobile.
  7. So basically I have used a little (read: lot) of someone else's' code for a project which changes RGB values via UDP based on audio output. Ok, here's the code: import socket import pyaudio import time import wave import sys import struct import math UDP_IP = "" UDP_PORT = "8081" sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 RECORD_SECONDS = 500000 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format = FORMAT, channels = CHANNELS, rate = RATE, input = True, output = True, frames_per_buffer = chunk) print "* recording" maxNormal=1 prevVals=[0,255] prev=0 all = [] HEX = '0123456789ABCDEF' HEX2 = dict((a+b, HEX.index(a)*16 + HEX.index(b)) for a in HEX for b in HEX) def rgb(triplet): triplet = triplet.lower() return (HEX2[triplet[0:2]], HEX2[triplet[2:4]], HEX2[triplet[4:6]]) def triplet(rgb): return format((rgb[0]<<16)|(rgb[1]<<8)|rgb[2], '06x') def sendVal(r): global maxNormal global prev global prevVals r=float(r) maxNormal=float(maxNormal) if r>maxNormal: maxNormal=r normalized=r/maxNormal*255 normalized=int(normalized) prevVals.append(normalized) while len(prevVals)>=100: prevVals=prevVals[1:] if sum(prevVals)*1.0/len(prevVals)<=10: minNormal=1 maxNormal=1 norm=(normalized+prev)/2 intnorm=int(norm) norm=str(norm) message = ""+norm+","+norm+","+norm+"" while len(norm)<3: norm="0"+norm if 0 <= intnorm <= 255: sock.sendto(message, (UDP_IP, UDP_PORT)) print message else: norm = "000" print norm time.sleep(0.5) prev=normalized for i in range(0, RATE / chunk * RECORD_SECONDS): try: data = stream.read(chunk) except: continue #stream.write(data, chunk) all.append(data) if len(all)>1: data = ''.join(all) wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb') wf.setnchannels(CHANNELS) wf.setsampwidth(p.get_sample_size(FORMAT)) wf.setframerate(RATE) wf.writeframes(data) wf.close() w = wave.open(WAVE_OUTPUT_FILENAME, 'rb') summ = 0 value = 1 delta = 1 amps = [ ] for i in xrange(0, w.getnframes()): data = struct.unpack('<h', w.readframes(1)) summ += (data[0]*data[0]) / 2 if (i != 0 and (i % 1470) == 0): value = int(math.sqrt(summ / 1470.0) / 10) amps.append(value - delta) summ = 0 tarW=str(amps[0]*1.0/delta/100) #ser.write(tarW) sendVal(tarW) delta = value all=[] print "this should never print" stream.close() p.terminate() # write data to WAVE file data = ''.join(all) wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb') wf.setnchannels(CHANNELS) wf.setsampwidth(p.get_sample_size(FORMAT)) wf.setframerate(RATE) wf.writeframes(data) wf.close() ser.close() And here's the error: note it breaks after i start playing music and the if statement produces numbers and attempts to send the UDP message :c * recording 000 000 Traceback (most recent call last): File "audioman.py", line 107, in <module> sendVal(tarW) File "audioman.py", line 70, in sendVal sock.sendto(message, (UDP_IP, UDP_PORT)) TypeError: an integer is required Note: This is a work in progress, expect it to seem unfinished! Oh, and the HEX conversion was for when I was sending HTTP posts to the server, no longer needed but kept in for reference/backwards computability
  8. mmaton

    The Post Your Desktop Thread

    oh god the mess! >.>
  9. mmaton

    Mouse left-click not always working?

    Disassemble your mouse and clean it Fap with your left hand in future ???? Profit
  10. mmaton

    Hello :D

    Welcome to the forums and IRC, good to see a new member on irc.teamavolition.com
  11. mmaton

    Powerful and Emotional Songs Appreciation Thread

    The video really adds to this song, saw it back in '09 and it started me out on a Pink Floyd discovery