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.
go to post Dmitry Maslennikov · Dec 2, 2017 set input="1212" set len=$l(input)/2 set sum=0 f i=1:1:len { if $e(input,i)=$e(input,len+i),$i(sum, i*2) } zw sum
go to post Dmitry Maslennikov · Dec 2, 2017 I also started from $zstrip, but in task 1111 should produce 1, when $zstrip returns only one 1.for the second task, you should simply compare values from the first half of string with the same position from the second half.
go to post Dmitry Maslennikov · Dec 2, 2017 If anybody wants to join this advent, we can use our own private leaderboard, with my code 130669-ab1f69bf.
go to post Dmitry Maslennikov · Dec 1, 2017 ClassMethod HelloWorld(Name As %String) { set result = { "name": (Name) } quit result.%ToJSON() }
go to post Dmitry Maslennikov · Dec 1, 2017 Why do you use such a strange url? You created the application with your class as Dispatch class. So, in this case, you should call this. http://localhost:57772/USER/REST/Arun where /USER/REST is web application, and everything else is already what should be in a REST. PS. I would not recommend do not use uppercase for web applications
go to post Dmitry Maslennikov · Dec 1, 2017 You can use colon to achieve it <Route Url="/checkUID/:uid/:supplierid/" Method="GET" Call="Some.Other.Class:checkUID"/> With Map tag in UrlMap, you can simply split your big UrlMap by multiple classes