Errors, bugs, questions - page 2709

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Why can't I call a protected constructor from my factory method in MQL?
The problem is the default value, if you remove it, everything works as it should:
Why in MQL you can't call a protected constructor from your factory method?
I haven't guessed where that might be useful.
Haven't guessed where this might be useful.
Classic implementation of the Singleton pattern.
A classic implementation of the Singleton pattern.
So you can't create more than a certain number of objects of a given class?
So that no more than a certain number of objects of a given class can be created?
Yes, so that there is a single access point from all parts of the program to an instance of the class with changeable state.
Here's a cool site I found today about patterns in pictures and pseudocode:https://refactoring.guru/ru/design-patterns/singleton
Yes, to have a single access point from all parts of the program to a state-changing class instance.
Here's a cool site I found today about patterns in pictures and pseudocode:https://refactoring.guru/ru/design-patterns/singleton
Got it, thanks. I've used such a construction before.
The problem is with the default value, if you remove it, everything works as it should:
But in C++, it works with the default value, too. How does it affect it?
Has anyone managed to make MQL-based CryptEncode(CRYPT_ARCH_ZIP, data[], key[] = {1,0,0,0}, result[]) work with deflate compression from websocket? Public echo-server (echo.websocket.org) doesn't seem to support this extension, I haven't found any other echo-server and local node.js gives error "zlib invalid distance too far back" when trying to decrypt compressed data. I set server_max_window_bits=15; client_max_window_bits=15 in the header, but it doesn't seem to be the case as the server confirms these settings. On the MQL side I can't set anything except {1,0,0,0} key ;-(.
Has anyone has hooked up MQL's CryptEncode(CRYPT_ARCH_ZIP, data[], key[] = {1,0,0,0}, result[]) with deflate compression from websocket? Public echo-server (echo.websocket.org) doesn't seem to support this extension, I haven't found any other echo-server and local node.js gives error "zlib invalid distance too far back" when trying to decrypt compressed data. I set server_max_window_bits=15; client_max_window_bits=15 in the header, but it doesn't seem to be the case as the server confirms these settings. On the MQL side I can't set anything except {1,0,0,0} key ;-(.
If I understood your question correctly, GZIP compression is mainly used in websockets for data packaging.
The CRYPT_ARCH_ZIP constant most likely packs to regular ZIP.
If you know how to pack/unpack GZIP using mql5, I'm also interested.
If I understand the question correctly, websockets mostly use GZIP compression to pack data.
The CRYPT_ARCH_ZIP constant most likely packs to regular ZIP.
If you know how to pack/unpack GZIP, using mql5 tools, I'm also interested.
As far as I know, switch {1,0,0,0} removes all wrapping and leaves only compressed package. At least "Hello" word appears in compressed form in the same way in CryptEncode output and in deflate output. Accordingly, it should work the other way round as well. However, MQL does not give any more settings and does not show deflate's "default" settings used by it. Obviously they are different, but only max_window_bits and no_context_takeover can be controlled in the websocket - firstly they are clearly less than in the deflate algorithm (which is configured on the server), secondly even they cannot be configured in CryptEncode/Decode.