Eduard Lebedyuk · Nov 12, 2022 go to post

possible word delimiters weren't specified (space, tab, etc.)

Single whitespace

no specification about punctuation marks (allowed or disallowed)

No punctuation

no specification about empty words (allowed or disallowed) and how to handle them, if allowed

No empty words in input.

"O2K. I'1m" --> "I'm OK."
"spac4es are2    1There     ma3ny" --> "There are many spaces."

Not a valid input for this golf.

Eduard Lebedyuk · Nov 8, 2022 go to post

Adapters cannot exist outside of BHs so you can use ##class(Ens.Director).IsItemEnabled(component) on the BH adapter belongs to.

Eduard Lebedyuk · Nov 3, 2022 go to post

Something like this:

#define USE_CALLIN_CHAR

#define ZF_DLL  /* Required only for dynamically linked libraries. */
#include <cdzf.h>
#include <windows.h>
#include <wand/magick_wand.h>

#ifdef __linux__
	#include <dlfcn.h>
#endif

void resize(char *file, char *fileOut)
{
	MagickWand *m_wand = NULL;
	
	int width,height;
	
	MagickWandGenesis();
	
	m_wand = NewMagickWand();
	// Read the image - all you need to do is change "logo:" to some other
	// filename to have this resize and, if necessary, convert a different file
	MagickReadImage(m_wand, file);
	
	// Get the image's width and height
	width = MagickGetImageWidth(m_wand);
	height = MagickGetImageHeight(m_wand);
	
	// Cut them in half but make sure they don't underflow
	if((width /= 2) < 1)width = 1;
	if((height /= 2) < 1)height = 1;
	
	// Resize the image using the Lanczos filter
	// The blur factor is a "double", where > 1 is blurry, < 1 is sharp
	// I haven't figured out how you would change the blur parameter of MagickResizeImage
	// on the command line so I have set it to its default of one.
	MagickResizeImage(m_wand,width,height,LanczosFilter,1);
	
	// Set the compression quality to 95 (high quality = low compression)
	MagickSetImageCompressionQuality(m_wand,95);
	
	/* Write the new image */
	MagickWriteImage(m_wand, fileOut);
	
	/* Clean up */
	if(m_wand)m_wand = DestroyMagickWand(m_wand);
	
	MagickWandTerminus();
	return ZF_SUCCESS;
}

ZFBEGIN
	ZFENTRY("resize","cc",resize)
ZFEND

You can now also use Embedded Python to resize images.

Eduard Lebedyuk · Nov 2, 2022 go to post

Sure:

set db = ##Class(SYS.Database).%OpenId(dir,,.sc)
write db.Mirrored

where dir is a directory with IRIS.DAT.

Eduard Lebedyuk · Oct 31, 2022 go to post

Here's how:

  • Install ghostscript system-wide (Linix: apt install ghostscript, Windows)
  • Download fonts, for example here's some cyrillic fonts (you need another font - it's just an example): PT Courier - Cyrillic
  • Extract TrueType font CRR35__C.TTF into any gs font folder
  • To list gs font folders execute: gs -help, in Windows its usually %ProgramFiles%\gs\gsVERSION\fonts, in Linux /usr/share/ghostscript/fonts
  • Add MyFont info sourcing it from CRR35__C.TTF into gs font table: /MyFont (CRR35__C.TTF) ;
  • Font table in Windows: %ProgramFiles%\gs\gsVERSION\lib\Fontmap.GS, Linux: /usr/share/ghostscript/current/Resource/Init/Fontmap.GS

Nevermind, that's only if you want to use gs directly. For FOP follow these instructions.

Eduard Lebedyuk · Oct 13, 2022 go to post

Not sure about the last one:

	{
		"StartDate": "2022-12-01T00:00:00",
		"EndDate": "2022-11-30T23:59:59"
	}

Anyways, I usually use this logic:

  • Get 1st day of month
  • DATEADD 1 Month
  • DATEADD -1 Day

Accounts for year breaks, leap months, everything.

Eduard Lebedyuk · Oct 12, 2022 go to post

Awesome news!

How does:

As of now, ARM and Intel platform containers are published under the same name. So on an Intel machine "docker pull containers.intersystems.com/intersystems/iris:1111.2.3.456.0" will return the intel image, on an ARM machine that same pull will return the ARM image automatically, without needing to have a special .../iris-arm image.

relate to

  • docker pull containers.intersystems.com/intersystems/iris-arm64:2022.2.0.356.0
  • docker pull containers.intersystems.com/intersystems/irishealth-arm64:2022.2.0.356.0

?

Eduard Lebedyuk · Oct 11, 2022 go to post

Test is a Get method arg:

Set tSc=Httprequest.Get(, 1)

Try this and compare the output to a successful request.

It's very likely your issue relates to mac, so you can also try:

Do Httprequest.InsertParam("mac", $zcvt("CC:1B:E0:E1:A6:44", "O", "URI"))
Eduard Lebedyuk · Oct 11, 2022 go to post

Try to define your parameters in a structured way:

Set Httprequest.Location="api/gap/nodes"
Do Httprequest.InsertParam("filter_rssi", -75)
Do Httprequest.InsertParam("chip", 1)
Do Httprequest.InsertParam("mac", "CC:1B:E0:E2:3C:10")
Do Httprequest.InsertParam("active", 1)
Do Httprequest.InsertParam("event", 1)
Set tSc=Httprequest.Get()

Also Get has a test parameter, try setting it to 1 to see what's being sent and compare to a successful request.

Eduard Lebedyuk · Oct 7, 2022 go to post

There are four entry points:

  • CanNodeStartToBecomePrimary
  • CheckBecomePrimaryOK
  • NotifyBecomePrimary
  • NotifyBecomePrimaryFailed

None of these entrypoints are related to DR promotion, so the answer is no.

UPD: to clarify none of these entrypoints are related to DR promotion to backup. Becoming primary event would work.

Eduard Lebedyuk · Oct 3, 2022 go to post

HS.SDA3.Container is a registered, not persistent object so you can't pass it between business hosts.

Pass xml stream instead.

Eduard Lebedyuk · Oct 3, 2022 go to post

GetSDA method accepts HL7 source in source variable and returns SDA stream in xml variable.