-
Posts
4,939 -
Joined
-
Days Won
306
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by ShaunR
-
-
I find it a bit bizarre that the link you posted keeps saying "even those in the U.S". It is a proposed U.S. law, is it not? Therefore it is "Only in the U.S".
But this is just the tip of the iceberg IMHO. It's not about IP or copyright. It is about control over the information to the masses and the excuse is IP/copyright. The quicker the US and Europe gets rid of it's NeoCons. The happier everyone will be.
-
1
-
-
Usually, each "module" will have it's own command queue and they will all use a common "status" queue rather than separate queues to feedback to the master.
The thing to bear in mind is the topology. Queues are "Many-to-one". So for the commands, you can have many modules/controllers/whatever placing commands on that one modules queue. In reverse, you also have a "many-to-one", but now it is many modules placing status info on the controllers queue.
Another way is to use a single "Control" notifier (a notifier is a "One-to Many") for the modules and each module filters the command sent. This has the advantage that you can "broadcast" to all modules things like Start, Stop, Pause etc which are global to all modules, but still enable defined commands for single modules which the module responds to. It has the downside that you can only have 1 command in the pipe at any-one time so for sequencing you have to arrange for some other mechanism. But the difference in this case is responsibility. The module is responsible for actioning the messages (shutting down, starting up etc) and the "Controller" just becomes the orchestrator. This is what I term "Autonomous Modules" and greatly simplifies the upper hierarchy at the expense of more complicated modules.
You can also use a combination of both. for example, I may have a command "Queue" but broadcast back information via a notifier (great for UI stuff)
-
I want to work on my own as a consultant like Val Brown and ShaunR as soon as possible.
Consultant? Me? Naaah. I work for a living
-
Disclaimer: I have 5 years of LV experience. I don't have any certifications (except CLAD) because my company values experience over certificates.
My disclaimer is that I currently have no LV certifications because my company is basically me, I don't need to present qualifications re: my programming to others for vetting (because I don't consult on LV). But I have been using LV since 98. So I've seen a lot of versions....
I haven't had any certifications for about 10 years now. There's plenty of code and entire applications I've written out there if people wish to judge my abilities (or not as the case may be). CVs and certs are no substitute for "been there, done that, look at the code". However, in the absence of such, they are the only measure.
-
To me it kinda makes sense. It is a symptom of having no way to destroy an object. The by-val way of creating a pseudo-destroy method is as you describe in No3 since you can clear the array which is a surrogate for destroying the objects. You then pray to the great god MemMan and hope that the garbage collection will get rid of allocations (or at the very least, reused). The by-ref is a way of achieving the same pseudo-destroy, since you can destroy a ref (and just ignore what it returns).
The difference in the destroying is that the owner is responsible for destroying the objects, rather than a function of whatever object you want to get rid of. In LV it's not a biggie because you have no control over de-allocations anyway, but in other languages you may have several different de-allocation procedures to satisfy that the owner may not be aware of.
-
Shaun, I think LAVA would be in the clear under the safe harbor provisions of DMCA. Now, if SOPA passes, LAVA would be screwed, so everyone call your reps and senators and tell them to stop that trainwreck. But assuming sanity prevails, it would only be the LAVA users who download the code and use it that would be open to lawsuit threat.
Well. I'm no expert on US law (nor care much about it) but to qualify for safe harbour policies in most countries, they require some sort of condemnation and clear statements that it will not be tolerated (this is what the T&Cs are for).
If I create an original work and post it to the NI forums I own the copyright and grant a perpetual license to NI that allows them to do what they like with my copyrighted work.
Nope. They can't do what they like with it. Their T&Cs only allow them to admonish distribution. You are not granting any license, that requires a document.
-
Thanks for the link Ton. I'm definitely going to spend a bit of time looking over those.
I think 2009 was the latest version I've tried scripting with. The traverse vi shown in Jim's post wasn't available as far as I know, but boy it sure makes scripting easier. I still have to create a scratch vi to figure out the name of the object I'm looking for, but the whole process is much easier than it used to be. Now I just need to spend some time figuring out the available documentation tools and seeing if I can simplify my process.
It is available in 2009. It just isn't in any of the palettes (it's in vi.lib/utility/traverseref.llb).
-
2
-
-
Well if we have identified that that is what we need to do (certify every upload), then we should start doing it.
Maybe this could be made easier for the code uploader:
- With an option when posting in the forum, or
- A tool to add it to a VI before it is posted (I would be happy to make one)
?
I think that would be a pain. It should be sufficient that they have to check a checkbox that they agree to the sites T&Cs for software uploads (of course, the T&Cs have to exist ;p ).
The fact is that stopping it all is neigh on impossible (thinking about posting other peoples code). It's just the "arse covering" for Lavag that's important since it will be the first in line for the lawsuits if you do get a shirty uploader.
- With an option when posting in the forum, or
-
Ton. For your path example, I would have gone for something like this. Has one other advantage over the BFI method in that paths like "c:\temp\//test//text.txt" where you have multiple separators back-to-back, are also catered for. Slightly more complicated than it needed to be really, due to the regex escape char being the same as the windows path char. I'm sure this can be improved upon though.
-
Nice!
Here is my contribution to find an object's name
// Custom TypeOf Function function returnObjectType(object) { // Constructor has syntax 'function Object(){ [native code] }' var typeRegex = /function [A-z_][A-z0-9_]*\(/; var testType = typeRegex.exec(object.constructor.toString()); // Parse and return the object's name, otherwise return null if (testType != null) { // Slice off leading 'function ' and trailing '(' to resolve object's name return testType.toString().slice(9, -1); } return null; } // Test checkObjectType function // Constructor for Data Type function UserDataType() {} document.write(returnObjectType("hi") + '<br />'); // returns String document.write(returnObjectType(2) + '<br />'); // returns Number document.write(returnObjectType(true) + '<br />'); // returns Boolean document.write(returnObjectType(new Array) + '<br />'); // returns Array document.write(returnObjectType(new UserDataType()) + '<br />'); // returns UserDataType[/CODE]
Great. So you can do my documentation and my client side stuff too
Funny how you do in your JS exactly what I'm talking about in Labview with strings eh?
-
Not to go off topic - but doesn't typeof just return 'object' in javascript for any user defined data types?
E.g.
function Test() {} alert(typeof new Test()); // alerts 'object' [/CODE]
Yup (for objects). It will return if it is a boolean, number etc.My bad (good call)."[color=#000000]myobject.prototype" will return the class and you can just check with "===".[/color]
-
1
-
-
No, Shaun. You'd create JSON Object.lvclass. As each one comes in, you'd create the object of the named type (all of which inherit from JSON Object), and then invoke "JSON Object.lvclass:Do Appropriate Processing.vi" and each class would have overridden the method to do whatever it needs to do. At no point would you type test.
Ideally you would implement this as an interface, if LV had those, but plain inheritance would suffice for the problem as you've described it here. Oh, and you'd be a lot better off than the string testing of the non-OO solution.
Show me. The string version (which I already have - see Passa Mak for a rough idea how) is about 15 VIs. If you can do even just a chart in less than 50 hand made VIs with LVPOOP I'd be surprised (It got ugly very quickly, but maybe you have a better grasp on an approach without re-inventing every property and method for every object in LV).
Back OT. I see what you are saying with a JSON object (I think). By adding an extra layer of abstraction, you can take advantage of the dynamic despatch so that type checking isn't required. But inside it is still the same. You still need to create the individual objects (from the string as said), but unless you are prepared to re-code every property and method that LV has in your child classes, you are no better off apart from if you want to substitute an XML version instead. It will still be a monster. If you can type check the object, then you can reduce the properties and methods of your children and get away from the linear escalation of the VIs.
-
But we're still back to the same fundamental point: why do you really want to check for such "equivalence"? I know and understand that some people "clearly want to" as you point out but that does beg the question IMO. Isn't there at least one better way to architect so that checking for such equivalence isn't needed?
Lets say you have a JSON stream where each element is an object (which is what JSON is). So it comes in via TCPIP and you create an object of that type using simple string/case detection so that it can be shoehorned into a class ASAP. Depending on what that type is (histogram, chart,value etc) you need to check it's type and do the appropriate processing for that class (e.g. update a chart display).Sooner or later you will need to test the equivalence (since you can't just wire a class to a case structure as you can with strings). To do this you would use the "typeof" in JavaScript if roles were reversed.
I'm all ears on a "better" architecture apart from (of course) not using classes at all - where it becomes trivial.
-
P.S. Anyone else care to guess what object comes out of the zero-iteration loop?
A NI instructor certificate?
-
I'm not a fan of the "brute force and ignorance" method of resolving stuff. I think it is an anti-pattern.
If you know what the options are, then there is nearly always a way of detecting and using the correct method/case without incurring the potentially long pauses whilst the VI "searches" for the correct solution. I do. however, use it for exiting a VI early if, for example, I'm doing a linear search and find the answer.
In your example, wouldn't the "Scan String For Tokens" allow you to find which path separator is being used and choose accordingly?
-
Here's an absurd scenario:
Me to LAVA: How do I do something?
LAVA to me: Like this.
Me to LAVA: Oh, thank you so much! That's just what I was looking for.
That was fast; you folks are the best.
.
.
.
<some time later...>
Me to myself: I can't use that code, because the author has a copyright...
Exactly! But I bet the latter never happens and you are in danger of the copyright holder coming-a-chasing with "Shaftya & Yermom Lawyers inc"
But how many times have people posted someone elses code in the vein of "I found this by joe bloggs to be really useful and will solve your problem".
-
Couldn't you also use the Get LV Object Class Path?
Or if the actual path gives problems, maybe use the Get LV Class Info.
lol. Posted too soon. It's going to be hard to beat 0 ms
-
(isn't it better to ask forgiveness than permission?
).
Not when it comes to licenses. Asking for permission is free. Forgiveness is very expensive and involves lawyers.
Thanks for the answer.
It's a nice solution but, I read that it's under Creative Commons Attribution-Non-Commercial-Share Alike license. I'm not a lawyer and my English creaks a lot, therefore here my question: can I use this code and distribute it with an application which purpose is to customize a device without run into law problems? The end user of this application doesn't buy the application but the device.
PM me with your email address, and we'll sort out a commercial usage waiver to remove all doubt.
-
-
I think the bit of info you are missing is that it is an Event Queue. By using the val (sig) you are simply placing which cases to execute at the tail of the queue. It's not like event branching (as you would expect from, say a PLC). So when you execute two val (sig) within a case, you are adding two instructions to the queue. It is not until the loop goes round again, that the queue is re-read and the case at the head of the queue is taken and executed.
-
I don't believe that a forum needs to so inform particular persons. Once material is posted, unless it is specifically marked as protected in some way, it is de facto, no longer protected. If a license hold (or equivalent) of some protected code posts such code, then that person is liable for that and any subsequent non-authorized use of the code.
At least that's what I understand about it.
Indeed. As did I. However consider this:
In all countries where the Berne Convention standards apply, copyright is automatic, and need not be obtained through official registration with any government office. Once an idea has been reduced to tangible form, for example by securing it in a fixed medium (such as a drawing, sheet music, photograph, a videotape, or a computer file), the copyright holder is entitled to enforce his or her exclusive rights.
<snip>
In 1989, the U.S. enacted the Berne Convention Implementation Act, amending the 1976 Copyright Act to conform to most of the provisions of the Berne Convention. As a result, the use of copyright notices has become optional to claim copyright, because the Berne Convention makes copyright automatic.
[my own emphasis]
http://en.wikipedia.org/wiki/Copyright#Obtaining_and_enforcing_copyright
-
1
-
-
Software released in the CR obviously has its Copyright status displayed. But what about the example code etc posted in threads - not only here, but on any other boards (like NI)?
There are a lot of very useful code snippets and packages around, but is software distributed without a license at all, actually usable without recrimination as we (I at least) have assumed in the past? Are we (technically and legally) actually able to post other peoples non-licensed code or even use it without permission of the original author (who may not be available or even known)? Should sites state that any "donated" code in forums (outside the CR) becomes public domain and they forfeit their copywrite claims or make it clear that the authors original rights are entirely preserved to clarify?
-
1
-
-
I believe this to be the more right way, but one way is to do as you said, where you have a value signaling property on a control that calls an event. I feel like this is harder to follow, and harder to debug.
+1 But we all do it
. I have had mixed success with using Event Structures as state-machines (UI becoming unresponsive due to lengthy code execution, getting UI updates because it's locked in another frame somewhere etc). I tend now to use the event structures only for select user events and FP events, and message a proper state-machine via queues and/or notifiers (stop, start, pause etc).
Additionally, I tend to dynamically load state-machines because if all else fails, you can just crowbar it without your app freezing.
-
I have a TDMS file structure that holds calibration tables each with associated DUT header information (SN, Model Number, Manufacturer, etc) assigned as Group Properties. In SQLite it seems that I must lay everything out as a flat table, first columns being the DUT header variables and then the last column being a blob or xml string representing my cal table data. I was wondering if I am overlooking some better way of organizing the data...
Your data will (should) be split over multiple tables (whether SQLite , MySQL, or access etc). So your DUT header info will be in one table and results in another, maybe the blobs in another. They will all reference each other via IDs. It depends how you want to set up your schema, but group properties and results would be different tables.
No help from me today: experience LAVA as it would be under SOPA or PIPA
in LabVIEW General
Posted
That is a misnomer (and a common one) since foreign sites are not bound by US laws. The only thing realistically that can be achieved (as they do in Thailand) is restrict access to those sites from US governed territories. Good luck with extradition on SOPA grounds too.
For example. In the UK they have introduced a law that any business web site must provide a notice that you will be setting cookies on a users machine and only do so with their consent (opt-in). Does it apply to NI sites in the US? Nope. Does the US care? Nope.
I get really tired of the "Axis of Evil" arguments to stir up nationalism (not directed at you, just it's always the justification for anything unpopular both here in the UK and in the US). Politicians can no longer promise us dreams, so they promise protection from nightmares. It's the cold war mentality that really belongs in the 20th century and has done nothing for a safer world. Rather, it has ridden rough-shot over civil rights because we have believed it.