go to post Dmitry Maslennikov · Nov 9, 2017 InterSystems delivered Cache distributive as a DMG file until 2016.2. And fortunately, they decided do not do it anymore.But all the time, it was also available as tar.gz. Which is working in exactly the same way as any other Linux version.So, you can use ccontrol tool, to see a list of instances, their status and start or stop.csession can be used as a terminal in windows.To open System Management Portal, you can just this URL in a Browser - http://localhost:57772/csp/sys/UtilHome.csp
go to post Dmitry Maslennikov · Nov 8, 2017 I think could be even shorter, but as is set sum = 0, north = "" set fs = ##Class(%Stream.FileCharacter).%New() set sc=fs.LinkToFile("day4.txt") while 'fs.AtEnd { set line = fs.ReadLine() do line(line) } w !,"Sum = ",sum w !,"North = ",north q line(line) [ sum, north ] { set name = $p(line, "-", 1, * -1) set checkSumm = $piece($piece(line, "]"), "[", *) for i=1:1:5 { set char = $e(checkSumm, i) set count = $l(name) - $l($tr(name, char)) set order( - count, char) = "" } set testSumm = "" set i="" for { set i = $o(order(i)) quit:i="" quit:i=0 set c = "" for { set c = $o(order(i, c)) quit:c="" set testSumm = testSumm _ c } } if testSumm=checkSumm { set sector = $piece($piece(line, "["), "-", *) set sum = sum + sector for i=1:1:sector set name = $tr(name, "zabcdefghijklmnopqrstuvwxy-", "abcdefghijklmnopqrstuvwxyz ") if name["north" set north = sector } }
go to post Dmitry Maslennikov · Nov 8, 2017 One code for both passwords set doorId = "reyedfim" set (pass1,pass2) = "" for i=1:1 { set hash = $system.Encryption.MD5Hash(doorId _ i) set key1 = $zla($reverse($e(hash, 1, 3))_$c(0)) continue:key1>15 if $l(pass1)<8 set pass1 = pass1 _ $zhex(key1) continue:key1>7 continue:$tr($e(pass2, key1 + 1)," ")'="" set $e(pass2, key1 + 1)=$zhex($a($e(hash,4))\16) quit:($l($tr(pass2," "))=8) } w !,"Password #1 = ",pass1 w !,"Password #2 = ",pass2
go to post Dmitry Maslennikov · Nov 8, 2017 Mine set fs = ##Class(%Stream.FileCharacter).%New() set sc=fs.LinkToFile("day6.txt") while 'fs.AtEnd { set line = fs.ReadLine() do line(line) } set (msg1,msg2)="" for i=1:1 { quit:'$d(count1(i)) if $o(count1(i, ""), -1, char) set msg1 = msg1 _ char set msg2 = msg2 _ $o(count2(i, $o(count2(i, "")), "")) } w !,"msg1 = ",msg1 w !,"msg2 = ",msg2 q line(line) [symbols, count1, count2 ] { f i=1:1:$l(line) { set char = $e(line, i) set count = +$get(symbols(i, char)) kill count2(i, count, char) set count = $i(symbols(i, char)) set count1(i, count) = char set count2(i, count, char) = "" } }
go to post Dmitry Maslennikov · Nov 8, 2017 Look at my solution for this task k set fs = ##Class(%Stream.FileCharacter).%New() set sc=fs.LinkToFile("day8.txt") set count=0,width=50,height=6 for x = 1:1:width for y = 1:1:height set screen(x,y) = 0 while 'fs.AtEnd { set line = fs.ReadLine() do line(line) } do draw() set count = 0 for x=1:1:width for y = 1:1:height set count = count + screen(x,y) w !!,"Count = ", count quit line(line) [screen, width, height, x, y] { set $lb(cmd, size, pos, , by) = $lfs(line, " ") if cmd = "rect" { set $lb(mx, my) = $lfs(size, "x") f x = 1:1:mx f y=1:1:my set screen(x,y) = 1 } else { set $lb(v1, pos) = $lfs(pos, "=") set v2=$case(v1, "x":"y", :"x") set max = $case(v1,"x":height, :width) set @v1 = pos + 1, @v2 = 1 for i=1:1:by { set prev = $g(screen(x,y)) for @v2 = 2:1:max set $lb(screen(x,y), prev) = $lb(prev, screen(x,y)) set @v2 = 1 set screen(x, y) = prev } } } draw() [screen, width, height] { f y = 1:1:height { w ! f x = 1:1:width { write $case($get(screen(x,y)), 1:"#", :" ") } } }
go to post Dmitry Maslennikov · Nov 7, 2017 And for the second part, a bit different. set fs = ##Class(%Stream.FileCharacter).%New() set sc=fs.LinkToFile("day7.txt") set count=0 while 'fs.AtEnd { set line = fs.ReadLine() if $locate(line, "(\w)(?!\1)(\w)\1\w*(?:\[\w+\]\w*)*\[\w*\2\1\2\w*\]")||$locate(line, "\[\w*(\w)(?!\1)(\w)\1\w*\](?:\w*\[\w+])*\w*\2\1\2"), $i(count) } w !,count
go to post Dmitry Maslennikov · Nov 7, 2017 Interesting, but I don't understand why you still trying to parse strings manually when InterSystems already supports Regex. set fs = ##Class(%Stream.FileCharacter).%New() set sc=fs.LinkToFile("day7.txt") set count=0 set abba = ##class(%Regex.Matcher).%New("(\w)(?!\1)(\w)\2\1") set hyper = ##class(%Regex.Matcher).%New("\[\w*(\w)(?!\1)(\w)\2\1\w*\]") while 'fs.AtEnd { set line = fs.ReadLine() set abba.Text = line set hyper.Text = line if abba.Locate(),'hyper.Locate(),$i(count) } w !,count So simple, isn't it? For regex maniac, maybe possible to join both regex's to one to get fewer operations. But anyway, in this simple example you can see the power of Regex. And even shorter set fs = ##Class(%Stream.FileCharacter).%New() set sc=fs.LinkToFile("day7.txt") set count=0 while 'fs.AtEnd { set line = fs.ReadLine() if $locate(line, "(\w)(?!\1)(\w)\2\1"), '$locate(line, "\[\w*(\w)(?!\1)(\w)\2\1\w*\]"), $i(count) } w !,count
go to post Dmitry Maslennikov · Nov 7, 2017 Even Eclipse itself offers the same way to upgrade platform. If you want to upgrade Eclipse to the newest version, you should change the link, and after that upgrade will be possible.
go to post Dmitry Maslennikov · Nov 6, 2017 I think it mostly depends on your task, how strongly you should care about duplications.And I think that SHA1 should be enough
go to post Dmitry Maslennikov · Nov 6, 2017 Documentation now looks quite pure about Atelier. As far as I know, Studio does lock for any files which in edit mode, not just opened but after some changes. While Atelier does not. When you save the file in Studio, it does not care what did you have before it just overrides. When Atelier checks if server's version was changed it offers to compare and choose what should be stored on server.
go to post Dmitry Maslennikov · Nov 6, 2017 Or just add calculated indexable property with hash to this string, and use this property in SQL
go to post Dmitry Maslennikov · Nov 6, 2017 Yep, right, looks like Index can't help here and problem not only 511(and this length could be different on different strings).But, you still can use Index but you should set length which should be stored. But find duplicates you can do without SQL, just by reading this index, it should be much faster, to find, all duplicates by indexed value, and then you can compare real values.
go to post Dmitry Maslennikov · Nov 6, 2017 For best performance, you need index on this property. And request something like this. SELECT Home_City,list(ID) ids FROM sample.person GROUP BY Home_City HAVING count(*)>1 And result will be something like this
go to post Dmitry Maslennikov · Nov 3, 2017 It has private access for now, and available only for you, yet.
go to post Dmitry Maslennikov · Nov 3, 2017 Danny, Thanks, It's amazing, to see such articles. But how about coding style. If to be honest, your code looks like a mess of old-school code and modern. As this articles mostly for beginners, it would be much better to have also modern style. Instead of OPEN/USE/READ use %Stream classes. I see this way as much readable. And about how you use standalone ELSE command without brackets, not sure that beginners, can quickly get the trick here. Open file:"R":1 Else Use 0 Write "Could not open file ",file Quit
go to post Dmitry Maslennikov · Nov 3, 2017 You can remove saved password from windows registryrun regedit.open path HKEY_CURRENT_USER\Software\InterSystems\Cache\Servers\choose serverremove Server Password
go to post Dmitry Maslennikov · Nov 2, 2017 The same issue, just updated to latest beta version. Windows 10 x64, java version "1.8.0_152"
go to post Dmitry Maslennikov · Nov 1, 2017 I would recommend instead of mark such object as deleted, with such flag like this. Just "move" it to another table some kind of Trash, when you can store this object as a serialized string for example. In this case object will really disappear from his table and will not be availble with via SQL or any other accesses. But in this Trash, you can have information about deletion data, who deleted and information to restore it.
go to post Dmitry Maslennikov · Oct 27, 2017 To have a possibility to edit files, you have to create a project, and copy existed classes to this project.You can look at this youtube playlist, to get more information about working with Atelier.