reset Line_position Attribute of Stream in Prolog - stream

I want to reset the position of current stream in Prolog by changing the line_position attribute of Position in stream_property. How can I do it?

Related

MQL4 Object to buffer for reading

I'm quite new to mql4 coding and ran in some issues.
I am using PINS in combination with the AEX dashboard for mt4 to manage trades from my indicator, this indicator has a buffer (12) which the value is 1>long -1>short. I am using JagzFX Onepin which allows me to set buffer values for trades, but need a dedicated buffer for long/short. My question is, I want and indicator (simple) that converts objects placed on chart (long arrow/short arrow) convert to buffer values so JagzFX Onepin can read the signals.
What would be code be for this?
JagzFX onepin:

How can I compare current value in my stream with previous value in tickscript?

I am working on kapacitor alerts to generate alerts on data in influxDB. I am receiving a new value from the stream when a request has been made. I want to compare the current value in my stream I received with the previous value I received just before it to see if current value is greater than previous value or not. If it is greater than previous value, then I want to generate an alert on chronograf using kapacitor and tickscript.
How do I achieve this in tickscript? Any help is highly appreciated. I am new to tickscript.
Have you tried https://community.influxdata.com
Essentially you create two streams and using offset and windows you can compare them using eval with if condition.
Have you attempted writing a tickscript?

Can AudioKit sequences be changed individually and played back as a single track?

I'd like create a class/struct/other that contains each measure of a song, complete with independent tempo and beat count, then play the entire song back (with potential updates from user input). I'm only aware of how to change those variables on an AKSequencer track as a whole; is there a way to store that data independently and then have it play back as one? And keep coherence between the measures so as not to "jump" between them? Thanks!
AKSequencer is not good at setting loop length on the fly, but it is totally fine for adding to or re-writing the contents of a track while the sequencer is running. This includes tempo events.
Why don't you set the length to something arbitrarily long, and string together your MIDI events measure after measure without ever looping? Keep track of how many beats have been written so far, and just keep adding after that point. Doing this while the sequencer is running should be no problem. You could even automate writing the next bar by triggering a callback function near the end of each measure getting it to write the next segment (which could be selected or 'cued up' at run-time). You can schedule the tempo events with addTempoEventAt(), with the starting point for the next segment.
When your user stops the sequence, clear the track(s), reset the tempo, rewind the sequence and start over.

Getting the current index in the input string (flex lexer)

I am using flex lexer. Is there a way to (1) get the current index in the input string (2) jump back to that index in a future time point?
Thanks.
It's fairly easy to maintain the current input position. When any rule is matched, yyleng contains the length of the match, so it is sufficient to add yyleng to the cumulative length processed. Assuming you are using flex, it is not necessary to insert the code directly into every rule action, which would be tedious. Instead, you can use the YY_USER_ACTION macro:
#define YY_USER_ACTION input_pos += yyleng;
(This assumes that you have defined input_pos somewhere, and arranged for it to be initialized to 0 when the lexical scan commences.)
This will lead to incorrect results if you use REJECT, yymore(), yyless() or input(); in all of these cases, you will have to adjust the value of input_pos. For every call to yymore(), you need to subtract yyleng from input_pos; this will also work for REJECT. For a call to yyless(), you can subtract yyleng before the call and add it back after the call. For each call to input(), you need to add one to input_pos.
Within a rule, you can then use input_pos as the position at the end of the match, or input_pos - yyleng as the position at the beginning of the match.
Returning to a saved position is trickier.
(F)lex does not maintain the entire input in memory, so in principle you would need to use fseek() to rewind yyin to the correct place. However, in the common case where yyin has not been opened in binary mode, you cannot reliably use fseek() to return to a computed input offset. So at a minimum, you would have to ensure that yyin was opened (or reopened) in binary mode.
Moreover, it is not in general possible to guarantee that whatever stream yyin is attached to can be rewound at all (it might be console input, a pipe, or some other non-seekable device). So to be fully general, you might have to use a temporary file to store data read from the stream. This will create additional complications when you attempt to reread previous input, because you will have to switch to the temporary file for reading until it is finished, at which point you would have to return to the main file. Creative use of yywrap will simplify this procedure.
Note that after you rewind the input stream -- whether or not you switch to reading from a temporary file -- you must call yyrestart() to reset the scanner's input buffer. (This is also a flex-only feature; Posix lex does not specify the mechanism by which you inform the scanner that its buffer needs to be reset, so if you are not using flex you will have to consult the relevant documentation for your scanner generator.)

ReportBuilder 7.x - Controlling Print to File at Print Time

Using ReportBuilder 7.X
Question
Is it possible to Control Print to File.
I need to change the Length of a field at print time
Example:
label2
In the setup - I set its length to 800 which is the max possible this field should ever be.
However, in many cases the record is less than that and i need to set it to the calculated size before printing to file.
Is this possible?
Is it possible to control any portions of this Print to file...at print time (before Print, after print)?
Are the objects avaiable?
We are registered users of the 10.x and above i believe, but have still not gotten around to recompiling are application in Delphi 2009 and the new ReportBuilder....so, that is not an option at this point.
Thanks
Shane
You can try to use the OnDataChange event of the tDataSource that you are using to link your data to your report. This event fires when the current record in the associated dataset changes. In that event, adjust your label to the size for the current record.
i solved this! Each control has a saveLength property. I can just use a global variable that can change at any time (controlling length of entire record). Then just before i print he label, i can set its saveLength property
thanks to all who responded though

Resources