go to post Danny Wijnschenk · Aug 16, 2018 Can you still connect with Studio on the same machine ?Apparently, the factory.Connect is failing, what is the value of ConnStr ?You could change the line by ConnStr = factory.ConnectDlg()which will display a dialog with options to login, or give you an error if it cannot reach Caché.
go to post Danny Wijnschenk · Jun 20, 2018 Hi Eduard,I have found some old code to visualize a WordCloud using iKnow.This code is showing the concepts of a source, and adds weight according to a simple tf/idf score.I have put the (old) code on github hereThe code is using %iKnow.Queries.EntityAPI.GetBySource, and the CSP page is using the jquery library from AwesomeCloud to render the wordcloud. (Today I would not use CSP pages anymore with Caché script or CSP tags, but like i said, it is old code;)After importing the xml from github, the url to call looks like this :http://localhost:57772/csp/user/WordCloud.csp?domain=pubmed&source=240and the result would be something like :
go to post Danny Wijnschenk · May 18, 2018 The cconsole.log should also give you a clue why it cannot mount the database.
go to post Danny Wijnschenk · May 18, 2018 Make sure the file cache.lck is not present : it indicated the cache.dat is mounted by (another) Caché instance.Also verify the block size of the cache.dat : nowadays it is default 8Kb, but in some previous versions, you could specify other block sizes, and if it is the case, you need to allocate global buffers that are minimum that size.
go to post Danny Wijnschenk · May 17, 2018 Caché can call any OS command (if it has enough rights) by using $ZF(-1 (see also article https://community.intersystems.com/post/callexecute-exe-windows-objectsc...)In the OS command script, you can use ccontrol to the other Caché instance (see article https://community.intersystems.com/post/starting-routine-windows-command... as an example)But i would prefer using Webservices to call a routine from one Caché instance the other : then you don't need to put the two Caché instances on the same server : see webservices doc https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...
go to post Danny Wijnschenk · Jan 31, 2018 In the real world, there are lots of programs still using this style, every developer using Caché Object Script should be able to read this and understand the side-effects, pitfalls, even if we recommend to not use it anymore...
go to post Danny Wijnschenk · Jan 30, 2018 Hi Scott, Here is some code that stores the sizes of all globals for a database, if you create an entry in the task manager to run this code every day, you will see in the global ^tempSize which globals grow faster than others : do ##class(Utils.Database).GlobalSize() (please change the code to store the results in a global that does not exist, or better, in a persistent class) Class Utils.Database { ClassMethod GlobalSize(dir As %String = "") { If dir="" Set dir = $zu(12,"") ;current directory #Dim today as %Integer = $zdate($H,8) #Dim sqlStatement as %SQL.Statement = ##class(%SQL.Statement).%New() #Dim sqlResult as %SQL.StatementResult #Dim sc as %Status = sqlStatement.%PrepareClassQuery("%SYS.GlobalQuery","Size") Set sqlResult = sqlStatement.%Execute(dir,,,,,1) ;1=fast mode While sqlResult.%Next() { set ^tempSize(sqlResult.%GetData(1),today)=sqlResult.%GetData(2) ;^tempSize(yyyymmdd,global)=allocated blocks } } }
go to post Danny Wijnschenk · Jan 25, 2018 Yes, same here, i also use following code a lot:Open <some device>:"R":0 Else Write "could not open device" QuitI always use Else on the same line just after the command that changes $test,having too much instructions between them creates problems.
go to post Danny Wijnschenk · Jan 25, 2018 Besides all that is mentioned, the If without braces has a side-effect that the If with braces does not have : it affects the system variable $Test. USER>set $test=0 USER>w $test 0 USER>if 1=1 { write "one" } one USER>w $test 0 USER>if 1=1 write "one" one USER>w $test 1 USER> Not important, only if you use the ELSE (legacy) command...
go to post Danny Wijnschenk · Jan 17, 2018 If you substract the current day-of-the month from the current date in $horolog format, you will end up with the first day of the current month in $horolog format :Write $horolog - $zdate($horolog, 4) + 1If your date is in another format, convert it using $zdateh/$zdate, see also :http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...andhttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Danny Wijnschenk · Dec 3, 2017 Guessed right : found out that i still have a wife and two kids, ... bummer ;)
go to post Danny Wijnschenk · Nov 24, 2017 Hi Arun,Look at this article : https://community.intersystems.com/post/machine-learning-spark-and-cach%...If you want to analyse text for a chatbot, iKnow could be handy, search for iKnow keyword in DC or in the docs.
go to post Danny Wijnschenk · Nov 20, 2017 Turn on Auditing (Portal -> System Admin -> Security -> Auditing -> Enable Auditing, configure system events to audit login failures ).It can give you a clue on why you are getting Access Denied.It could be an issue of licensing : check the system dashboard for Licensing use (maybe you have too many connections open).If all this does not help, you can also turn on ODBC logging in the ODBC DSN.
go to post Danny Wijnschenk · Nov 14, 2017 Hi Laura,Can you check in the cconsole.log for any error messages ? If your cache.dat is not RW accessible by Caché, you get an error like :11/14/17-16:55:39:138 (16952) 0 DKMOUNT: Mounted SFN 6 DB 'c:\intersystems\cache\mgr\user\' as Read Only DB. File or filesystem allows read-only access.
go to post Danny Wijnschenk · Nov 14, 2017 Hi Laura,Can you look at the directory where your cache.dat is located.If a database is mounted, there should be a cache.lck file with the root directory and name of the Caché that mounted it.If the root/name is not the same as your Caché system, it will not mount it as RW.Best is to stop Caché (or dismount the database), remove the cache.lck, and mount/start Caché again.(If you are sure that this DB is not used by another Caché).
go to post Danny Wijnschenk · Nov 13, 2017 Since 2014.1 we have 'unified' Triggers in Caché : if you use 'Foreach = row/object' in your trigger, it will be called from SQL and Object operations, a lot easier to write common code : Trigger T1 [Event = INSERT, Foreach = row/object { //your code } See also in the docs : http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Danny Wijnschenk · Nov 11, 2017 Your use of Set $listbuild was unknown to me : i only used it on the right hand side (like Set var = $lb(...) ), but on the left-hand side, it is ideal to set a bunch of variables in the same instruction, cool !
go to post Danny Wijnschenk · Nov 3, 2017 hi Dmitry, i gladly take your hints, this is precisely the goal of this article series : to comment and discuss code and make it better or point out alternative code. Using streams is to be preferred over the Open command (like showed in Bert's code), you can see the age difference in comparing our code ! I limit the use of standalone Else to checking a timeout. For example: Lock +^MyLock("MyBatch"):1 Else Quit "job is already running" which is identical to Lock +^MyLock("MyBatch"):1 If '$Test { Quit "job is already running" }
go to post Danny Wijnschenk · Oct 31, 2017 You will always need to add the property and an entry in the storage section of the mapped class.If you include the class source and global entry, we can help you in more detail.
go to post Danny Wijnschenk · Oct 22, 2017 put your code in a try { } catch { } block to prevent that Cache will not start if there are errors in your code