Before refreshing a control I'm setting the RaiseListChangedEvent property of its bindingsource to false then after the refresh I'll set it again to true and set ResetBindings to false.
What if the scenario will be like this:
set RaiseListChangedEvent = false in 100 times
then
set RaiseListChangedEvent = true in 100 times
set ResetBindings(false)
Will it cause any performance issue?
Related
Once I have an existing table in QuestDB, is there any way to check if the table has a designated timestamp and if yes, which column is it?
This is possible as of version 6.0 using tables() and table_columns(). The following is an example which returns the schema of a table, including which column is set as a designated timestamp:
table_columns('my_table')
column
type
indexed
indexBlockCapacity
symbolCached
symbolCapacity
designated
symb
SYMBOL
true
1048576
false
256
false
price
DOUBLE
false
0
false
0
false
ts
TIMESTAMP
false
0
false
0
true
s
STRING
false
0
false
0
false
For more information, see the documentation for table meta functions
There is no way as of 5.0.6 I believe. This is definitely a missing feature.
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
I have created four calculated columns that give True or False for a unique property ref in each row, based on the presence of a registered contact (CMS) on a list (Tele Open, Tele Closed, Written Open, Written Closed). I now need to assign a status to each property ref based on the combination of True False.
I am able to do this using a multiple nested IF AND statement in Excel but am confused about to do this in Power BI.
I haven't yet attempted to do this and need some advice on how to frame the statement, as I am not familiar enough with M Language.
'''
If -- ALL are FALSE = Not Yet Investigated
If -- Tele Open is TRUE = In Progress
If -- Tele Open is FALSE AND Tele Closed is FALSE AND Written Open AND/OR Written Closed is True = In Progress
If -- Tele Open is FALSE AND Tele Closed is TRUE = Closed
'''
The various combination of True False in the categories listed above will produce a Not Yet Investigated, In Progress or Closed status as above.
The basic syntax for a calculated column with an IF statement is
column = if [something] > 1 then [something] else [something else]
you can then nest statement using and and or
column = if [something] >= 1 and [something] <= 10
then "Low"
else if [something] >= 10 and [something] <= 20
then "medium"
else "high"
Hope that helps
I am having a Regex and I want the matches to be added to my previous List. The list (called "Items") has already some entries. (It got the entries from a listbox1 and added is now a datasource of the listbox1)
This is my source:
Dim Items As List(Of String)
<some other code here>
For Each Bam As Match In Treffer
If hashtagz = False Then
ListBox1.Items.Add(Bam.Groups(1).ToString)
ElseIf hashtagz = True And FirstHashtags = True Then
ListBox1.Items.Add(Bam.Groups(1).ToString)
ElseIf hashtagz = True And FirstHashtags = False Then
Items.Add(Bam.Groups(1).ToString)
Console.WriteLine(Bam.Groups(1).ToString)
End If
Next
The last part is important (the last if loop with hashtagz = true and Firsthashtags = False)
I also added the console.writeline to see what is going on. In the console, I get all the new scraped and correct information. In the Items list however, I just get a duplicate of what has been already stored in there instead of adding and updating my list with the new regex matches.
edit Additional information: The whole if condition is in a timer, so it runs again and again. At first it will add entries to a listbox. Then (now important!) it will do the Items.Add(Bam.Groups(1).ToString). It seems to add the new entries the FIRST time THAT part of the code gets executed, but after it is being run trhough again trhough a timer, it will just add the previous entries again and again
Dim Items As New List(Of String)
Dim hashtagz As Boolean
Dim FirstHashtags As Boolean
' Other code here
For Each Bam As Match In Treffer
Select Case True
Case Not hashtagz
ListBox1.Items.Add(Bam.Groups(1).ToString)
Case FirstHashtags
ListBox1.Items.Add(Bam.Groups(1).ToString)
Case Items.Contains(Bam.Groups(1).ToString)
' Already Exists
Case Else
Items.Add(Bam.Groups(1).ToString)
Console.WriteLine(Bam.Groups(1).ToString)
End Select
Next
After using more than 7 hours today (and a few hours yesterday, I am a newbie in VB) of testing, going through my code and building in some outputs to see where the problem is...
My concept is correct, there are no logical errors in the flow of my programm, as one can see from the console.writeline(Bam.Groups(1).ToString . I tested everything and ended up putting in a richtextbox and its like this now
For Each Bam As Match In Treffer
If hashtagz = False Then
ListBox1.Items.Add(Bam.Groups(1).ToString)
ElseIf hashtagz = True And FirstHashtags = True Then
ListBox1.Items.Add(Bam.Groups(1).ToString)
ElseIf hashtagz = True And FirstHashtags = False Then
Items.Add(Bam.Groups(1).ToString)
RichTextBox1.Text = RichTextBox1.Text + Bam.Groups(1).ToString & vbNewLine
End If
Next
The adding procedure seems to be looking correct with the richtextbox, but when I want to add to the Items list, it just gives out the duplicates of the previous entries instead of adding to it. The .add seems to work only the FIRST time running through that line of code, after the second time it just gives out the duplicate of the entries.
I am still trying to figure out WHY that is and I will trying to understand the posts above. Maybe someone else has also an explanation, jsut in case the others were wrong
Edit I have been experimenting still with all this, I have a function that grabs the last entry of my item list and prints out a part of it. When I do that, the print seems correct and updated. So it seems like the list IS actually being updated somehow since the "getting a part of the latest entry of list" is working and always updated. But when I want to show or save the content of the item list, that's when I get the duplicates and the updated and newest entries are not being shown!
Alright guys, I am back again after testing.
The code I posted above was correct. The real reason behind the mistake was in a few other parts of the code, which resulted in partially duplicated output of the entries of the list etc.
I lost track of the variables and the procedures my program was doing. Any hints or tips for me on how to keep track of the code on what it does and having everything in mind or how to properly structure code etc. so that I won't get lost again and again in the code?
This case can be closed, sorry for the inconvenience.
I have a set of 7 checkboxes on my winForm that allow the user to select which days of the week they want assigned with the order being created. I am trying to create the IF Statement that implements these checkbox decisions correctly. I have tried many combination of If, IfElse, and Select statement but all to no avail.
If cbMon.Checked = True Then
.WriteString("Monday")
If cbTues.Checked = True Then
.WriteString("Tuesday")
If cbWed.Checked = True Then
.WriteString("Wednesday")
If cbThur.Checked = True Then
.WriteString("Thursday")
If cbFri.Checked = True Then
.WriteString("Friday")
If cbSat.Checked = True Then
.WriteString("Saturday")
If cbSun.Checked = True Then
.WriteString("Sunday")
End If
End If
End If
End If
End If
End If
End If
That what i have so far that works the best. The problem though is that if i check "Monday, Tuesday, and Thursday" on the winForm...Monday and Tuesday will show up, but Thursday gets skipped because it obviously breaks out of the if statement. Any guidance?
The problem is that you should not be nesting your if statements.
In your example, any portion of code will only hit if the day before it (all the way up to monday) is checked.
Simply flatten out the if statements, and do not nest them, like so :
If cbMon.Checked = True Then
.WriteString("Monday")
End If
If cbTue.Checked = True Then
.WriteString("Tuesday")
End If
...etc...
If you want the users to select only ONE option, perhaps a dropdown or radio button list is more suitable rather than checkboxes.
do not use nesting
just simple if loop is needed here
Initialise an array
if monday
add monday to array
if tuesday checked
add tuesday to array
.
.
.
if sunday checked
add sunday to array
get the string by append all values in array with ','
Yes your problem is that you are nesting your if statements, which is why Thursday gets skipped because Wednesday proved to be false.
What you need to do is run a for loop that will go through each check box and check whether its checked value is true.