##// END OF EJS Templates
Fix XSS reported on Security list...
Fix XSS reported on Security list No CVE-ID yet August 18, 2015 ----- Reported to Quantopian by Juan Broullón <thebrowfc@gmail.com>... If you create a new folder in the iPython file browser and set Javascript code as its name the code injected will be executed. So, if I create a folder called "><img src=x onerror=alert(document.cookie)> and then I access to it, the cookies will be prompted. The XSS code is also executed if you access a link pointing directly at the folder. jik ------

File last commit:

r20541:1e566dcc
r21633:3ab41641
Show More
Beat Frequencies.ipynb
120 lines | 2.4 KiB | text/plain | TextLexer

Exploring Beat Frequencies using the Audio Object

This example uses the Audio object and Matplotlib to explore the phenomenon of beat frequencies.

In [ ]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
In [ ]:
from IPython.html.widgets import interactive
from IPython.display import Audio, display
import numpy as np
In [ ]:
def beat_freq(f1=220.0, f2=224.0):
    max_time = 3
    rate = 8000
    times = np.linspace(0,max_time,rate*max_time)
    signal = np.sin(2*np.pi*f1*times) + np.sin(2*np.pi*f2*times)
    print(f1, f2, abs(f1-f2))
    display(Audio(data=signal, rate=rate))
    return signal
In [ ]:
v = interactive(beat_freq, f1=(200.0,300.0), f2=(200.0,300.0))
display(v)
In [ ]:
v.kwargs
In [ ]:
f1, f2 = v.children
f1.value = 255
f2.value = 260
plt.plot(v.result[0:6000])