Nice one! I didn't know about the ccontrol command, but indeed it is in there...
- Log in to post comments
Nice one! I didn't know about the ccontrol command, but indeed it is in there...
This command worked...
However this does not answer my initial question: how come the install found the instance despite the fact that I completely removed the install directory?
I'm only seeing this post now... Great source of information!
Now I wish I had more practice... But this is close to what I want to do.
Don't you want to contribute to the project? :p
I was not asking about how to name things but about how to make this package accessible to everyone
Hmm...
I don't use an %Installer... And in a default Caché installation there is no %ALL namespace.
What would you say is the less intrusive solution, then?
Well, I am on it right now but it does not quite answer my question...
Still, it is a useful resource, so I take as many lessons as I deem are useful to me...
Definitely!
This should be in InterSystem's official documentation...
Yes, and that's one of my problems :(
Side note... While I don't quite understand the need here, this is another case where a table of deprecated classes/methods/keywords would be useful...
Since which version of Caché is this class deprecated? Unfortunately we don't know :(
I know of this syntax. However, the "problem" to me here is that all invididual variables declared here are implicitly created :/
If you create a lot of variables this way, this can become very hard to track what the code exactly does...
Very nice!
One question: since in this code tStmt seems to be a prepared statement, can I just declare it as a parameter to the class and reuse it when I need it?
Hmm, interesting... But does it work recursively? Ie, if I have class C inherits class B inherits class A, is $classMethod("C", "%IsA", "A") true?
Useful information, thanks!
I can add a cache-2010.1 tag to that particular namespace change rule I have...
Why do you set $namespace twice? No need for it if you use new $namespace, right?
Hello!
First things first: /latest/ is a great idea!
Now, on to my personal feedback which is obviously biased: I am primarily a Java developer (with prior experience in C), and am seeking to know ObjectScript better... As such, I find that two things are fundamentally missing:
All in all, this is rather a feedback on the content rather than the form; not sure whether this is what you expected, but here be dragons :p
Not an answer per se, but why do you specify both "extends %Persistent" and "ClassType = persistent"? Is it necessary?
Good catch!
And while we're at it, it'd be nice if it could also "dedent" preprocessor directives... Except for #dim.
It's quite confusing to see a #if something on the same level as a bona fide statement...
Thanks for the pointers!
I have a lot of experimentation to do, it seems :)
I didn't know about ^SYS.MONLBL.
As to why unit testing, it's because unit testing is used along with code coverage: you run unit tests, and you check what parts of your production code is taken/non taken. Timings are indeed irrelevant.
The plan is to run unit tests with coverage activated, scan both the test results and monitoring results and collect the results.
Eduard,
I was aware of the new If not setting $TEST.
And again, let me insist: shorter doesn't mean better :p
Hello Eduard,
I was not aware of version agnostic URLs. I will use them, thanks for the link! And yes indeed, I know that the documentation is lacking in some areas. And in fact I have a branch dedicated to issue documentation updates... Time to update and merge, I guess :)
As to postconditionals, well, I put myself in the place of someone which is new to the language: his background will more than probably be with languages with all the "classic" branch keywords (if, else, while, do...); making it so that the code is more readable is always a win! And no, shorter isn't better :)
But yes, you can configure what is called quality profiles in which you select which rules you want to activate, and you can also alter their severity to fit your needs. Not only that but you can also expand the help text and change the parameters of rules which have parameters (classic example: complexity).
Oh, and by the way, there _is_ a difference between postconditionals and if (I learned that yesterday): a postconditional won't set $TEST...
If you're at the summit, remember that at 12:30pm today I'll give a short talk :) If you are there I will demonstrate, among other things, how you can set your own quality profiles.
Hope this helps!
Hello,
That is not what I mean, sorry. What I meant to ask is whether there is a way to store "primitive" JSON values, not only objects and arrays. For instance, can I:
set xxx = ##class(JsonValue).number(2.3)
set xxx = ##class(JsonValue).null()
// or .true(), .false(), .string("some string constant"), etc
w xxx.getType() // would return either of object, array, number, boolean or null
Well, there is something else in fact.
RFC 7159 allows any JSON value as a JSON text; so for instance, false, 2.2 or null are also valid JSON values.
Is there any way to enter and manipulate such values?
Hello,
OK, groups changed. Sorry...
Just one thing...
I was at a conference back in June in Barcelona where I had the chance to meet with, among other InterSystems people, Jamie Newton...
And I mentioned to him that this JSON was valid:
{ "": false }
(ie, the key of the object member is in fact an empty JSON String)
This was some months ago; does ObjectScript now support such keys?
This is my choice.
The goal is, after all, to find issues in ObjectScript code; as such, developer feedback on issues are very important :)
Unless I have misunderstood the goal of this forum completely?
Hello,
I don't understand what you mean?
As you may have seen on the main page, there is an email to which you can write so that your code can get analyzed on this very site. Note that this is a compromise: you get the analysis for free, but the code is visible to everyone; which is why open source projects written in COS get the most benefit from it.
Related to that somehow is that from our experience, most such projects still use Studio's export facility which exports to XML; fortunately, we have a solution to turn those exports into plain source files (https://github.com/litesolutions/cache-import). Once Atelier gains wider adoption, things may change, in a good way: no need to massage XML anymore!
Hello,
This is precisely why I'm asking for feedback about default severities :) Do I take it that you think the severity is too high? If yes, what do you think it should be?
Note that if you wish to, I can set up an account so that you can modify which rules are active and which are not, along with the default severities (just send me a mail). But you talk about fine tuning, I'd rather the settings were good enough that the amount of fine tuning spent is minimized :)
I am a seasoned Java developer myself and I also disagree with many of the rules of SonarQube's Java plugin. But admittedly, I revere type safety and it somewhat shows in the rules :)
----
As to macros, well, you can write a macro as a statement, sure, but the problem I see is that it is an opaque statement. What does this macro do? Does it exit the method? If a variable is passed as an argument, does it modify this variable? Does it increase the complexity? If yes, by how much? Basically, this is the reason for the rule. Nothing Java related :)
In the future the plugin may expand macros, in fact; right now however this is not supported...
Just one thing; one good tool to use on Linux is dstat.
It is not installed by default, but once you have it (apt-get install dstat on Debian and derivates, yum install dstat on RHEL), you can observe the live behavior of your system as a whole with:
dstat -ldcymsn
It gives quite a lot of information!
The problem with all such analyses is always the same. They fail to account for the single most important factor for real world applications, and that is memory bandwidth.
Code written for benchmarks has the flaw that it is precisely "written for benchmarks". It is no replacement for real life code which accesses memory in ways that such custom code cannot even begin to emulate.
Consider virtualization for a moment. Let's take the x86 world. Let's take Intel's VT-x, or AMD's AMD-V. If you look at the wikipedia entry for such techniques, the core goal of those technologies is _not_ to make machine code run faster (this is the "easy part"), but to reduce the time it takes for programs in virtualized environments to access memory.
Running code is "easy". Accessing memory is hard... And accessing memory is the key.
----
For completeness, I'll just add this: I am mostly a Java developer, and I know that the most glaring flaw of Java is its poor locality of reference -- accessing any `X` in a `List<X>` is very likely to trigger a page fault/load/TLB update cycle for this particular `X` to be available. As a result, when performance comes into play, I do not look as much into the frequency of the CPU as I look into the L{1,2,3} cache sizes and the memory bus width and speed. In the long run, the latter three are the deciding factors as far as I'm concerned.