How to get/set vertical scroll filter property in OBS using C++? - c++

It is necessary to get/set the value of the vertical speed property. The verticalSpeed property has a value of 500 (the maximum value of the slider), but in OBS I manually set 35.
How to get exactly the value 35?
A second question, how can I see all the available filter properties?
obs_data_t* source = obs_get_source_by_name("SOURCE_NAME");
obs_data_t* filter = obs_source_get_filter_by_name(source, "FILTER_NAME");
obs_data_t* settings = obs_source_get_settings(filter);
vspeed = obs_data_get_int(settings, "verticalSpeed");
Thank you for any help!

Ok, there is an GetSourceFilterInfo function that returns a list of filter properties.
Speed is a parameter speed_x and speed_y.
https://github.com/Palakis/obs-websocket/blob/4.x-current/docs/generated/protocol.md#getsourcefilterinfo

Related

How to limit a max value in a cell?

I am setting up a new spreadsheet in google spreadsheets and I need to set a max value because it can surpass that number.
I am currently using this formula -> =SUMPRODUCT(D17:D33) and that sum can be more than 50, and if that's true, I want to limit to 50.
Any tips?
Please try:
=min(50;sumproduct(D17:D33))
try something simple like:
=IF(SUMPRODUCT(D17:D33)>50; 50; SUMPRODUCT(D17:D33))

compare two dictionary, one with list of float value per key, the other one a value per key (python)

I have a query sequence that I blasted online using NCBIWWW.qblast. In my xml blast file result I obtained for a query sequence a list of hit (i.e: gi|). Each hit or gi| have multiple hsp. I made a dictionary my_dict1 where I placed gi| as key and I appended the bit score as value. So multiple values for each key.
my_dict1 = {
gi|1002819492|: [437.702, 384.47, 380.86, 380.86, 362.83],
gi|675820360| : [2617.97, 2614.37, 122.112],
gi|953764029| : [414.258, 318.66, 122.112, 86.158],
gi|675820410| : [450.653, 388.08, 386.27] }
Then I looked for max value in each key using:
for key, value in my_dict1.items():
max_value = max(value)
And made a second dictionary my_dict2:
my_dict2 = {
gi|1002819492|: 437.702,
gi|675820360| : 2617.97,
gi|953764029| : 414.258,
gi|675820410| : 450.653 }
I want to compare both dictionary. So I can extract the hsp with the highest score bits. I am also including other parameters like query coverage and identity percentage (Not shown here). The finality is to get the best gi| with the highest bit scores, coverage and identity percentage.
I tried many things to compare both dictionary like this :
First code :
matches[]
if my_dict1.keys() not in my_dict2.keys():
matches[hit_id] = bit_score
else:
matches = matches[hit_id], bit_score
Second code:
if hit_id not in matches.keys():
matches[hit_id]= bit_score
else:
matches = matches[hit_id], bit_score
Third code:
intersection = set(set(my_dict1.items()) & set(my_dict2.items()))
Howerver I always end up with 2 types of errors:
1 ) TypeError: list indices must be integers, not unicode
2 ) ... float not iterable...
Please I need some help and guidance. Thank you very much in advance for your time. Best regards.
It's not clear what you're trying to do. What is hit_id? What is bit_score? It looks like your second dict is always going to have the same keys as your first if you're creating it by pulling the max value for each key of the first dict.
You say you're trying to compare them, but don't really state what you're actually trying to do. Find those with values under a certain max? Find those with the highest max?
Your first code doesn't work because I'm assuming you're trying to use a dict key value as an index to matches, which you define as a list. That's probably where your first error is coming from, though you haven't given the lines where the error is actually occurring.
See in-code comments below:
# First off, this needs to be a dict.
matches{}
# This will never happen if you've created these dicts as you stated.
if my_dict1.keys() not in my_dict2.keys():
matches[hit_id] = bit_score # Not clear what bit_score is?
else:
# Also not sure what you're trying to do here. This will assign a tuple
# to matches with whatever the value of matches[hit_id] is and bit_score.
matches = matches[hit_id], bit_score
Regardless, we really need more information and the full code to figure out your actual goal and what's going wrong.

Remove blanks at ends of DataVisualization chart x axis

I am using Microsoft's DataVisualization.Charting.Chart, and I have integer values along the X axis, using line-style graphs. However, the chart is adding an extra blank item at the beginning and end of the x-axis, with no value labels to explain what they are.
How can I remove these empty items and make the lines go right up to the ends?
Use the IsMarginVisible property of the xaxis. I believe that will do the trick.
To test this, I changed one of my own charts to be a line chart and then set the value in the code:
ReactivityChart.ChartAreas(0).AxisX.IsMarginVisible = False
Tell me if this is what you were hoping to get or if I have totally misunderstood the question:
(note that I do not have a high enough rep to post this image)
http://www.rectorsquid.com/chartmargintest.gif
You should set the Maximum and Minimum properties in ChartArea.AxisX, e.g. :
this.chart1.ChartAreas[0].AxisX.Minimum = 0; // if your minimum X = 0
this.chart1.ChartAreas[0].AxisX.Maximum = 100; // if your maximum X = 100
In this way, your chart area will show only the values between Minimum and Maximum.

OpenOffice.org/LibreOffice Calc macro: is a cell's content currently overflowing?

I have a bunch of cells whose font size I'd like to tweak if their content is overflowing, until it all fits. I'd like to write a macro to do this, unless there's a conditional formatting or other formulaic way of doing it. Is there a property that tells whether a cell is overflowing? If so, what is it?
'open office 3
'get current document
oDoc = ThisComponent
' get first work sheet
oSheet = oDoc.getSheets().getByIndex(0)
'first cell in the work sheet
Cell = oSheet.getCellByPosition(0, 0)
MsgBox Cell.CharHeight
Happy Coading :))

MSchart label inside chart area

Can somebody please tell me how can i show the Total Collection on MSChart
You can use chart.Annotations property to get a similar result.
For example with the following code (located after filling the chart):
var ann = new RectangleAnnotation();
ann.Text = "Total Collection" + Environment.NewLine + "250 Billion";
ann.IsMultiline = true;
ann.AxisX = this.chart1.ChartAreas[0].AxisX;
ann.AxisY = this.chart1.ChartAreas[0].AxisY;
ann.AnchorX = 9; // as you can see from the image below,
ann.AnchorY = 41; // these values are inside the range
// add the annotation to the chart annotations list
this.chart1.Annotations.Add(ann);
I got the following result:
N.B.:
there are a lot of annotations types (CalloutAnnotation, EllipseAnnotation...) and they have a lot of properties to change styles and behaviors. You can even set a property to allow annotation moving (i.e. AllowMoving=true).
Have a look to annotation properties through intellisense or MSDN.
You can set the property IsDockedInsideChartArea to true. You will also need to specify which ChartArea the legend is docked to, and set the position property to Auto.
legend.IsDockedInsideChartArea = true;
legend.DockedToChartArea = "ChartArea1";
There are more information about this and other legend properties here.