This is beautiful! I like $tr!
But wrong )
E.g. it would not work for this example:
oiii ioii iioi iiio
it's not valid, but for your example would be valid.
- Log in to post comments
This is beautiful! I like $tr!
But wrong )
E.g. it would not work for this example:
oiii ioii iioi iiio
it's not valid, but for your example would be valid.
I wonder, guys, how did you solve that the word is Anagram in Day4:
A valid passphrase must contain no two words that are anagrams of each other - that is, a passphrase is invalid if any word's letters can be rearranged to form any other word in the passphrase.
For example:
abcde fghijis a valid passphrase.abcde xyz ecdabis not valid - the letters from the third word can be rearranged to form the first word.a ab abc abd abf abjis a valid passphrase, because all letters need to be used when forming another word.iiii oiii ooii oooi oooois valid.oiii ioii iioi iiiois not valid - any of these words can be rearranged to form any other word.
My solution is:
ClassMethod IsAnagram(word,test) as %Boolean {
if $L(word)'=$L(test) return 0
f i=1:1:$L(test) if $seq(test($E(test,i))),$seq(word($E(word,i)))
set a=$O(word(""))
while a'="" {
if word(a)'=$g(test(a)) return 0
set a=$O(word(a))
}
return 1
}
The full solution is here.
Recently released 2.1.12 version of DSW provides color customization for a particular widget.

The data on the widget-specific colors is stored in same json settings and can be deployed on the production host.
Pinging [@Amir Samary] who has a great experience in object synchronization.
This is smart! )
I did part2 checking the whole length :/
Already )
Share your solutions too ;)
Bert, thanks for sharing!
Here is my solution for Day1.
Thanks for the answers!
The combined answer is - build it again if you don't care about the time during deployment.
For Caché persistent classes I like this snippet from [@Kyle Baxter] which rebuilds all persistent classes' indexes in a Namespace:
s sql="select Name from %Dictionary.CompiledClass where system=0 and NOT(Name %Startswith '%') AND SUPER [ 'Persistent'"
s rs=##class(%SQL.Statement).%ExecDirect(,sql)
while rs.%Next() { s sc= $classmethod(rs.%GetData(1),"%BuildIndices") w "Built "_rs.%GetData(1)_" with return code = "_sc,! }
What do you mean by 'config file'?
This is similar documentation for mapping Routines.
And one note: if you map routines, put the routine name without extension.
E.g. if you want to map MyMacro.inc from USER to %ALL run the following in %SYS namespace:
%SYS>s props("Database")="USER",sc=##Class(Config.MapRoutines).Create("%ALL","MyMacro",.props)
Nevermind, everything works fine!
Just to be clear: your line of code shows how to create the mapping of PackageA in Database SAMPLES to Namespace USER.
Thanks, Dmitry!
Though the parameter for a 'namespace-to-map' with a name "Database" looks weird.
Interesting about MANAGEDEXTENT.
I'm curious, what are the typical use cases, when MANAGEDEXTENT can be helpful?
Interesting. Never knew about MANAGEDEXTENT parameter, mentioned by @Robert.Cemper. And yes, backup your globals.
But in your case, @Nikita Savchenko, I would go with the following. Consider you have class A and rename it to class B.
1 - is yours.
1a. When duplicating be SURE, that you take class storage definition from A, not generate it because of compile. Change places with global A to global B in storage definition and compile class B.
It's MANDATORY to take class A storage def to B class definition and compile after that and not use generated storage definition in class B.
2. Merge data globals from class A to class B. E.g.
USER> m ^BD=^AD
3-4 - yours.
5. Load new scripts and make global merges and test.
6. Is yours.
Hi, Guilherme!
You are invited!
Also you are able to join with your WRC account, as it is shown here.
Welcome to the club!
Hi, Mike! Will do, but have you tried with WRC via this entrance?
Click on it and you'll be redirected to InterSystems Login

This is beautiful!
Thanks, Konstantin!
And here is the link to the demo.
Do you want to add an option to share the search? E.g. introduce some share results button in UI which would provide an URL with added search option in URL? It would be very handy if you want to share search results with a colleague.
Hi, Kevin!
There is a good article by @Vitaliy Serdtsev related to the topic (Russian to English translation).
Hi, Kevin!
Makes sense to me. We'll put it in a queue.
Thanks, Robert!
Thanks, Danny!
Actually, I raised already similar discussion but I still prefer object callbacks because of better code readability.
BTW, if I have both unified Trigger and OnBeforSave callback would they fire both?
And why don't we have unified ObjectScript callbacks?
Thanks for raising that, Udo! Sure it is helpful for a lot of people. And here is the full list of tags.
Hi, Kevin!
I can advise trying Caché Class Explorer which exposes packages, classes, methods with code and interactively points to classes documentation on a given server and can be used to solve your task in my opinion.
Pinging @Nikita Savchenko to provide more information.
Inviting @Luca Ravazzolo to the conversation.