Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/06/2012 in all areas

  1. My lawyers, from the offices of Dewey, Cheatem and Howe, will be in touch...
    1 point
  2. If you’ll forgive me… Why does that work?!? With no loop iterations the code can’t pass the objects across and must output default values. OK, but the default value of a LabVIEW Object wire is a LabVIEW Object; how does the child class identity get passed across the void when the actual child-class objects do not? That doesn’t seem right at all. Another issue: aren’t all these object manipulating techniques rather obtuse code? Sort of LabVIEW alchemy? The uninitiated will be mystified as to why we are “preserving run-time class” or finding the path to a class in order to tell if A and B are the same type, let alone understand a zero-iteration loop. — James
    1 point
  3. Well I'm not a lawyer. It seems like a site has no authority to assert that donated code is public domain or any other license, unless the copyright holder (almost always the original author or in some cases her employer) has explicitly assigned the copyright to the site. It certainly could not do that retroactively, but it could make terms of use for the site which include some stipulation about the licensing of posted code. I think most sites are unwilling to do that since it's much harder legally than just saying "we have no control over what you choose to post, but copyright violations are forbidden to be posted". Another consideration is that the USA has the "Fair Use" doctrine, which is legally vague, but which could be used to defend against using copyrighted work which was posted with the intent of it being reused. Another consideration of copyright law is that the penalty for infringement is related to the economic damages, and I think it would be difficult for the copyright holder to claim damages if the code were posted by the author on a public web site.
    1 point
  4. There's a problem with your benchmarks: your benchmarks for MJE solution will vary depending upon the contents of the private data control of the class and which OS you're running on. The solution posted by ShaunR is going to be the stable option regardless of the contents of the class. The performance of the MJE method will vary greatly depending upon the private data control of the objects being compared. Going through the Preserve Run-Time Class primitive will require a new allocation every time (because the wire starts with an instance of LabVIEW Object, copied from the constant, which is deallocated in favor of a new handle pointing to an object of the middle terminal's class). On a desktop system, that handle will just be assigned to point at the default value, since LV shares only one copy of the default value, but on real-time targets, that would be a full allocation (because everything has to be preallocated to avoid jitter in the event that the object gets passed into a deterministic section). Then we get to the equals primitive. In the case where the types do not match, you'll get a very quick answer because the type pointers can be compared. But if the types do match, if the class contains non-trivial data fields, you'll have the time overhead of actually comparing the fields. On a desktop system, again, we'll notice that they both point to the default value and you'll get a quick answer, but on real-time, we'll actually run the comparison proc to see if the values come out the same. Now, if you're on a desktop system, the MJE, as I described above, does really well. I am guessing that this one would do even better: Yes, that's a hardcoded zero iteration For Loop with the class wires wired across using tunnels, not shift registers. It does the job. I haven't benchmarked it -- you're free to do so -- but it avoids the type comparison work entirely that the Preserve Run-Time Class primitive does. Having said all of that, even on RT, I would probably not use the stable solution because it requires the construction of those interim variants, which is a memory allocation. I just figured you should be aware of the trickiness of benchmarking this stuff. On a completely unrelated topic, MJE, you can replace the error generation code you've got with this: It's a lot simpler. The VI is in the palettes near the General Error Handler.vi. Oh... and the path solution does have one problem: if a class has never been saved, the path will be empty.
    1 point
  5. Hi, I posted a new blog post on worker pool design pattern to expressionflow. Worker pool - a design pattern for palalle task execution in LabVIEW if the link above doesn't work, please copy paste the address below to your browser: expressionflow.com/2009/11/04/worker-pool/ Cheers Tomi
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.