
Recherche avancée
Autres articles (36)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.
Sur d’autres sites (6706)
-
Animating a 2D plot (2D brownian motion) not working in Python
8 avril 2020, par Thamu MnyulwaI am trying to plot a 2D Brownian motion in Python but my plot plots the grid but does not animate the line.



Attempted at performing this plot is below,



!apt install ffmpeg

import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as animation


np.random.seed(5)


# Set up formatting for the movie files
Writer = animation.writers['ffmpeg']
writer = Writer(fps=15, metadata=dict(artist='Me'), bitrate=1800)


def generateRandomLines(dt, N):
 dX = np.sqrt(dt) * np.random.randn(1, N)
 X = np.cumsum(dX, axis=1)

 dY = np.sqrt(dt) * np.random.randn(1, N)
 Y = np.cumsum(dY, axis=1)

 lineData = np.vstack((X, Y))

 return lineData


# Returns Line2D objects
def updateLines(num, dataLines, lines):
 for u, v in zip(lines, dataLines):
 u.set_data(v[0:2, :num])

 return lines

N = 501 # Number of points
T = 1.0
dt = T/(N-1)


fig, ax = plt.subplots()

data = [generateRandomLines(dt, N)]

ax = plt.axes(xlim=(-2.0, 2.0), ylim=(-2.0, 2.0))

ax.set_xlabel('X(t)')
ax.set_ylabel('Y(t)')
ax.set_title('2D Discretized Brownian Paths')

## Create a list of line2D objects
lines = [ax.plot(dat[0, 0:1], dat[1, 0:1])[0] for dat in data]


## Create the animation object
anim = animation.FuncAnimation(fig, updateLines, N+1, fargs=(data, lines), interval=30, repeat=True, blit=False)

plt.tight_layout()
plt.show()

## Uncomment to save the animation
#anim.save('brownian2d_1path.mp4', writer=writer)




However, instead of performing the plot the program is printing,




How do I animate this plot ? I am new to python so I apologize in advanced if this is an easy question.



I found this question on http://people.bu.edu/andasari/courses/stochasticmodeling/lecture5/stochasticlecture5.html , there is a walkthrough of how this code came to being.


-
Changed youtube url format due to new bug in Youtube's video iframe in IE7 :
14 juin 2013, par jackmooreChanged youtube url format due to new bug in Youtube's video iframe in IE7 : http://productforums.google.com/forum/#!msg/youtube/-kOMQjxmPZU/AkvLf3m7vpYJ
-
Block YouTube from source page when trying to download a video with youtube-dl
18 mars 2018, par user3108268E.g. example.com/1 has a video hosted, you run
youtube-dl example.com/1
and it all works fine, the video gets downloaded.E.g. example.com/2 also has a video, but it also has a YouTube trailer. If you run
youtube-dl example.com/2
the hosted video gets completely ignored and only YouTube trailer gets downloaded.From what I see in the log is that the wanted local video playlist gets downloaded first and then ignored by getting overwritten by embedded YouTube playlist download.
You can’t even get the url with
--get-url
or get format with--list-formats
. It always prints the googlevideos URL for the YouTube trailer and lists only the YouTube trailer formats.I did manage to pull out the local video URL via
--dump-pages
and decoding the base64 encoded source. But the problem is that the URL contains a unique token each time the page example.com/2 is called, so passing the unique one-time video URL like e.g. example.com/2/video.php ?token=asdf to youtube-dl won’t download the video.So I figured somehow I need to bypass the YouTube trailer source and playlist when calling
youtube-dl example.com/2
and trying to download local video and not the YouTube trailer.