What does the house symbol next to variables in LabVIEW mean? e.g. See below:
This means "local" - because it is visible and usable in the current VI scope (kind of a "house" or "home" for that variable). If you check icon of Global variables, they have icon of a "globe" - thus it means that their accessibility scope is the entire application.
Related
I am trying to model a part of my VUE app with UML. I used a class diagram to show the structure and a sequence diagram to show one specific behavior.
There are some things I am not sure about:
in regards to the class diagram: the Form copmonent imports the data criteria, whos criterium is passed to the child and the option to the grand-child. So each instance of the child FormItem holds one criterium of criteria and each instance of the grandchild BaseRadio holds one option of the options array. So the data flow is through the parent. Can I still relate criterium - FormItem and option - BaseRadio as indicated by the blue composition arrows?
in regards to the sequence diagram, my aim is to visualize the cross-component data flow and custom event communication with emitting events and passing props. I sketched these as synchronous messages, since they don't return anything but this feels weird?
are the functions called within one component supposed to be reflexive messages? (as shown in the sequence diagram for setoption(option):void for example). And I guess the presentation of computed properties integrationChance and integrationProspectPercentage as reflexive message is wrong, since they dont represent functions?
Here, the draft of the UML class-diagram sketching the VUE app:
And the sequence diagram:
And here the description of what this app does:
The data for the function is imported as a JSON Object criteria.
For each criterium (e.g. gender, age, etc.) criteria holds an object named criterium, which has a label and an array options. The options array holds an option for each attribute (male, female, etc.).
Each option has a name (e.g. male) and a correspondent value (e.g. 0).
The Form component imports the criteria object and two other components: FormItem and FormResultBar. The Form holds only one FormResultBar. For each criterium in criteria the form holds one FormItem and for each option the FormItem holds one BaseRadio button.
When the user clicks on a BaseRadio button, its computed property selectedValue emits an event to the FormItem, passing the value of the option that was clicked and the correspondent criteriumKey.
The FormItem component then sets the selected option (setOption()) and saves it (saveOption(option, criteriumKey) by emitting an event to the parent component Form and passing the parameters option and criteriumKey. In the Form component the saveOption(option, criteriumKey) saves the selected Option by storing it in the selections Object.
The selections Object holds all the selected options for each criterium. The computed property integrationChance in Form item then calculcates the integrationChance by adding all the values of the options stored in selections. The method integrationChancePercentage transform the logisitic regression value into percentages. The integrationChancePercentage is then passed as the prop “result” to the FormResultBar, where the result gets displayed.
You can find the implemented part of the application here.
The key question here is not whether UML is suitable for the job or not, but what do you want to show in your diagrams:
In this other question I have developed what relevant diagrams could be used for in a JS context with Electron. I think it may answer your question about which diagrams to use.
You have opted for a class diagram. It explains well the the internal structure based on classes and their relationships:
A Vue component can be represented by a class:
Components are reusable Vue instances with a name (source: Vue guide)
props may be shown it as an UML property:
Props are custom attributes you can register on a component. When a value is passed to a prop attribute, it becomes a property on that component instance. (source: Vue guide)
UML classes are usually represented with a box with 2 separators. The first part is the class name, the second part is for the properties and a third part are for operations. Since props can be accessed from other components, it seems better to give them a public accessibility in the class diagram (+ instead of -)
Computed properties could be shown as derived properties, i.e. with its name preceded by /:
(...) its value or values may be computed from other information. Actions involving a derived Property behave the same as for a nonderived Property. Derived Properties are often specified to be read-only (i.e., clients may not directly change values). But where a derived Property is changeable, an implementation is expected to make appropriate changes to the model in order for all the constraints to be met, in particular the derivation constraint for the derived Property. (source: UML specifications)
Your “methods” are operations in UML,.
I’m not a Vue expert, but I understand that “watchers” seem to be some special kind of methods.
More generally, I'd suggest to use a custom UML profile for Vue. It may define stereotypes for each of these kind of elements (e.g. «Vue component», «props», «computed») that would precede the name of the element or be above it. This could convey a more precise semantic, especially if there could be ambiguities (e.g. methods vs watchers).
Your narrative explains the interaction between components. This is best documented with a sequence diagram. Lifelines would be instances of components or props instances of a component, and messages exchanged between lifelines would correspond to Vue methods, and other means to exchange information.
I am trying to add different foreground colors using regular expressions for a method, property, and variable reference on Monaco editor using tokenizer.
Example:
Name="Hello"
var.Name()
var.Name
In these examples, Has anyone found a way to colorize "Name" differently based on how it is being used? In the first example, it is referenced as a variable. In the second example, it is referenced as a method of an object, and the third example is a property of an object.
Even though method, property, and variable are the same name, I want to colorize different foreground colors to "Name" using tokenizer on Monaco editor**.
Your suggestion would be greatly appreciated. Thanks in advance.
What you are after is called "semantic highlighting" (in opposition to syntax highlighting) and the monaco-editor component alone cannot do that.
I have to edit a document which has been tagged semantically.
Assume I have an HTML document where some or all paragraphs (or span) have been tagged with a specific class name, something like: <p class="bio"><span class="name">John</span><span class="surname">Doe</span>is a <span class="job">carpenter</span> living in <span class="place">York</span>.</p><p class="story">He was working at his bench when...</p>
I want to use a QTextEdit widget to edit such text (if possible).
Additional requirements are:
Each class should have specific graphic rendering (this should be easy using CSS).
Editing specific <span> should preserve class (i.e.: if I edit "John" -> "Jonathan" it should still have class="name").
I should be able to apply class to specific pieces of text (i.e.: select some text, open a context menu and select one of the possible classes).
Remove tagging from selection.
Serialize edited text (i.e.: walk the edited text, recognize class changes and be able to produce whatever markup I want).
Note classes can be contained one inside another (but not overlap partially); this means some piece of code has two (or more) classes.
Can this be achieved with standard means?
As far as I have seen QTextDocument and associated classes (e.g.: QTextFrame, QTextFormat, etc.) are geared toward visual representation (font style, color etc.) while I need some "logic" tagging that may or may not reflect in visual changes. I mean: text can be all in the same font/color/background, but moving cursor over it I should be able to list all classes active in that specific place (if any).
I am coding in PyQt5, if this is relevant.
The only (rather ugly!) way I seem to see to achieve this is to use QTextCharFormat's tooltip property to store class(es) of each QTextFragment. Is there a better option?
For anyone having the same problem:
QTextCharFormat has a property (named "Property") which can be used to hold arbitrary data.
You need to:
define your set of codes (higher than QtGui.QTextFormat.UserProperty to avoid clash with existing properties).
set with: format.setProperty(mycode, myvalue)
read back with: value = format.property(mycode)
Other Widgets have similar (but NOT identical!) mechanisms (e.g.: QStandardItem has a similar property called data)
IMPORTANT NOTE: if you are using PyQt there are severe restrictions in what you can store and safely retrieve (storing a QTextDocument in a QStandardItem.setData(doc, mycode) will not work reliably because only the reference will be stored and if the underlying python object is garbage collected you'll have a nice crash (SIGSEGV).
I am using mark t hughes view picklist custom control from open NTF.
Link to control on openNTF
I have set all the paramenters etc, however when I load the page with the control on, I get my custom error page, and the error below in my error logging database
Error on dialog1button5999 null property/event:
1:
Script interpreter error, line=1, col=35: [ReferenceError]
'compositeData' not found
compositeData.picklistButtonClass + " domfindmebutton5999"
This is trying to set the styleClass of a button in the custom control here:
<xp:this.styleClass><![CDATA[#{javascript:compositeData.picklistButtonClass + " domfindmebutton5999"}]]></xp:this.styleClass>
I am also definately passing this parameter is with the default code:
picklistButtonClass="button2"
I also followed the video Here to the letter, and still get exactly the same issue.
Has anyone come across this before or have any pointers as to where I should be looking to resolve it? Im not sure where to start, as all the instructions and video's explain how to complete the custom properties of the control, but there is never any mention of a need to actually modify any code WITHIN the custom control....
Thanks
(as a side note, I am using bootstrap, should this make any difference)
This is because of the theme definition. Look at the Mark Leusink's blog entry here. http://linqed.eu/2014/08/28/xpages-gotcha-modeconcat-in-your-themes/
If a theme has a "concat" definition, that will be computed at a very early phase. To concat values, it needs to compute the initial value. However, in some cases (e.g. Repeat, Custom control, etc.), the initial value cannot be computed at the page-load section.
For such cases, you can override the theme with a special themeId, as Mark suggested.
In Eclipse, you can focus on class XXX and press Ctrl+Alt+H, to get a call hierarchy showing everywhere that new XXX(...) is called.
In IntelliJ IDEA, I can only do this on each constructor separately, and I can't do it at all on the default constructor (invisible).
Is there a way in IDEA that I'm missing? (Ultimate 12.1.3)
If I'm understanding your question correctly - one way you can do this is to select the classname (instead of an individual constructor name) and press Alt+F7 (Find usages).
This will find all usages of that class - the "Found Usages" window that will be displayed is split up into expandable sections, one of which will be "new instance creation".
NOTE: if you can't see a New instance creation grouping, makes sure Group by usage type is enabled (the "funnel" looking icon in the screen shot below).
In IDEA 2017.2, it looks like this: