i use StarUML for 2 weeks now. I can't find the option for showing "in" in the methods parameters.
Is there any option?
I should look like this:
-foo(in param1:String[0..3], in param2:int = 0): long
Thank you!
Well, not knowing StarUML but the UML 2.5 spec says on p. 108
<direction> ::= ’in’ | ’out’ | ’inout’ (defaults to ’in’ if omitted).
I downloaded StarUML (4.0.0) and the direction of a parameter is not shown in a class diagram when its direction is in, contrarily to the directions out and inout whose are shown.
Is there any option?
I didn't found an option to change that behavior and force to show the direction when it is in.
Example where the parameter p_in has he direction in, p_out the direction out, p_inout the direction inout and there is a parameter having the direction return, and I show the menu Format for the class :
Related
I would like to check with code like this:
func _input(event):
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
spawnTower(event.position)
if there is something at the current mouse position, eg. enemies, other towers, terrain etc. and only if the point of interest has no collision, spawn a tower.
I did try to tackle this from the opposite site: have each collision shape signal when mouse enters/leaves the collision shape.
Wanting to add maybe up to 20 towers and potentially 100ish enemies this seems to be rather wasteful.
A hint for a better approach would be highly appreciated.
Kind regards, Jan Martin
Well, I am sorry, maybe this is helpful for other or at least a future me.
So here is my solution:
First: add a RayCast2D, no code in script required, make sure to check "Collide With: Areas" in the Inspector.
Second: Add some code to main script like:
func checkForCollision(position: Vector2):
get_node("RayCast2D").position = position
get_node("RayCast2D").cast_to = Vector2(0,0) # sets the length of the ray to 0
get_node("RayCast2D").force_raycast_update()
print($RayCast2D.is_colliding())
print($RayCast2D.get_collider ( ))
return $RayCast2D.is_colliding()
this returns a boolean and prints some additional info.
To verify activate "Visible Collision Shapes" in the "Debug" drowdown.
Regards Martin
I notice that there is a line that said
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
in RcppExport.R.
But I wonder if there is the possibility that I could edit RcppExport.R by hand?
For example, I want to give a default value to one of my input a parameter.
Thank you!
You can set a default value the standard way, again following what both languages involved permit (i.e. if you set one, all following args need one too per C++ rules):
> Rcpp::cppFunction("double mySum(double a, double b=10) { return a+b; }")
> mySum(4)
[1] 14
> mySum(4,5)
[1] 9
>
More generally speaking, and as this is your third somewhat basic Rcpp question in the space of 24 hours, could I suggest the Introduction to Rcpp vignette, along with the other vignettes and maybe a look around the Rcpp Gallery ?
I'd like to do something like this:
These are the problems:
1. Too much concrete
2. Too few plants
...
This was also stated in Problem 1 and Problem 2.
The "Problem 1" and "Problem 2" should be links to the list above.
Output
syntax
These are the problems:
. [[prob1, Problem {counter:prob}]] Too much concrete
. [[prob2, Problem {counter:prob}]] Too few plants
This was also stated in <<prob1>> and <<prob2>>.
Explanation
prob1 and prob2 are IDs for the problems. You can freely choose them. E.g. prob_concrete and prob_plants. That way they would be easier to use.
{counter:prob} is the syntax for counting the counter called prob. You can freely choose the countername. (See "Counters" of the documentation)
Problem {counter:prob}: This is the part, that defines, how the reference is shown, when used (see image above).
I am attempting to place latex-style math formulas into a haskell diagram.
The documentation pages
http://projects.haskell.org/diagrams/doc/manual.html#essential-concepts
and
http://projects.haskell.org/diagrams/doc/tutorials.html
suggest that one can use something called 'mathjax' to achieve this.
Is there an explanation or example somewhere of how to actually code this?
Attempting to follow the documentation at those links, my best guess for how would be something like:
mathDiagram :: Diagram B
mathDiagram = stroke $ textSVG "`2 + \sqrt{\pi}`:math:" 1
But this of course gives an error:
induction.hs:13:35: error:
lexical error in string/character literal at character 's'
You can do this using the diagrams-pgf backend. Just use the text function and put dollar signs around your text. Also, see here for an explanation of how to include diagrams in a LaTeX document: http://projects.haskell.org/diagrams/doc/latex.html .
I want to make a color map on vtkstructuredgrid and I need the colors to be interpolated between cells. The other option is using point data but when ever I use
structuredgrid->PointData()->SetScalars(Floatarray);
it says I cant have a pointer to a incomplete class type.
Any help would be greatly appreciated.
Your approach should work...
However, PointData is not a method, for the vtkStructuredGrid class: you should avoid (), and that's the reason for the error (Pointer to incomplete class type is not allowed).
Moreover, PointData is protected, in the "standard" definition of vtkStructuredGrid, and you should derive the entire class to access it from your code.
Before trying that, by the way, can you try with
structuredgrid->GetPointData()->SetScalars(Floatarray);
?
It should work too (not sure about the parameter type passed to SetScalar(), BTW).