on-the-fly

Parse and plot data received from log-file on-the-fly

独自空忆成欢 提交于 2020-01-14 02:58:34
问题 I want to create a Perl (or Bash) script to create and plot data on-the-fly. That means I want to extract data from a log-file file.log , ideally don't write a tmp-file (if it's only possible with a tmp-file, this would be fine too) and plot with Gnuplot. As the logfile is growing, I want to see the additional information in the plot. See this question for similar topic. For Perl, what I have so far is this script: #!/usr/bin/perl use strict; use warnings; my $path = "file.log"; my @grepped;

JQuery live or something similar with .change()?

橙三吉。 提交于 2020-01-02 05:43:09
问题 I want to do this: http://docs.jquery.com/Events/live#typefn Only .live() doesn't support the change event- any ideas for work arounds? Need to bind a function to some on-the-fly DOM elements, but not until change. 回答1: Note: jQuery 1.4 now supports the live function for all normal events. It didn't work with IE8 until recently, but I believe this is fixed with jQuery 1.4.2. See this resolved jQuery ticket: IE8 DOES NOT SUPPORT THE CHANGE EVENT WHILE USING LIVE 回答2: LiveQuery plugin supports

In Fortran, how to write backward from a file to another file by blocks of line from bottom to top

时光总嘲笑我的痴心妄想 提交于 2019-12-24 20:15:35
问题 I have an ASCII file that looks like: ____________________________________________ Header1 ... Header2 ... Header3 ... block(1)data1 block(1)data2 block(1)data3 block(1)data4 block(1)data5 block(1)data6 block(2)data1 block(2)data2 block(2)data3 block(2)data4 block(2)data5 block(2)data6 ... block(n)data1 block(n)data2 block(n)data3 block(n)data4 block(n)data5 block(n)data6 ____________________________________________ I would like to convert it into an ASCII file that looks like: ______________

How to create a method out of the text file?

扶醉桌前 提交于 2019-12-23 06:13:34
问题 I have a text ( .txt ) file that contains Java code! I want to create a method that includes this Java code and then call that method through the program. Can anybody suggest a way to do this? 回答1: let consider this example what it does actually load the source code, compile and execute the java code by simpler program by using JavaCompiler API. 回答2: Use the JavaCompiler. It can compile code from a String , so I'm sure it could handle code from a text file. Do you think instead of putting it

Refresh slidejs

自古美人都是妖i 提交于 2019-12-21 05:12:10
问题 I'm using slidejs from http://www.slidesjs.com/ and I wanted to refresh the list of images, because I need to add and remove images on the fly. Is there any way to do this? I've tried to use the delete $.fn.pluginName but no luck. Thanks 回答1: I recently had the same issue and manage to solve it by changing the plugin. Here's my solution: Add these following lines before Plugin.prototype.init = function() { : Plugin.prototype.refresh = function (number){ var $element=$(this.element); var _this

Read XML file while it is being written (in Python)

拥有回忆 提交于 2019-12-20 04:13:43
问题 I have to monitor an XML file being written by a tool running all the day. But the XML file is properly completed and closed only at the end of the day. Same constraints as XML stream processing: Parse an incomplete XML file on-the-fly and trigger actions Keep track of the last position within the file to avoid processing it again from the beginning On answer of Need to read XML files as a stream using BeautifulSoup in Python, slezica suggests xml.sax, xml.etree.ElementTree and cElementTree .

Defining a class while a Java application is running

≯℡__Kan透↙ 提交于 2019-12-17 23:37:30
问题 In Java, is it possible to create a class definition on the fly while an application is running, and then create an object of that class? For example, a running application would read in a text file that contains a list of class members to include in the new class. The application would then define a class definition based on the list of members, and then insantiate it. 回答1: Yes its possible to do so in theory your class file is byte code which is at the end a byte array! you can then use the

modify a running python program

≡放荡痞女 提交于 2019-12-13 12:57:24
问题 I launched a python program with many nested loops, and the program will take days. I just realized that one of the loops values is wrong and makes a infinite loop. I don't want to restart the program from zero, is there a way to interrupt the current program and modify the loop range so it will work properly and also if it was trapped with the infinite loop to break it? Many thanks for your help. 回答1: If the program saves its state or its results from time to time, you could add a logic

How to sum ifelse statements on the fly with [R]

久未见 提交于 2019-12-12 04:29:36
问题 I have a r conundrum and would be very grateful of any assistance please. I need to write a piece of code that requires to be written one line to fit with a larger automated process. I have supplied some dummy data to help illustrate. I have three ifelse statements that return 1’s or 0’s. I need to sum these 1’s and 0’s yet because of other inherited constraints in my real data I can’t refer to their output ‘and then’ sum them. I ‘need’ to sum them on the fly. To be explicit… I cannot

Specman: Error in on-the-fly generating of list of lists with all different values

╄→尐↘猪︶ㄣ 提交于 2019-12-11 13:46:55
问题 I try to generate on-the-fly list of list of uint ( my_list_of_list ) with all different values (I have a variable num_of_ms_in_each_g : list of uint , that keeps lengths of every list inside my_list_of_list ): var my_list_of_list : list of list of uint; gen my_list_of_list keeping { for each (g) using index (g_idx) in it { g.size() == num_of_ms_in_each_g[g_idx]; for each (m) using index (m_idx) in g { // Error in the next line: m not in it[0..g_idx-1][0..num_of_ms_in_each_g[g_idx]-1]; m not