refresh

Update Lines in matplotlib

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 03:14:32
问题 I have a graph with multiple data sets on it. I need to continually redraw these lines, each separately, as the data is updated. How can I delete and reestablish it repeatedly, preferably without having to delete the entire graph and redraw all of the lines on it every time? 回答1: #!/usr/bin/env python import time from pylab import * ion() # turn interactive mode on # initial data x = arange(-8, 8, 0.1); y1 = sin(x) y2 = cos(x) # initial plot line1, line2, = plot(x, y1, 'r', x, y2, 'b') line1

Output to jTextArea in realtime

南楼画角 提交于 2019-12-02 02:53:11
I have some code which takes a few minutes to process, it has to connect to the web for each string in a long array, each string is a url. I want to make it so that everytime it connects, it should refresh the jtextarea so that the user is not staring into a blank page that looks frozen for 20 min. or however long it takes. here is an example of something i tried and didnt work: try { ArrayList<String> myLinks = LinkParser.getmyLinksArray(jTextArea1.getText()); for (String s : myLinks) { jTextArea2.append(LinkChecker.checkFileStatus(s) + "\n"); } } catch (IOException ex) { JOptionPane

How to refresh the data in pivot item after updating data through xaml UI?

南楼画角 提交于 2019-12-02 02:30:32
问题 Hello all i am working on windows phone 8 app, i am facing a issue, i am loading some data in my pivot item and if user tap a user control opens and i modify the data through user control. Data is saving into the database successfully but my pivot item is not updating immediately. i am using observable collection as following. ObservableCollection i used like following in mypivot.xaml.cs file ObservableCollection<MyWrapper> saveinfo = new ObservableCollection<MyWrapper>(); public

How to refresh the data in pivot item after updating data through xaml UI?

蹲街弑〆低调 提交于 2019-12-02 01:58:44
Hello all i am working on windows phone 8 app, i am facing a issue, i am loading some data in my pivot item and if user tap a user control opens and i modify the data through user control. Data is saving into the database successfully but my pivot item is not updating immediately. i am using observable collection as following. ObservableCollection i used like following in mypivot.xaml.cs file ObservableCollection<MyWrapper> saveinfo = new ObservableCollection<MyWrapper>(); public ObservableCollection<MyWrapper> savedWordBankCollection { get { return saveinfo; } } //MyWrapper class structure

Tkinter: How to make Tkinter to refresh and delete last lines?

蹲街弑〆低调 提交于 2019-12-02 01:30:36
Problem is: Clock hands in Tkinter flashes because I use w.delete , but if i don't use it then clock hands duplicate.. Please help. import Tkinter as tk; import time from math import cos,sin,pi import sys root=tk.Tk(); root.title("Clock") w = tk.Canvas(root, width=320, height=320, bg="#456", relief= "sunken", border=10) w.pack() size=300 def funA(): s=time.localtime()[5] m=time.localtime()[4] h=time.localtime()[3] w.update() degrees = 6*s angle = degrees*pi*2/360 ox = 165 oy = 165 x = ox + size*sin(angle)*0.45 y = oy - size*cos(angle)*0.45 t = w.create_line(ox,oy,x,y, fill = "#ffc") degrees1 =

PHP Redirect that force refresh (CTRL+F5)

只谈情不闲聊 提交于 2019-12-02 00:00:49
问题 I have a page with an editable table. I need users to be able to edit this and then submit their changes. Everything works well until I redirect them to the same page with new content (relevant to their changes). However, they see the old content. If I press ctrl+f5 on the browser, they content gets updated. I was wondering if there is a way to force this. This is my php code which does not help force refreshing: header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header(

How to stop jQuery post page refresh

二次信任 提交于 2019-12-01 23:54:31
I am getting data from an MySQL database through PHP. I am sending the and getting the data from PHP using jQuery. Here is the code. $.POST("SubmitCode.php", $("#questionCodeForm").serialize(),'json').done(function(data) {}); Now the problem is that once I send this data the page refreshes. How can I stop the page refresh. If I delete 'json' then the page stops refreshing but the problem is that I want to get the json data without page refresh. How can I do this? -------------------------------------------after edit-----------------------------------------------------------------------------

jQuery ajax call in onunload handler firing AFTER getting the page on a manual refresh. How do I guarantee onunload happens first?

淺唱寂寞╮ 提交于 2019-12-01 21:28:57
I have a situation where on page unload I am firing a request to delete the draft of a user's work. This works fine until a user chooses to refresh the page, whereupon inspecting Chrome's network tab shows that Chrome is loading the new page before the ajax request is actually fired. The result is a new draft is created by the page load, and then deleted right away by the ajax call. Here is basically what I'm doing: window.onbeforeunload = function(){ if (pageUpdated){ return 'Are you sure you want to abandon this draft?'; } } window.onunload = function(){ $.ajax({ async: false, type: 'DELETE'

Confusion about Refreshing the UI in WPF

早过忘川 提交于 2019-12-01 21:21:36
问题 I have heard that this refreshes the UI but why so? Dispatcher invokes this empty action and thats it there is no call InvalidateMeasure() which would trigger the UI to re-measure and re-arrange and re-render inside the action. Where is here the measure and arrange process to update/refresh the UI? private static Action EmptyDelegate = delegate() { }; public static void Refresh(UIElement uiElement) { uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate); } Any help? EDITED: I

Refresh browser's page programmatically, from a .Net WinForms application

给你一囗甜甜゛ 提交于 2019-12-01 21:10:10
问题 From asp.net page, via ClickOnce deployment, a .Net WinForms application is started. At a certain point the WinForm application needs to refresh the web page it was started from. How could I do this? How could a .Net based windows application refresh a page that is already opened in a browser? 回答1: This is not easy to do in a way that is robust. Users may not be using IE, for example. The only thing you control and that is common to the web page and the windows app is your web server. This