Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shakeb #11

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Shakeb #11

wants to merge 9 commits into from

Conversation

segalmax
Copy link

Shake parameters additions, changes, bindings and tests.

if ( fscanf(par_file, "%d\n", &(ret->seq_first)) == 0
|| fscanf(par_file, "%d\n", &(ret->seq_last)) == 0
|| fscanf(par_file, "%d\n", &(ret->max_shaking_points)) == 0
|| fscanf(par_file, "%d\n", &(ret->max_shaking_frames)) == 0 )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going through the trouble of all the 'or's then we don't need a goto.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My logic is: If one of 'fcanf's returns 0 then the parameter was not read and it is considered an error.
What do I miss here?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. My problem is not twith the or, it's with the goto. The goto is there to avoid nesting, but with the short-circuit 'or' you don't nest so much, so you can do a simple if/else.

@yosefm
Copy link
Owner

yosefm commented Jun 13, 2015

parameters.pyx actually contains a bunch of changes to the multimedia stuff.

@segalmax
Copy link
Author

These are some minor changes in constructor's signature. Should I commit
these in a separate PR?

On Sat, Jun 13, 2015 at 8:25 PM, Yosef Meller [email protected]
wrote:

parameters.pyx actually contains a bunch of changes to the multimedia
stuff.


Reply to this email directly or view it on GitHub
#11 (comment).

@yosefm
Copy link
Owner

yosefm commented Jun 15, 2015

Yes, drop them from this PR, you can propose a general janitoring PR which includes this, later.


# now we have two identical ShakingParams objects (sp1 and sp2) for comparison
self.assertTrue(sp1==sp2)
self.assertFalse(sp1!=sp2)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between this line and the one before? Same for the following occurrence on lines 59-60.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison is performed through function defined in ShakingParams:

 def __richcmp__ (ShakingParams self, ShakingParams other, operator):  

The third parameter is integer value to indicate the operation performed: 2 for '=' , 3 for '!=' (you must refer to them separately).
For more info: http://docs.cython.org/src/userguide/special_methods.html#rich-comparisons

So in order to check the comparisons I must pass '==' as well as '!=' .

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. This is not trivial, better add a comment explaining it.

@yosefm
Copy link
Owner

yosefm commented Jun 15, 2015

Other than the line comments above, looks solid.

OpenU student added 3 commits June 17, 2015 18:34
…to testing_fodder in liboptv/tests

Add changes and corrections in response to Yosef's comments on pull request OpenPTV#11
These changes will be commited in a relevant branch.
@yosefm
Copy link
Owner

yosefm commented Jun 23, 2015

Same comment here on the testing_fodder directory: take only what you need to survive.
https://www.youtube.com/watch?feature=player_detailpage&v=G1CYg0vIygE#t=30

@yosefm
Copy link
Owner

yosefm commented Jun 23, 2015

Other than that, PR seems fine. Fix it and I'll do a PR to upstream.

alexlib added a commit that referenced this pull request Nov 11, 2015
Some improvements to multimedia code
@segalmax
Copy link
Author

Were all issues resolved in this PR or changes are still needed?

@alexlib
Copy link
Collaborator

alexlib commented Jun 28, 2016

I think this PR starts from some different point in history - I cannot test it anymore using
make verify

[ 36%] Built target optv [ 42%] Linking C executable check_fb clang: warning: argument unused during compilation: '-pthread' ld: library not found for -lcheck clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [tests/check_fb] Error 1 make[2]: *** [tests/CMakeFiles/check_fb.dir/all] Error 2 make[1]: *** [tests/CMakeFiles/verify.dir/rule] Error 2 make: *** [verify] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants