Posts

why does canvas object keep blinking during animation? -

i made animation in javascript house rising smoke. smoke 3 functions each part of smoke flow upwards chimney. controlled slider toggles speed @ smoke exists chimney. works except when slider toggled left right, smoke blinks while rising. tell me why is? thanks html: <!doctype html> <html> <head> <title>carrey, justin, myshkin, rost</title> <meta charset="utf-8"/> <link rel="stylesheet" href="style.css"/> </head> <body> <canvas id="canvas" width="500" height="500">get new browser!</canvas> <script src="script.js" ></script> <form> <input type="range" min="10" max="250" value="100" id="speedcont"/> <p> rostislav myshkin a00787633 rmyshkin@my.bcit.ca <br /> completed:3-d house, smoke, animation smoke, slider sp...

javascript - How do I duplicate the "pattern" attribute for Safari? -

i've got client online store that's having issues customers putting emojis , special characters text input field. want them able use spaces, numbers, letters, , letters accents , umlauts , such. when tried solution, worked. pattern="[ a-zÀ-ÿ0-9]" problem is, works every browser we've tested on except safari. i'm serious javascript n00b; i've written jquery , javascript functions myself have done i've needed them do, problems twofold: how go writing vanilla js or jquery function replicates pattern's functionality? more importantly (because possible solutions i've seen have omitted information), how link input works in first place? thank can give me! fixed! answer startlingly easy. polyfill, per site: http://www.useragentman.com/blog/2010/07/27/creating-cross-browser-html5-forms-now-using-modernizr-webforms2-and-html5widgets-2/ here's code used. turns out other dev had added entire modernizr.min.js script fix probl...

regex - Kibana Regular expression search -

i newbie elk. want search docs based on order of occurrence of words in field. example, in doc1, my_field: "my foo word bar example" in doc2, my_field: "my bar word foo example" i query in kibana docs "foo" followed "bar" , not opposite. so, doc1 return in case , not doc2. tried using below query in kibana search. but, not working. query doesn't produce search results. my_field.raw:/.*foo.*bar.*/ i tried analyzed field(just my_field ), though came know should not work. , of course, didn't produce results either. please me regex search. why not getting matching result query? i'm not sure offhand why regex query wouldn't working believe kibana using elasticsearch's query string query documented here instance phrase query (documented in link) putting search in double quotes , word "foo" followed "bar". perform better since on analyzed field (my_field) has tokenized each word perform fa...

html - Positioning the website correctly in the mobile version -

Image
i'm trying format mobile version of website layout not centered. how can it? code turn mobile version: [<meta name = "viewport" width = "device-width, initial-scale = 0.9, maximum-scale = 0.9, user-scalable = no">][1] my website #1, #2

python - Matplotlib plot only updates when windows is closed? -

i wrote following script display simple sine curve update ad infinitum: #!/usr/bin/env python import seaborn sns import matplotlib.pyplot plt import matplotlib.animation animation import numpy np math import sin n = 0 =[] ns = [] def animate(i): as.append(sin(n)) ns.append(n) ax1.plot(np.array(ns),np.array(as)) while true: fig1 = plt.figure() ax1 = fig1.add_subplot(1,1,1) ani1 = animation.funcanimation(fig1, animate, interval=1) n = n + 0.05 plt.show() however line updates (as in changes shape @ all) when try close window, can't find fix - how done? many in advance. you have change n inside animate add different point - add same point don't see difference. try print(ns) inside animate in code. import matplotlib.pyplot plt import matplotlib.animation animation math import sin n = 0 = [] ns = [] # ----- def animate(i): global n ns.append(n) as.append(sin(n)) ax1.plot(ns, as) n += 0.05 # ----- fig1 ...

fortran - Why mpifort wrapper is not found after installing mpich and openmpi? -

i need compile program uses mpifort wrapper create executables files multiporcessor usage. (opentelemac) i have tried install mpich , openmpi wrapper doesn't seem work. using gfotran perfom operations. could explain me how installed? i using ubuntu 14.0 lts.

server - (Python) How can I receive messages in real-time without refreshing? -

i have followed tutorial youtuber under name of drapstv. tutorial made in python 2.7 , makes networked chat using udp. converted python 3 , got work. however, way threading setup have send message(or press enter, blank message) refresh , receive messages other clients. here video incase may need it: https://www.youtube.com/watch?v=pkfwx6rjrai and here server code: from socket import * import time address = input("ip address: ") port = input("port: ") clients = [] serversock = socket(af_inet, sock_dgram) serversock.bind((address, int(port))) serversock.setblocking(0) quitting = false print("server , running far.") while not quitting: try: data, addr = serversock.recvfrom(1024) if "quit" in str(data): quitting = true if addr not in clients: clients.append(addr) print(time.ctime(time.time()) + str(addr) + ": :" + str(data.decode())) client in clients: ...