how to change centura theme at runtime - guptateamdeveloper

How to change application theme at run time of an application developed in Team developer. I have already tried Build Settings - General settings, but there I didn't find any option for changing theme at run time.

You change theme programatically at run time using the below mentioned Sal functions,
SalThemeSet
bOk = SalThemeSet( ThemeId)
Where parameter ThemeId - numeric value that specifies theme.
Few Supported Theme values are listed below,
0 - THEME_Default
1 - THEME_Office2000
2 - THEME_OfficeXP
3 - THEME_Office2003
4 - THEME_Office2003NoThemes
5 - THEME_Studio2005
6 - THEME_Studio2008
7 - THEME_NativeXP
8 - THEME_Office2007_R1
9 - THEME_Office2007_R2_LunaBlue
10 - THEME_Office2007_R2_Obsidian
11 - THEME_Office2007_R2_Silver
12 - THEME_Office2007_R3_LunaBlue
13 - THEME_Office2007_R3_Obsidian
14 - THEME_Office2007_R3_Silver
15 - THEME_Office2010_R1
16 - THEME_Office2010_R2_Blue
17 - THEME_Office2010_R2_Silver
18 - THEME_Office2010_R2_Black
Also you can try SalThemeGet ( ) function for retrieving theme at run time.
The function will return numeric theme value.
Let me know if you have any more questions on this.

Be aware there is a recent registered issue concerning some Themes showing heavy flickering on forms when activated / deactivated when switching focus between different MDI child windows containing many controls.
THEME_Office2013 shows the flickering, while TD native XP theme does not.
See TD-23978: Most Themes show heavy flickering on forms when activated / deactivated

Related

This document requires 'TrustedScriptURL' assignment in Google Sheets

I have a Google Spreadsheet where I have the following information on specific cells in the sheet:
Cell B1: Has the URL http://www.google.com.co/search?q=NASA+watching+now%3A+site%3Awww.youtube.com
Cell B2: has the following formula: =IMPORTXML(B1,"//title")
Here is the link of the Google spreadsheet - if you want to test from your side.
And here is the Google Spreadsheet I'm working on - which, I want to get the specific data:
Title: Text (in the h3 HTML tag of the result item).
Url: Link (in the <a> HTML tag of the result item)
Description: Text next to the thumbnail of the result item.
See screenshot with the data to get using IMPORTXML:
The previous code returns the title of the given URL - in this case, the URL stored in the B1 cell.
It was working without problems (since 12/02/2022 - dd/MM/yyyy) until today (13/02/2022 - dd/mm/yyyy).
I checked the Chrome console "F12 Developer tools" and I get this error:
This document requires 'TrustedScript' assignment.
injectIntoContentWindow # VM364:27
By clicking the # VM364:27 line, the following code is shown:
function injectIntoContentWindow(contentWindow)
{
if (contentWindow && !injectedFramesHas(contentWindow))
{
injectedFramesAdd(contentWindow);
try
{
contentWindow[eventName] = checkRequest;
contentWindow.eval( /* ERROR with and (X) is shown here. */
"(" + injectedToString() + ")('" + eventName + "', true);"
);
delete contentWindow[eventName];
}
catch (e) {}
}
}
Searching on the internet, I barely could get the causes of this error:
Google Chrome update - making security stricter.
Chrome extensions - try to disable such extensions and try again.
CPS (Content-Security-Policy) - must be honest = I don't understand this point; it's from the website to scrape the data OR from Google Sheets the CPS is the root cause?
The solutions given to this problem are in Python - with the use of DOMPurify - as is described in this answer, but, I don't know and neither have found any clues about this problem and its solution in Google Spreadsheets.
I've tried:
Recover previous working Google Spreadsheet version - the result is that the formula re-evaluates and no result is returned; looking in Console, the This document requires 'TrustedScriptURL' assignment message shows.
Disable Google Chrome installed extensions - I only have AdBlock (this code was working without issues), anyway, I turned off, reload the spreadsheet and the error mentioned above raises in Console.
Using another page - I tried with Wikipedia and Wiki.fandom and it works - i.e. data is returned. Probably in this case, Google injected in their searcher an script for avoid injection? - I'm really not sure, only speculating/rambling here.
Another possible cause I consider is maybe my IP was blacklisted or blocked, but, I'm not sure.
My browser information:
Chrome version: 98.0.4758.82 (Build oficial) (64 bits) (cohort: Stable)
Windows 10 Version 21H2 (Build 19044.1466)
Is there any way to solve this error in Google Sheets?
PS: I'm interested in know the workaround using google sheets and/or custom scripts - via script editor/Apps Script. The use of IMPORTXML function is not mandatory - I find curious that it was working and then today, not anymore.
I will just leave this here:
=INDEX(UNIQUE(REGEXREPLACE(QUERY(IMPORTXML(A1, "//a/#href"),
"where Col1 contains 'youtube.com/'"), "\/url\?q=|&sa=.*", )))
=IMPORTXML(A1, "//title")
=IMPORTXML(A1, "//h3")
TL;DR: This document requires 'TrustedScript' assignment error is not the root cause of the delay of the IMPORTXML function - probably there is other cause(s) (outside of the developer's handling), but, after all, the code works - see working google spreadsheet - just, wait until the results are shown or use another way to web-scrapping the desired data.
Since the This document requires 'TrustedScript' assignment message stays appearing in the Console of the browser, but, the code I posted on my question (and the code posted by SO user player0 in their answer) works, it seems to me that the delay of the response using IMPORTXML might be due its buggy functionality and/or some restriction Google detected by doing multiple requests.
So, here are my tips about this:
Check very closely how the page where the data will be extracted from and its structured before doing excessive requests - or you might face a significant delay in the response of the IMPORTXML function - as I experienced it.
Get more familiar with XPath and check if the data is dynamically generated in the page - this makes even harder to get the desired data using this way of scrapping.
This is the spreadsheet with the desired results - if anyone is interesed1.
1 Check the "Results-mix" sheet (which contains both the code I manage to create and the code provided by player0 in their answer).
If you really want to get similar results in a less convoluted way, consider use another strategy for web-scrapping or use official APIs - when available.

TSaveDialog Options ofAllowMultiSelect doesn't work properly on a W10 system

I have an old application, untouched for a long time, built with C++ Builder 2009, that still works fine.
That is to say ..
Today I noticed some of the TSaveDialog->Options don't work as intended on my Windows 10 system. To make sure I'm not dreaming I tested the same application on an older Windows version (I tried XP) and there it worked perfectly fine as intended.
The TSaveDialog instance is setup at design time with Options: [ofHideReadOnly,ofAllowMultiSelect,ofEnableSizing]
I noticed today (on Windows 10) that ofAllowMultiSelect doesn't work anymore ?
Instead ofOverwritePrompt is (incorrectly) used !
In other words I cannot select two ore more files anymore and when I select a file that already exists I first get a 'Confirm Save As' dialog.
When I compile again on my Windows 10 system, using C++ Builder 2009, in debug mode and inspect Options, the debugger seems to (still) properly see ofHideReadOnly, ofAllowMultiSelect, ofEnableSizing, yet the problem persists. So it's not as if the values changed somehow ?
When I try at runtime:
SaveDialog->Options.Clear() ;
SaveDialog->Options << ofHideReadOnly << ofEnableSizing << ofAllowMultiSelect ;
the problem also persists !
When I remove ofAllowMultiSelect (at run time or at design time) 'Confirm Save As' is not shown anymore on an existing file (but I obviously also still can't select multiple files).
I'm flabbergasted by this to be honest ? Not sure what to do next ?
I have no option to test a more recent c++ version but I'm also having difficulties comprehending how the compiler could be responsible here.
Any guidance appreciated.
Delphi tag added because of VCL overlap between c++ Builder and Delphi
On Windows Vista and later, IF AND ONLY IF all of these conditions are met:
the global Dialogs::UseLatestCommonDialogs variable is true
and the TSaveDialog::Template property is NULL
and the TSaveDialog::OnIncludeItem, TSaveDialog::OnClose, and TSaveDialog::OnShow events have no handlers assigned
Then TSaveDialog will internally use the Win32 IFileSaveDialog interface, where the ofAllowMultiSelect option will be mapped to that dialog's FOS_ALLOWMULTISELECT option, which is NOT SUPPORTED by IFileSaveDialog, only by IFileOpenDialog, per the documentation:
FOS_ALLOWMULTISELECT
Enables the user to select multiple items in the open dialog. Note that when this flag is set, the IFileOpenDialog interface must be used to retrieve those items.
If the above 3 conditions are not satisfied, then TSaveDialog will internally use the Win32 GetSaveFileName() function instead, where the ofAllowMultiSelect option will be mapped to that dialog's OFN_ALLOWMULTISELECT option, which IS SUPPORTED by GetSaveFileName() 1.
That is why you are seeing behavioral differences when running your app on Windows XP vs Windows 10.
So, if you want the old TSaveDialog behavior on newer Windows versions, you need to make sure at least 1 of those 3 conditions is not satisfied. For instance, by setting UseLatestCommonDialogs=false before calling SaveDialog->Execute(), or by assigning an (empty) event handler to one of the OnIncludeItem/OnClose/OnShow events.
Or, you could simply call GetSaveFileName() directly, instead of using TSaveDialog at all.
1: However, just note that on Vista+, GetSaveFileName() is just a wrapper for IFileSaveDialog, and is provided only for backwards compatibility. So, you still might not get the exact behavior you want even if you did use GetSaveFileName() on Windows 10.
On a side note: this code does not work the way you think it does:
SaveDialog->Options.Clear();
SaveDialog->Options << ofHideReadOnly << ofEnableSizing << ofAllowMultiSelect;
The Options property is not actually updated! In both statements, the Options property is read from, returning a temporary TOpenOptions, which you are then modifying, but not assigning back to the Options property. IOW, the code is effectively doing the following:
TOpenOptions temp1 = SaveDialog->Options;
temp1.Clear();
TOpenOptions temp2 = SaveDialog->Options;
temp2 << ofHideReadOnly << ofEnableSizing << ofAllowMultiSelect;
So, to update the Options property correctly, use this instead:
SaveDialog->Options = TOpenOptions() << ofHideReadOnly << ofEnableSizing << ofAllowMultiSelect;

MetaEditor/MQL4 ExpertAdviser: Local Variable Declaration More Than Once?

I am looking at some old MetaEditor4 / MQL4 code, where a local variable was declared twice:
......
1 int start()
2 {
3 if (1==2)
4 {
5 double myVar = 1;
6 } else
7 {
8 double myVar = 2;
9 }
10 return;
11 }
.......
The compilation process in MetaEditor, version 5.00, build 1601, fails with:
'myVar' - variable already defined in line 8.
If I remove the line 8, the compilation goes well.
My questions are:
1. Is there any option in MetaEditor that tolerates the multiple declaration of a local variable?
2. In previous versions of MetaTrader Terminal 4 / MetaEditor and .MQ4 code: was it possible to declare a local variable more than once in such a situation?
3. The MetaEditor has the version 5.00, build 1601, but the extension of the code is .mq4 and it was installed together with the MetaTrader Terminal software MetaTrader4 ( from FXCM ). Therefore I assume I can still use .MQ4 code with it. Is there any chance to get a pure MQL4 installation from somewhere?
Whenever I install mt4 ( from e.g.: mt4 download), it ends up
with the mt5 installer.
Prologue:
The worlds of MQL4 evolve. One may try to circumvent this fact, but finally, at one's own disappointment, attempts to avoid evolution will sooner or later go in vain.
Having been thrown into a need to re-engineer code-base spanning a few man*decades in size, I can tell you many stories about what worked and what did not.
An "Old code" v/s a New-MQL4.56789
If just one thing ought be taken from this, never try to "circumvent" New-MQL4, but rather review the code and refactor the "Old code" - this is a way safer way to survive ( way longer ).
Yes, there are chances ( zero warrants, just a few chances left temporarily on the table ) the new compiler version will remain able to generate an executable version of the code, but given a new set of rules have already come in the city, the game will not last long.
Ad 1 + 2 )Compiler still tolerates multiple declarations, but not in one scope
If new version of a compiler defined that any variable is declared only relative to it's scope of validity, the serious programmer ought take this as a general principle. The code above actually has other problem, right nailed to the scope-of-validity:
2 ...
3 if ( 1 == 2 ) {
4 ...
5 double myVar = 1; // myVar declared & known |since HERE >
6 ... // masking any other,|known HERE :
7 ... // |known HERE :
8 } else // |till HERE . Undef further
9 {
10 ...
11 double myVar = 2; // myVar declared & known |since HERE >
12 // masking any other,|known HERE :
13 ... // |known HERE :
14 } // |till HERE . Undef further
so, if there were any _global_ scope'd variable with the same name myVar, it will not be "visible" during an existence of locally declared variable, wearing the same name.
Finally, having the code-execution escaped from any of the lines 8 or 14 further, the locally there declared variable double myVar simply ceased to exist anymore and this behaviour is principally correct ( and the "older" compiler releases were tolerating a sort of dangerous habit of side-effects, during years of tolerating scope-of-validity spillover(s), so it was the high time to clean the rules, so as to meet a fair level of C/S standards.
Ad 3) language receives a lot from MQL5, even if not used in MQL4
Yes, MetaEditor will correctly compile a MQL4 code into .mq4 code-execution format, no problem here. Even an auto-update process started to go independently from MT4 Terminal platform (auto-)updates ( so you will quite often see new Help file coming and enforced re-compilation of all your localhost visible .MQ4 assets into updated .EX4 format, so "Do not panic."
Better never install a Broker-agnostic MT4, always go to your Broker's Support and get installation package & help from your Broker. This is business relation you have signed in a contract, so keep these strings as you are going to trade your money on a table they operate under the set Terms & Conditions. Some Brokers have means of platform customisations, so rather benefit from their custom settings that will match their Server-side automation.
It is more a question of economy of R&D efforts. ( May read a lot about language components injected from the MQL5 domain in the IDE Editor MQL4 Help ). This is a natural will of the product design strategy, not to double efforts on a dual-line. Without doubts, there are many details the Help file could be improved and better maintained, the common sense here is to live with the facts and re-learn what newly introduced features remain neutral for the MQL4 code base and what new things may actually help one a lot in aspects, where older compilers were short in powers.
If one objects that some compiler / platform re-design steps were bad, I would agree on a single-thread, platform-critical, potentially blocking, concentration of executing all the CustomIndicator-s in just one SPoF-thread.
But C'est La Vie, until system architects will not review this SPoF, the platform will remain susceptible to crashes from this feature, but the ball is on the other side of the court and a change will have to be implemented there.
the code might be run with 'strict' or non-strict mode.
strict means that variable must be declared within its scope, non-strict - all the mess that you have now.
so put #property strict at the beginning of the file
open a demo account somewhere and install mt4 there. demo can be valid for 30 days only with registration via web-site of a broker or with unlimited and demo opened from mt4 (example - Alpari)

Is there a keyboard shortcut to restart the current console in cmder?

It seems like there is with ConEmu https://conemu.github.io/en/KeyboardShortcuts.html "Win+~" but a way to restart the current console in cmder would be great.
Cheers
Go to Settings - Main - Keys & Macro
Then select "Recreate active console" from the list and set hotkey for it.
This action will show a dialog with three buttons: Restart, Terminate, Cancel. Restart is a default button and you can choose it by just pressing ENTER key.
According to the current help of cmder:
Recreate(<Action>[,<Confirm>[,<AsAdmin>]]), alias "Create"
- Create new tab or restart existing one
Action: 0 - create tab, 1 - restart tab, 2 - create window
Confirm: 1 - show ‘Create new console’ dialog, 0 - don't show
AsAdmin: 1 - start elevated tab
Open Settings - Keys & Macros - Select Macros from dropdown - use one of the unused Macro places (input macro into GUI Macro)
Example:
Recreate(1, 0, 1)
Restart Tab - do not show confirmation window - start as admin

Work progress report in weekly basis by the users in jira

How can I view the task done/in progress in weekly basis by the users in jira??
Thanks in advance.
Your question isn't very clear, what do you mean by done/in progress ? the status of the issue? and by saying How can I view what exactly do you mean? see them from Jira? send a weekly mail?
Anyway, in case that by saying done/in progress you mean that the issue is closed/unclosed, and you are looking to the right JQL query, than:
Closed last week:
project = Development and status = Closed and updated >= "-7d"
Worked on during last week, but not closed:
project = Development and status != Closed and updated >= "-7d"
Opened last week, but not closed:
project = Development and status != Closed and created >= "-7d"
and so on.. For more queries option visit JIRA Advanced Searching. If you have more questions feel free to ask.
I wrote a simple cli tool jira-report, that queries your jira and prints weekly report to console:
$ jira-report
Jira site address: https://jira.company.com
Username for 'https://jira.company.com': admin
Password for 'https://jira.company.com':
Connecting to 'https://jira.company.com'. Pls wait...
What was [admin] doing:
Created: 2
WFM-7180 - Provide static context for log property in BasicHashAnalyzer
TST-5862 - Unable to install Nginx on HP-UX with Java 6
Resolved: 8
GSM-364 - Migration of existing scenario
WFM-5865 - NullPointerException while finding categories
TST-5864 - Some NGinx installation improvements
TST-5863 - NGinx minimal dependency
SDK-7139 - Move common interfaces and classes from into individual jar
SDK-7138 - Move common interfaces and classes from into individual dll
TST-7111 - Event.getDonotNotify doesn't indicate about agent's state
TST-6985 - TST classes should have static Log fields
Reopened: 0
Closed: 5
TST-6943 - Remove redundant org.apache.log4j dependency from common part
TST-5862 - Unable to install NGinx on HP-UX with Java 6
TST-5857 - Put back support for Jdk 1.6
TST-5840 - NGinx fails to handle interaction initiated
GSM-364 - Migration of existing units
Enjoy it!

Resources