Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/23/2011 in all areas

  1. If you feel the need for speed there is one more step you can take. It obfuscates the process a bit, but you can generate a lookup table which is indexed by the byte array. Simply put true at values which correspond to whitespace and index it. VI attached below. (I tend to use the version I posted earlier because I can make the lexical class a control to trim more than whitespace, but this seems like a unitasker). Darin2.vi
    3 points
  2. This OpenG Review is now closed. See Summary Post here. Please start a new thread to discuss new changes to this VI. Community, This is the integration of ShaunR's Fast Trim to OpenG's Trim Whitespace function. Please review the code and submit all comments below. On testing PC the new Trim Whitespace VI is >3x faster than the native version and ~5x faster than current OpenG version. Aside from the algorithm change the VI is now a subroutine (like natvie version). The new interface supports an additional argument Remove non-printable characters (False), see BD for further comments. Kind regards Jonathon Green OpenG Developer Trim Whitespace (String) 1.vi TEST - Trim Whitespace (Performance).vi TEST - Trim Whitespace 1.vi
    1 point
  3. I can't say I'm a fan of that method. Each level of the hierarchy then maintains its own DVR. Worse is you can't enforce that you're always dealing with a reference type. Once the class is extended, there's no contract keeping descendants from storing by-value data in their class data. Someone who's handed a wire several levels down the hierarchy has no way of knowing if they can branch the wire or not.
    1 point
  4. Considering that my math skills are roughly those of a 5th grader, I wanted to know where it came from. This wikipedia entry has the history and some details... http://en.wikipedia.org/wiki/Hearing_the_shape_of_a_drum This begs the question, can I smell the color of a fruit?
    1 point
  5. You cannot open a UDP port on a remote machine because UDP is stateless - there's no established connection. You supply the remote address at the time that you send data, and if the remote machine happens to be listening on that port then it might receive the data. The only reason to open a UDP port is to listen, not to send, and the address input exists for the case where a machine has multiple network cards and you only want to listen on one of them.
    1 point
  6. I have a similar version except that I use the Lexical Class comparison (which also sets my definition of white space). My guess (no hard data) is that it is a wee bit faster than the array search. Rearranging my code to match the above image gives me this. Also I would look at the result in your code when an all-whitespace string is trimmed at the end.
    1 point
  7. Can you file a bug report on this or post some (preferably simple) VIs that reproduce this issue and I'll file a report. I have an idea of one thing might be going wrong internally.
    1 point
  8. 1 point
×
×
  • Create New...

Important Information

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