Stuart Strickland · Mar 4, 2022 go to post

Nice article. Didn't know the easy way round negative dates.

But how does it handle the English calendar riots of 1752 when we went from September 2nd to September 14th overnight?

It returns a value of -32438 for September 3rd 1752 which didn't exist in England which is where I am now. Someone needs to fix this quickly!

Stuart Strickland · Feb 2, 2022 go to post

Add's to GJ's effort and counts how many occurrences of the odd integer to be able to return exact answer (not a $ZABS answer).

Stuart Strickland · Feb 2, 2022 go to post

ClassMethod Solve(o As %String) As %Integer

{

 s i=$l(o,","),j=$l(o,"-")-1,k=i-j-j s:k<0 k=k-j-j s m=$tr(o,",","+")_"/"_k

 q @m

}

Stuart Strickland · Dec 1, 2021 go to post

Thanks Robert. I guess that by now all the points worth gaining are gone so it won't hurt to post this. Is this the sort of answer that is being looked for?

(Rename classname to Day1?, Entry point should be ClassMethod Test()?)

Stuart Strickland · Dec 1, 2021 go to post

So it is a race. And being awake at the right time no matter where you are in the world is a big advantage given a fixed start time of Midnight UTC-5.

Stuart Strickland · Dec 1, 2021 go to post

Thanks for the quick reply. Yep, worked first time on a MAC. 

Still not sure of the rules, and given your experience, I'm not sure it will be enjoyable. Can't believe this is the template:

At least I've gained some knowledge on some of what can be done with Docker.

Stuart Strickland · Dec 1, 2021 go to post

I was going to play but it is difficult to get started.

Tried to get the template, downloaded git and Docker desktop, got a git account, got IRIS working through Docker - was quite impressed with that) but cannot get the template. Am getting at least 2 errors on "docker-compose build" command:

Is it possible to play without the template? Surely it's just a class in UDL format?

The day 1 problem is easy to solve. I expect most of us could do it in one line of code. But what are the rules? How does the scoring work? Is it a race? Do you need to be in the first 5 people to finish it every day? Is it judged by someone? If so, what are you looking for? If you can't get your entry in on day 1 will you be too far behind?

Going to try it on a MAC instead of Windows, maybe that will help.

Stuart Strickland · Sep 9, 2021 go to post

or include

S X=$ZU(123,0,1,1)

in your system startup routine so that the only date that ever shows up with a 2 digit year is 1st Jan 1841

Check out the old %DATE utility

Stuart Strickland · Aug 5, 2021 go to post

Or this

BinaryToDecimal(Binary,Debug=0)
              Debug {
                             !,"Binary number: ",Binary
                             !,"Bit",?20,"Cumulative",!
              }
              Decimal=0
              Power=0:1 {
                             Bit=$e(Binary,*) ; last digit
                             q:Bit=""  ; at end
                             s $e(Binary,*)="" ; shorten binary number by removing last character
                             Integer=(2**Power)*Bit ; 2**0 =1, 2**1 =2, 2**2 =4 etc..
                             Decimal=Decimal+Integer ; running decimal sum of each Bit
                             Debug Integer,?20,Decimal,!
              }
              Decimal

Stuart Strickland · Jul 23, 2021 go to post

Prefer the SET method for both readability and performance. However, when it comes  to readability, I see it as my deficiency if I can't read it instead of the author's deficiency - unless the code is deliberately obtuse. And when it comes to performance, you should only write something unreadable if it is necessary to gain performance for code run hundreds of thousands of times a day. But then you would comment your code so well that anyone could read the comment and wouldn't need to read the code to know how it worked and what it does.

Stuart Strickland · Jul 10, 2021 go to post

can save 4 more characters with

$p("lfa7ravo7harlie7elta7cho7oxtrot7olf7otel7ndia7uliett7ilo7ima7ike7ovember7scar7apa7uebec7omeo7ierra7ango7niform7ictor7hiskey7ray7ankee7ulu",7,$a(c)#32)

instead of 's l=' and '$p(l,'

Stuart Strickland · Jul 9, 2021 go to post

N(i) s l="lfa7ravo7harlie7elta7cho7oxtrot7olf7otel7ndia7uliett7ilo7ima7ike7ovember7scar7apa7uebec7omeo7ierra7ango7niform7ictor7hiskey7ray7ankee7ulu"

 f j=1:1:$l(i) s c=$e(i,j),o=$g(o)_$s(",.!?"[c:c,c?1a:$e(" ",j>1)_c_$p(l,7,$a(c)#32),1:"")

q o

; 243 chars

; save 2 quote characters by using a number (7) as the delimiter

; save characters by not $ZCVT to upper, $A(k)#32 works fine for lower and upper

;save on $ZSTRIP of whitespace by only adding space character for every letter after 1st one

; ensure to follow the rules on allowed punctuation and exclude all other characters

Stuart Strickland · May 20, 2021 go to post

Hi Oliver,

I spent 20 years developing software, originally in MUMPS but now in Objectscript, runs on IRIS, that generates SWIFT MT messages for transmission in categories 1,2,3 and 5. Also receives messages in all categories and decodes and processes them. System also handles message matching and bank reconciliations. All automated save for a bit of exception handling when the wrong data is input. Also seamless connectivity with SWIFT Alliance system so the messages go straight out from the back office system and across the SWIFT network with full ACK/NACK processing. Added GPI and LAU to the connectivity process. Did a bit of freelance work a couple of years ago on the MX messages too. Processed about 4 billion messages in 20 years with close to 100% STP. It's all quite do-able in IRIS.

Stuart Strickland · Feb 24, 2020 go to post

I had similar problems with the digital signature classes provided with Caché solved by extending the classes and adding the missing properties. Once extended you could add and InclusiveNamespace property and populate it with anything you like. You may find that you have to extend the entire digital signature package or even copy the package to a new one so that you can add what you want.