go to post Dmitry Maslennikov · Dec 15, 2017 You wrong because you missed something important in the documentation. The third parameter is not about string, it is about the list of chars, and the last one the same. So, it will remove everything at the beginning if any of defined characters it will be. And order does not matter. Write $ZSTRIP("ZZZZTESTSLOCKTEST","<","ETSZ") return the same If you have to remove fixed string, you can use $piece or $replace Write $p("ZZZZTESTSLOCKTEST","ZZZZTEST",2,*) SLOCKTEST
go to post Dmitry Maslennikov · Dec 15, 2017 Each Application Server uses own Global Buffer plus Server Buffer, to fetch data, but the speed of the connection between those servers also matter.If you don't care where to run so rare queries, you can do it on Database Server. ECP connection only gives a way to get access to the data in databases. And does not help to call any code on Database Server directly. And since %Net.RemoteConnection already deprecated, you can use other ways to call the main server or any other, and SOAP can be one of the ways, but I would prefer JSON Rest API, which in result will transfer fewer data.
go to post Dmitry Maslennikov · Dec 15, 2017 My best day was a few days ago, but still very slow. Day Time Rank Score Time Rank Score 12 00:09:34 243 0 00:18:42 378 0 I'm usually much slower than you guys. Looks like you have more experience solving such tasks than me, you already solved both previous years.
go to post Dmitry Maslennikov · Dec 14, 2017 Just got my VR headset. It is quite good, but unfortunately, it does not have an action button. So, it becomes difficult to interact with applications when your phone inside.
go to post Dmitry Maslennikov · Dec 14, 2017 To set any response header, you should overwrite OnPreHTTP method in your CSP Page class. Class User.Page Extends %CSP.Page { ClassMethod OnPage() As %Status { &html<<html> <head> </head> <body>> ; To do... &html<</body> </html>> Quit $$$OK } /// Event handler for <b>PreHTTP</b> event: this is invoked before /// the HTTP headers for a CSP page have been sent. All changes to the /// <class>%CSP.Response</class> class, such as adding cookies, HTTP headers, /// setting the content type etc. must be made from within the OnPreHTTP() method. /// Also changes to the state of the CSP application such as changing /// %session.EndSession or %session.AppTimeout must be made within the OnPreHTTP() method. /// It is prefered that changes to %session.Preserve are also made in the OnPreHTTP() method /// as this is more efficient, although it is supported in any section of the page. /// Return <b>0</b> to prevent <method>OnPage</method> from being called. ClassMethod OnPreHTTP() As %Boolean [ ServerOnly = 1 ] { Do %response.SetHeader("X-MyHeader", "some info") quit 1 } }
go to post Dmitry Maslennikov · Dec 13, 2017 In HTTP/2 added some features which are impossible or maybe possible in CacheServer Push - allows pushing some resource from server to client, at any time, in parallel Data compression for HTTP Headers. How it will be now when I will need to read headers in a request.And other features which also important but mostly on TCP Stack, and maybe really not Cache part.
go to post Dmitry Maslennikov · Dec 10, 2017 Looks like there is some error with autodetecting links in a post here, just fixed it with manually marking correctly as a link in his comment.
go to post Dmitry Maslennikov · Dec 7, 2017 That's why it's an article and not a question.So, for now, yes. I changed to article
go to post Dmitry Maslennikov · Dec 7, 2017 In the first implementation, I tried to actually build the tree. But missed something, and got some duplications in the lowest branches. Then using the same tree trying to solve second part, I found more than one unbalanced branches and a long time had not noticed how it could be until I noticed duplications. Then I removed this way, and first part becomes much simpler if just search node which does not have parents. In the second part, you actually already have a tree when you know when it started from the first part.
go to post Dmitry Maslennikov · Dec 7, 2017 Looks like just some simple implementation for Long Pulling requests.But how about getting not just a progress but how to get some data before task finished. And also, I see beg security Issue, when I can get information from any other process. You use TaskId directly from the request like you trust everybody. And also easy to get SUBSCRIPT error.BTW: do you suppose to acept someone's answer? Looks like it is mostly just discissing topic.
go to post Dmitry Maslennikov · Dec 7, 2017 Today's task was pretty difficult, it takes few hours to solve it. I made a mistake in first part even if I got the right answer, but after when I rewrote my first part, the second part was solved quite fast. But I lost so much time to figure it out.
go to post Dmitry Maslennikov · Dec 6, 2017 For current process USER>f fmt="enuw","rusw","current","" do ##class(%SYS.NLS.Format).%New(fmt) w !,fmt,?10,$zd($h,11),?15,$zd($h,12) enuw Wed Wednesday rusw Сре Среда current St středa Wed Wednesday Or for all new processes, without restart %SYS>write $zd($h,12) Wednesday %SYS>Set ^SYS("NLS","Config","LocaleFormat")=1 %SYS>write $zd($h,12) Wednesday %SYS>Do Locale^NLSLOAD("rusw") %SYS>write $zd($h,12) Среда
go to post Dmitry Maslennikov · Dec 6, 2017 Looks like we in the same timezone, and you solve tasks faster than me. When your time today was 15:47 minutes for the first task. But on the main Leaderboard fastest time 2:58. I really don't understand how it would be possible, to solve it so fast.
go to post Dmitry Maslennikov · Dec 6, 2017 anagram used all letters, so I just compared lengths of strings and used $tr() to remove all characters from string one in another. So, your code I would change like ClassMethod IsAnagram(word,test) as %Boolean { if $L(word)'=$L(test) return 0 return $tr(word,test)="" }
go to post Dmitry Maslennikov · Dec 5, 2017 Look at the documentation, there are some formats available to use in the $zdate function. Where 11 (abbreviated) and 12(full) looks like what you need. write $zdate($h, 11) Tue Write $zdate($h, 12) Tuesday
go to post Dmitry Maslennikov · Dec 5, 2017 you can use function DATEDIFF from SQL write $system.SQL.DATEDIFF("yy", $zdh("01.01.1990",4), $h)
go to post Dmitry Maslennikov · Dec 2, 2017 It would be better if you can add your SQL query, and if it is not a secret also Classes definition. So, we could see if something may be wrong with it. And you also should look at the book in the documentation about SQL Optimizations.