Evgeny Shvarov · Dec 11, 2017 go to post

Hi, Minsu!

I guess you can use Caché JDBC driver to get access to tables in Caché.

Also, check this article which discusses the options of using Hibernate in Caché.

Evgeny Shvarov · Dec 11, 2017 go to post

Hi, Souiane!

But, I think HSADUIT is RO by purpose. Do you really need that? 

If you want to do something with it, I would map it in another namespace and merge/examine needed parts.

Evgeny Shvarov · Dec 10, 2017 go to post

Thanks, Sean!

I have updated Cogs which makes 37 UDL repo's and counting.

Great! Maybe it makes sense to mark our Advent repos with UDL as well.

See also the related post on different GitHub topics on InterSystems.

Evgeny Shvarov · Dec 9, 2017 go to post

Thanks, Sean, for raising the topic. 

Actually, they are not all in UDL form of source code. We do want the highlighting of UDL not XML, right?

So I introduced cacheobjectscript-udl tag which lists the repos with COS in UDL.

Please, mark your repos with this topic and we can show up it to github.

Evgeny Shvarov · Dec 8, 2017 go to post

As soon as the number of points for the task depends on the time passed after task availability it’s relatively save to share it once you solved it. 

So it’s OK to show up the repo after the marathon ends but of course I would only appreciate to see the discussions around nice solutions in COS.

Evgeny Shvarov · Dec 8, 2017 go to post

Hi, Bert!

You are right! The winner should show the public repository with solutions in Caché ObjectScript to be recognized as a winner.

But I think it’s OK to share solutions even now. I would only appreciate it.

Evgeny Shvarov · Dec 7, 2017 go to post

I can add that Caché Evaluation version is pretty limited in functionality vs fully functional release.

To get the full experience of InterSystems Caché try online learning courses with "Interactive course" and "Caché" filters on (see the highlighted checkboxes on a screenshot).

 

With this courses you would have your personal cloud sandbox where you can learn and try different InterSystems Caché features. 

Evgeny Shvarov · Dec 7, 2017 go to post

And, to join Global Masters just use your WRC creds on the login page, or leave a comment to this post, that you are participating in the contest, we would send you a special invite code.

Evgeny Shvarov · Dec 7, 2017 go to post

We decided to promote and support the contest, and launched a challenge on Global Masters:

 

We would track the private leaderboard with code: 130669-ab1f69bf. Join this private leaderboard, solve tasks with Caché ObjectScript be the leader in the end and get the endless fame plus 10,000 GM points! 

2nd and 3rd places would get 5,000 and 3,000 points too.

Yes, there is some handicap for current members:

But we wouldn't change anything: we believe you have enough time and talent to beat them!

Let's have fun and let the COS power be with you! ;)

Evgeny Shvarov · Dec 6, 2017 go to post

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.

Evgeny Shvarov · Dec 5, 2017 go to post

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 fghij is a valid passphrase.
  • abcde xyz ecdab is not valid - the letters from the third word can be rearranged to form the first word.
  • a ab abc abd abf abj is a valid passphrase, because all letters need to be used when forming another word.
  • iiii oiii ooii oooi oooo is valid.
  • oiii ioii iioi iiio is 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.

Evgeny Shvarov · Dec 1, 2017 go to post

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,! }

Evgeny Shvarov · Nov 30, 2017 go to post

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)
Evgeny Shvarov · Nov 30, 2017 go to post

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.

Evgeny Shvarov · Nov 30, 2017 go to post

Thanks, Dmitry!

Though the parameter for a 'namespace-to-map' with a name "Database" looks weird.

Evgeny Shvarov · Nov 27, 2017 go to post

Interesting about MANAGEDEXTENT. 

I'm curious, what are the typical use cases, when MANAGEDEXTENT can be helpful?

Evgeny Shvarov · Nov 27, 2017 go to post

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.

Evgeny Shvarov · Nov 21, 2017 go to post

Thanks, John, Jeff. It's a bug. We have this behaviour but only for Groups. But it seems it works for Tags as well.

Evgeny Shvarov · Nov 20, 2017 go to post

Hi, Mike! Will do, but have you tried with WRC via this entrance?

Click on it and you'll be redirected to InterSystems Login