aaa

Quantum Physics and Universal Beauty - with Frank Wilczek - YouTube

https://www.tensorflow.org/versions/master/get_started/index.html
https://www.tensorflow.org/versions/master/tutorials/recurrent/index.html

https://api.ai/





 
 
 print re.sub(r"(\d)F", r"\1 degrees", string1)
 
 rep = {"NW": "northwest", "SW": "southwest"} # define desired replacements here
# use these three lines to do the replacement
rep = dict((re.escape(k), v) for k, v in rep.iteritems())
pattern = re.compile("|".join(rep.keys()))
text = pattern.sub(lambda m: rep[re.escape(m.group(0))], string1)
 
 
 
        params = {'text': text, 'voice': 'fr-FR_ReneeVoice', 'accept': 'audio/wav'}
        headers = {'content-type': 'audio/wav'}

        url='https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize'
        r = requests.request(method='POST', url=url, headers=headers, params=params,
                                    stream=True, auth=('user', 'pass'))

        if r.status_code == 200:
            filename='output.wav'
            with open(filename, 'wb') as audio_file:
                audio_file.write(r.content)
            print join(dirname(__file__), filename)
            os.system('/usr/bin/mplayer ' + join(dirname(__file__), filename))
            os.remove(filename)
        else:
            print r.status_code
            print r.headers
            print r.text   



    url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize'
    audio = open(audio_fname, 'rb')

    headers = {'content-type': 'audio/wav'}
    params = {'continuous': False}
    r = requests.request(method='POST', url=url, headers=headers, data=audio, params=params,
                                stream=True, auth=('user', 'pass'))

    os.remove(audio_fname)
    if r.status_code == 200:
        response= json.loads(r.text)
        print response['results'][0]['alternatives'][0]['confidence']
        print response['results'][0]['alternatives'][0]['transcript']
        #return response['results'][0]['alternatives'][0]['transcript']
    else:
        print r.status_code
        print r.headers
        print r.text   
        quit()


@startuml
autonumber 10 10 "<b>[000]"

hide footbox
title Footer removed

participant RTC
participant Slot1
participant Slot2
participant Slot3
participant Slot4

box "Internal Service" #LightBlue
participant Bob
participant Alice
end box
== REST ==

RTC -> Slot1 : Source Code Delivery
Slot1 -> Slot4 : Passing BDD

autonumber stop
Bob -> Alice : dummy

== Initialization ==


autonumber resume "<font color=red><b>Message 0  "
Bob -> Alice : Yet another authentication Request
Bob <- Alice : Yet another authentication Response

autonumber stop
Bob -> Alice : dummy
note left
a note
can also be defined
on several lines
end note

autonumber resume 1 "<font color=blue><b>Message 0  "
Bob -> Alice : Yet another authentication Request
Bob <- Alice : Yet another authentication Response
@enduml









 
 
 
 
 
 cut -d "," -f4,5 myfile.csv | sort | uniq -c


#http://www.analyticsvidhya.com/blog/2015/09/build-predictive-model-10-minutes-python/

 

#http://francescopochetti.com/part-vii-backtest-portfolio-performance/
#http://francescopochetti.com/text-recognition-natural-scenes/

 


#!/usr/bin/python

import sys
import operator
import re
from operator import itemgetter
from datetime import datetime

import pickle
mycontactfile = 'contactlist.data';

 

class Reminder(object):
    def __init__(self, desc="Unknown name", sortdate=0, eventdate="Unknown major", isholiday=False):
        self.desc = desc
        self.sortdate = sortdate
        self.eventdate = eventdate
        self.isholiday = isholiday

 

f = open(mycontactfile,'rb');
reminders = pickle.load(f);
print (reminders);


for entry in reminders:
 print entry.desc

print '--------------------------------------'
sorted_x = sorted(reminders, key=lambda x: x.sortdate, reverse=True)
#print sorted_x

for entry in sorted_x:
 print entry.desc
 print entry.sortdate
 print entry.isholiday


quit()

 


class Reminder(object):
    def __init__(self, desc="Unknown name", sortdate=0, eventdate="Unknown major", isholiday=False):
        self.desc = desc
        self.sortdate = sortdate
        self.eventdate = eventdate
        self.isholiday = isholiday

reminders = []
reminders.append(Reminder("name1", 18, "major"))
reminders.append(Reminder("name2", 21, "major", True))
reminders.append(Reminder("name3", 17, "major"))

reminders.append(Reminder("name1", int(datetime(2015, 12, 20, 0, 0).strftime("%Y%m%d%H%M")), "major"))
reminders.append(Reminder("name2", int(datetime(2012, 2, 4, 0, 0).strftime("%Y%m%d%H%M")), "major", True))
reminders.append(Reminder("name3", int(datetime(2013, 1, 9, 0, 0).strftime("%Y%m%d%H%M")), "major"))

print len(reminders)

#print students
for entry in reminders:
 print entry.desc

print '--------------------------------------'
sorted_x = sorted(reminders, key=lambda x: x.sortdate, reverse=True)
#print sorted_x

for entry in sorted_x:
 print entry.desc
 print entry.sortdate
 print entry.isholiday


import pickle

mycontactfile = 'contactlist.data';
f = open(mycontactfile,'wb');
pickle.dump(reminders,f);
f.close();

'''
f = open(mycontactfile,'rb');
reminders = pickle.load(f);
print (storedcontact);
'''

quit()
 
 
 
--------------------------------------------------------------------
 
calling subprocess.Popen(["/bin/mycmd", "myarg"]) is "no wait."

Quentin, time to get on the bus, have fun at school
Mom, one of your kids has to go to school
Batman, this is Robin, quick, to the batcave
Mars to earth base, Commander Quentin, your hyperspace launch vehicle is leaving now

Mom, your kid is coming back from school
School bus is arriving in a few
Fun's over, kid #2 is coming back

mydict = {'george':16,'amber':19}
print mydict.keys()[mydict.values().index(16)] # Prints george
if 'amber' in mydict:
  print "blah"
else:
  print "boo"
 
if '16' in mydict:
  print "blah"
else:
  print "boo"
 
 
for k,v in sorted(mydict.items()):
 print k, v
 
 delete
 mydict.pop("key", None)
ċ
GoogleCoderSetup.py
(14k)
Chris G,
Nov 2, 2015, 6:21 PM
Comments