I'm trying to use TracedPath to make a curve in manim (CE v0.10), which I then want to manipulate (move around, rotate, etc.). The problem is, the tracing continues once I start moving the curve and I don't want it to. Does anyone know how to turn the tracing off? Any help would be greatly appreciated (this is the last issue I need to solve to finish my video). Here is some sample code:
class TracedPathProblem(Scene):
def construct(self):
dot = Dot(color=RED)
trace = TracedPath(dot.get_center,stroke_color=RED)
self.add(dot,trace)
self.play(dot.animate.shift(RIGHT),run_time=2)
path = trace.copy()
self.play(path.animate.shift(2*UP+RIGHT)) #do not want tracing here
self.wait()
Issue solved. Benjamin Hackl gave me a solution: path = trace.copy().clear_updaters()
myPort = new Serial(this, Serial.list()[32], 115200);
what's wrong with that code?
Any suggestion would be appreciated
Notice the Console output of printArray(Serial.list()).
You have a single serial port "COM4" at index 0.
Any index higher than that (e.g. 32) is out of the valid array index bounds.
The code you're using has a helpful comment:
// if you are a Windows user, please change Serial.list()[your number]
Simply swap the 32 for a 0 and that should do it.
Try to read and understand the code your using: imagine what the code your reading would do and how it run, then actually run it and compare your assumptions to the actual behaviour. Use the Processing reference where you're not familiar. This will help you a lot as a programmer.
For more details see Processing Serial reference.
I have this simple DLV program consisting of few predicates and derivations rules. One of the rules is not being activated and I have no clue why since apparently all predicates exist. I have to admit I am no expert in DLV and a bit rusty since the last time I used it so please forgive me if this is too obvious :-/
Among others, I have this rule:
knows(ps, chunk(v, ps, pd)) :- value(v),
knows(ps, v),
connected(ps, pd).
And here you can see what I get after executing the code:
./dlv -nofinitecheck model.edb rules.idb
{participant(p1), participant(p2), participant(p3), value(v1),
value(r1), value(v2), value(r2), value(v3), value(r3),
connected(p1,p2), connected(p1,p3), connected(p2,p3), knows(p1,v1),
knows(p1,r1), knows(p2,v2), knows(p2,r2), knows(p3,v3), knows(p3,r3)}
Since I have "value(v1)" and "knows(p1,v1)" and "connected(p1,p2)", I was expecting the output of the program should contain "knows(p1, chunk(v1, p1, p2))".
Can anyone explain me why this is not happening?
Edit: I have removed all rules and created just this single one
chunk(v, ps) :- value(v), participant(ps).
But this rule is not being activated either! What's the problem? I have tried the simplest one:
chunk(v) :- value(v).
and no activation. What am I missing?
OK. I Just realised of my stupidity. The problem is I am using lowercase letters for the variables rather than capitol letters... Sorry, as I said I am rusty!
So, just for the record. Rather than chunk(v) :- value(v) it should be something like chunk(V) :- value(V)
does anybody knows how to handle connection lost situation in exmpp library?
Any examples are welcome!
So, all you have to do is to add condition in receive loop. Something like this:
receive
% Here is you code
{stream_error,'system-shutdown'} ->
do_something;
% Here is you code
end.
M-p and M-n do not seem to work in rinari-console, when they should iterate the previously-issued commands list. Does anyone know how to fix this?
Maybe some other mode interferes with your keybindings? Try checking with M-h k and then entering M-p or M-n. According to the Rinari docs (C-h m) comint-next-input and comint-previous-input are also bound to C-down and C-up, maybe those work for you.