Features of the mql5 language, subtleties and tricks - page 129

 
fxsaber:

ME has an ALT+V combination where you can see the previous values of the system clipboard. Even if you copied something from the browser and ME was working in the background, ME will see it and remember it.

Roughly speaking, ME sees a lot of what you do on the computer. For example, if you paste in an account password via the buffer, it goes into ME's history.

I copy a lot into this megabuffer, I have to restart ME to clear this buffer, but when ME starts up it still picks up the current data from the buffer, it's annoying, I suggested adding a clear buffer button at the bottom and numbering positions, when pasting it is easier to navigate by position numbers and not by content

 
Vitaly Muzichenko:

Wow, I'm copying cryptocurrency passwords. How detrimental is that to me?

For example, if you give access to your computer from outside (TeamViewer, etc.), it is advisable to log out of all ME and clean the buffer (copy the rubbish there) before doing so.

 
fxsaber:

ME has an ALT+V combination where you can see the previous values of the system clipboard. Even if you copied something from the browser and ME was working in the background, ME will see it and remember it.

Roughly speaking, ME sees a lot of what you do on the computer.

Thanks. Interesting. It's worth adding that it's not just what's been copied into ME that's saved, but everything in all applications. Specifically have to check to what depth is saved, just checked now, saw three copied texts, two from ME and one from the text in the post on this forum.

ps; Even two from the forum text


 
And just in case, make sure that nothing is searched for or replaced. In metaeditor.ini this
FindWhatX=text
ReplaceWithX=text
 
fxsaber:

ME has an ALT+V combination where you can see the previous values of the system clipboard. Even if you copied something from the browser and ME was working in the background, ME will see it and remember it.

Roughly speaking, ME sees a lot of what you do on the computer. For example, if you paste in a password for an account or personal account from another resource via the buffer it will go into the history of the current ME session.

This is an interesting feature. Good thing the buffer is stored in memory and not in a file.

 

Here's another subtlety.

The compiler doesn't complain about functions of the same name with different input parameters, even if they don't belong to a class.

void OnStart()
{
 f1("28-70 ОГО");
 f1(1.01);
}

void f1(string s)
{
 Print(__FUNCSIG__, " ", s);
}

void f1(double s)
{
 Print(__FUNCSIG__, " ", s);
}

Execution result

2019.03.10 10:34:45.566 !00 (EURUSD,H4) void f1(string) 28-70 ОГО
2019.03.10 10:34:45.566 !00 (EURUSD,H4) void f1(double) 1.01
 

The multi-buffer is great for speeding up the editor and is safe.

It does not write anything to disk and only keeps data in memory.

 
Alexey Viktorov:

Here's another subtlety.

The compiler doesn't complain about functions of the same name with different input parameters, even if they don't belong to a class.

Runtime result

This is a normal function overloading. Everything is standard.

 
Artyom Trishkin:

It's a normal function overload. Everything is standard.

For some reason, I thought overloading only worked in classes. I'd like to think I'm not the only one. Maybe this will help someone. ))))

 
The optimizer cache can be disabled by the following technique
// Способ выключить кеш оптимизатора
sinput bool inCache = true; // Выключить кеш оптимизатора

input int Range = 0; // 0..10

void OnTesterInit( void )
{  
  if (inCache)
  {
    MathSrand((int)TimeLocal());
    
    ParameterSetRange("inCache", false, MathRand(), 0, 0, 0);    
  }
}

void OnTesterDeinit( void ) {}

void OnTesterPass( void )
{
  static int i = 0;
  
  Print(i++); // Признак того, что кеш выключен.
}

double OnTester( void )
{
  if (MQLInfoInteger(MQL_OPTIMIZATION))
  {
    uchar Data[];

    FrameAdd(NULL, 0, 0, Data);
  }

  return(0);
}


Of course, a better solution would be if the developers gaveOptimizationCacheOff().

Note that the bool input parameter is actually a long. So bool inCache = 1 and bool inCache = 2 are different input parameters, although they are true in both cases.