C++ Builder XE, dbExpress with MySQL 5.x - mysql

I'm trying to get the dbExpress TSQLConnection to work with a MySQL 5.x server.
I have searched the net but not found any helpfull instruction for C++ Builder XE.
I downloaded the dbxopenmysql50.dll driver from just software solutions and followed the instructions on their site.
I downloaded the libmysql.dll from mysql and put the dll's in the bin folder of C++ Builder XE and edited the dbxdrivers.ini to use the new DLLs.
In the IDE when I tset the TSQLConnection property connected to true, the dbxopenmysql50.dll crash with Access Violation in address bla bla bla...
I don't care about my current setup, but is there ANYONE that have this working?
How did you make it work? Please direct me where to download free working DLLs for dbExpress with MySQL 5.x
Here is some more error information:
"Access violation in address 10395D99 in module 'dbxopenmysql50.dll'. Read of
address 0275C8D".
Detailed dump from C++ Builder XE Error dialog.
(00004D99){dbxopenmysql50.dll} [10395D99]
[50037560]{rtl150.bpl } System.#FreeMem (Line 3768, "System.pas" + 20) + $0
[500415CF]{rtl150.bpl } System.LocaleCharsFromUnicode (Line 29632, "System.pas" + 1) + $17
[50052A6C]{rtl150.bpl } SysUtils.StrPosLen (Line 9617, "SysUtils.pas" + 8) + $13
[5003D9B4]{rtl150.bpl } System.#UStrDelete (Line 22863, "System.pas" + 10) + $5
[50037560]{rtl150.bpl } System.#FreeMem (Line 3768, "System.pas" + 20) + $0
[5003C0B0]{rtl150.bpl } System.#UStrClr (Line 16968, "System.pas" + 14) + $0
[500A0F89]{rtl150.bpl } Classes.TStrings.GetValueFromIndex (Line 5756, "Classes.pas" + 12) + $10
[51D1B35B]{DbxCommonDriver150.bpl} Dbxdynalink.TDBXDynalinkDriverCommonLoader.LoadDriverLibraryAndMethodTable + $E3
[51D1AFE9]{DbxCommonDriver150.bpl} Dbxdynalink.TDBXDynalinkDriver.LoadDriver + $35
[51D1DCD8]{DbxCommonDriver150.bpl} Dbxdynalinknative.TDBXDynalinkDriverNative.CreateConnection + $C
[51CF0C19]{DbxCommonDriver150.bpl} Dbxcommon.TDBXDelegateDriver.CreateConnection + $5
[51CF6666]{DbxCommonDriver150.bpl} Dbxcommon.TDBXConnectionBuilder.CreateConnection + $B6
[51CE7B5C]{DbxCommonDriver150.bpl} Dbxcommon.TDBXConnectionFactory.GetConnection + $E8
[51CE7A6D]{DbxCommonDriver150.bpl} Dbxcommon.TDBXConnectionFactory.GetConnection + $5
[50FFC77F]{dbexpress150.bpl} SqlExpr.TSQLConnection.DoConnect (Line 2537, "SqlExpr.pas" + 52) + $5
[5070E10D]{dbrtl150.bpl} DB.TCustomConnection.SetConnected (Line 3167, "DB.pas" + 8) + $4
[50089A3E]{rtl150.bpl } TypInfo.SetOrdProp (Line 1791, "TypInfo.pas" + 28) + $0
[2105A0A6]{designide150.bpl} DesignEditors.TPropertyEditor.SetOrdValue (Line 841, "DesignEditors.pas" + 2) + $E
[2109E55B]{designide150.bpl} VCLEditors.TBooleanProperty.MouseUp (Line 1840, "VCLEditors.pas" + 5) + $10
[21194BD9]{vclide150.bpl} PropBox.TCustomPropListBox.ItemMouseUp (Line 1625, "PropBox.pas" + 16) + $1B
[21194DCF]{vclide150.bpl} PropBox.TCustomPropListBox.MouseUp (Line 1690, "PropBox.pas" + 1) + $D
[5027E90C]{vcl150.bpl } Controls.TControl.DoMouseUp (Line 7318, "Controls.pas" + 2) + $28
[5027E988]{vcl150.bpl } Controls.TControl.WMLButtonUp (Line 7331, "Controls.pas" + 9) + $6
[2119A4C0]{vclide150.bpl} IDEInspListBox.TInspListBox.WMLButtonUp (Line 1631, "IDEInspListBox.pas" + 3) + $4
[5027DF6C]{vcl150.bpl } Controls.TControl.WndProc (Line 7074, "Controls.pas" + 91) + $6
[06D19928]{AQtime7BDS8.bpl} Aqsyncedit.TaqEditPainter.HasHintInfo + $9B8
[502820C3]{vcl150.bpl } Controls.TWinControl.IsControlMouseMsg (Line 9608, "Controls.pas" + 1) + $9
[50282830]{vcl150.bpl } Controls.TWinControl.WndProc (Line 9831, "Controls.pas" + 144) + $6
[502B8409]{vcl150.bpl } StdCtrls.TCustomListBox.WndProc (Line 6217, "StdCtrls.pas" + 54) + $6
[50281ED0]{vcl150.bpl } Controls.TWinControl.MainWndProc (Line 9552, "Controls.pas" + 3) + $6
[500AFA64]{rtl150.bpl } Classes.StdWndProc (Line 13491, "Classes.pas" + 8) + $0
[50358AF7]{vcl150.bpl } Forms.TApplication.ProcessMessage (Line 9760, "Forms.pas" + 23) + $1
[50358B3A]{vcl150.bpl } Forms.TApplication.HandleMessage (Line 9790, "Forms.pas" + 1) + $4
[50358E65]{vcl150.bpl } Forms.TApplication.Run (Line 9927, "Forms.pas" + 26) + $3
Thanks in advance.

I have DBExpress working fine with MySQL 5.1 in Delphi 2010.
So try putting the libMySQL.DLL in your exe directory may help, as this is first place it will look.
check if you need any other DLL's (I needed dbxmys.dll as well , but working with MySQL)
Set the Params to suit your MySQL server - (Localhost, MyDBName, MyUSerName MyPasswd) then try and connect in the IDE. It works for me!
Chris

Related

Minimizing a system of linear equations with limited variables in Octave

I have scoured Octave resources, pdfs on optimization, and many of the questions here, but I can't seem to find or understand the right solution. I'm trying to find a corrective solution to move a group of data points to match closely another set. The equation used is a quadratic with a cross term, i.e. ax^2 +bx +c + d*y = x', where x is from one data set and x' is from another. There is a similar equation for the y coordinate.
I make the x and y values fixed from the data, and am trying to optimize the coefficients to minimize the square sum error between all the points. For now, I'm just trying to minimize the difference between x and x', via ax^2 +bx +c + d*y - x' = 0. I will try to do a square sum of all the equations later, unless someone here can help me with that as well.
I've tried using fminunc and fminsearch, both having and error after a few iterations due to matrix sizes. I don't think these solutions like having more equations than variables. I do not think qp or glpk are useful solutions.
Here is an example of my system of equations I'm trying to minimize. Future iterations may have as many as 32 equations, but the same number of vairables/coefficients.
function zer = fcn(coeff)
zer = zeros(18,1);
zer(1) = coeff(1)*19.338458^2 + coeff(2)*19.338458 + coeff(3) + coeff(4)*17.806945 - 23.200000;
zer(2) = coeff(1)*-0.146987^2 + coeff(2)*-0.146987 + coeff(3) + coeff(4)*2.273490 - 2.900000;
zer(3) = coeff(1)*-18.333520^2 + coeff(2)*-18.333520 + coeff(3) + coeff(4)*-19.133048 - -15.700000;
zer(4) = coeff(1)*-24.447818^2 + coeff(2)*-24.447818 + coeff(3) + coeff(4)*2.146905 - -21.700000;
zer(5) = coeff(1)*0.363997^2 + coeff(2)*0.363997 + coeff(3) + coeff(4)*27.305928 - 3.500000;
zer(6) = coeff(1)*15.042656^2 + coeff(2)*15.042656 + coeff(3) + coeff(4)*-15.456741 - 18.800000;
zer(7) = coeff(1)*18.529375^2 + coeff(2)*18.529375 + coeff(3) + coeff(4)*1.046316 - 22.100000;
zer(8) = coeff(1)*0.045810^2 + coeff(2)*0.045810 + coeff(3) + coeff(4)*-21.082700 - 3.300000;
zer(9) = coeff(1)*-18.499911^2 + coeff(2)*-18.499911 + coeff(3) + coeff(4)*22.048530 - -15.700000;
zer(10) = coeff(5)*17.806945^2 + coeff(6)*17.806945 + coeff(7) + coeff(8)*19.338458 - 16.000000;
zer(11) = coeff(5)*2.273490^2 + coeff(6)*2.273490 + coeff(7) + coeff(8)*-0.146987 - 0.300000;
zer(12) = coeff(5)*-19.133048^2 + coeff(6)*-19.133048 + coeff(7) + coeff(8)*-18.333520 - -21.400000;
zer(13) = coeff(5)*2.146905^2 + coeff(6)*2.146905 + coeff(7) + coeff(8)*-24.447818 - 0.400000;
zer(14) = coeff(5)*27.305928^2 + coeff(6)*27.305928 + coeff(7) + coeff(8)*0.363997 - 25.700000;
zer(15) = coeff(5)*-15.456741^2 + coeff(6)*-15.456741 + coeff(7) + coeff(8)*15.042656 - -18.300000;
zer(16) = coeff(5)*1.046316^2 + coeff(6)*1.046316 + coeff(7) + coeff(8)*18.529375 - -1.100000;
zer(17) = coeff(5)*-21.082700^2 + coeff(6)*-21.082700 + coeff(7) + coeff(8)*0.045810 - -23.200000;
zer(18) = coeff(5)*22.048530^2 + coeff(6)*22.048530 + coeff(7) + coeff(8)*-18.499911 - 20.200000;
endfunction
Erwin and Cris in the comments are 100% correct.
All that needs to be done here is convert this into a matrix with a answer vector.
best_solution = Matrix\answer_vector;
It's embarrassing how much I overcomplicated the problem.

Disable camel-debezium-mysql endpoint URI in Camel metrics

The full Debezium MySQL URI string shows up in metrics. It shows the MySQL user and password in plaintext, which is unsafe. How can one disable this? I followed this setup here.
More information:
Using quarkus 1.11.1.Final which uses camel 3.7.0 with debezium-connector-mysql 1.3.1.Final
This is the Camel route:
from("debezium-mysql:" + config.getConnectorName()
+ "?databaseHostname=" + config.getHost()
+ "&databasePort=" + config.getPort()
+ "&databaseUser=" + config.getUser()
+ "&databasePassword=" + config.getPassword()
+ "&databaseServerName=" + config.getDatabaseServerName()
+ "&databaseServerId=" + config.getDatabaseServerId()
+ "&databaseIncludeList=" + config.getDatabases()
+ "&tableIncludeList=" + config.getTables()
+ "&columnIncludeList=" + config.getColumns()
+ "&databaseHistoryFileFilename=" + config.getHistoryFile()
+ "&offsetStorageFileName=" + config.getStorageFile()
+ "&exchangePattern=InOnly")
.routeId("debezium")
.process(outgoingProcessor)
.marshal().json(JsonLibrary.Jackson)
.to(ExchangePattern.InOnly, outgoingUri)
.to("micrometer:counter:outgoing.counter")
.end();
And when accessing the metrics at /q/metrics, I find this entry:
# HELP CamelExchangeEventNotifier_seconds_max
# TYPE CamelExchangeEventNotifier_seconds_max gauge
CamelExchangeEventNotifier_seconds_max{camelContext="camel-1", endpointName="debezium-mysql://entire connection string here with user and password", eventType="ExchangeCompletedEvent", failed="false", serviceName="MicrometerEventNotifierService",} 0.0
Thank you for bring this up. I have created a Jira ticket to fix this in the upcoming Camel release to mask those sensitive data in those events in the metrics.

Why CurrentApp::AppId take so long in Windows Phone 10?

I have a windows 8 universal project and have a function to get APP ID,
The following function works well in Windows Phone 8.1
Platform::Guid appId = Windows::ApplicationModel::Store::CurrentApp::AppId;
however, it spent around 40s in Windows Phone 10.
From MSDN, only the Metadata is different,
May I know is it caused by the metadata? And how to solve it?
To instead of using AppID, you might use the following code,
Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current;
Windows::ApplicationModel::PackageId^ packageId = package->Id;
Windows::ApplicationModel::PackageVersion version = packageId->Version;
Platform::String^ output =
"Name: \"" + packageId->Name + "\"\n" +
"Version: " + version.Major.ToString() + "."
+ version.Minor.ToString() + "."
+ version.Revision.ToString() + "."
+ version.Build.ToString() + "\n" +
"Architecture: " + packageId->Architecture.ToString() + "\n" +
"ResourceId: \"" + packageId->ResourceId + "\"\n" +
"Publisher: \"" + packageId->Publisher + "\"\n" +
"PublisherId: \"" + packageId->PublisherId + "\"\n" +
"FullName: \"" + packageId->FullName + "\"\n" +
"FamilyName: \"" + packageId->FamilyName + "\"\n" +
"IsFramework: " + package->IsFramework.ToString();
Sample output from device
Output:
Name: "f3e02737-ddfa-47a0-a837-37ee53459898"
Version: 1.0.0.0
Architecture: Arm
ResourceId: ""
Publisher: "CN=heefan"
PublisherId: "gsbawe9kfjm1p"
FullName: "f3e02737-ddfa-47a0-a837-37ee53459898_1.0.0.0_arm__gsbawe9kfjm1p"
FamilyName: "f3e02737-ddfa-47a0-a837-37ee53459898_gsbawe9kfjm1p"
IsFramework: false
I also have no idea why AppID take long time to compute.

Is there command line to deploy chrome extension for faster development?

http://developer.chrome.com/extensions/getstarted.html
In the docs,
it instructs we have to open the chrome:extesion page every time and load our own extension
is there any way to use command line such that i can do faster?
(mac OS or linux)
Thanks
Check out chrome.runtime.reload(). I haven't used it myself, but I suppose you could put a button somewhere convenient and trigger that method with it.
A team I am working with on a Chrome extension has figured out the following CHROME_RUN.py Python script:
cwd = sys.path[0]
CHROME_EXTENSION_DIR = cwd + "/Chrome-Extension"
TEMP_DIR = tempfile.mkdtemp()
TEMP_CHROME_PROFILE = TEMP_DIR + "/Chrome-Temp-Profile"
ccUrl = "PAGE_TO_OPEN.HTML"
if not os.path.exists(TEMP_DIR):
os.makedirs(TEMP_DIR)
FULL_CHROME_ARGS = "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"";
if _platform == "win32":
os.system("BUILD_CHROME_PROJECT.py")
os.system("start chrome " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
elif _platform == "darwin":
os.system("python BUILD_CHROME_PROJECT.py")
os.system("open /Applications/Google\ Chrome.app --args " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
elif _platform == "linux" or _platform == "linux2":
os.system("./BUILD_CHROME_PROJECT.py")
os.system("chromium " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
shutil.rmtree(TEMP_DIR)
which is compatible with OSX, Windows and Linux.
If you are looking for the actual arguments to provide Chrome, it is as follows:
FULL_CHROME_ARGS = "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"";
It will creates a temporary profile and launches Chrome with the provided URL. This version of Chrome is similar to how FireFox sandboxes an instance of the browser for plugin testing (fresh, clean instance of the browser with history, cache, etc. from your browsing history)
Go to the extension page, press ctrl+R, the original extension will be reloaded automatically and that doesn't need to do any import action any more.

AS3 Warning message excess bytes

When I publish my flash files, I get this message:
WARNING: excess bytes: -616, Tag: DefineFont3, Index: 5
WARNING: excess bytes: 2, Tag: DefineFont3, Index: 36
What are these warning? Anything related to these warning?
Yesterday is still fine, but today I get this.
Maybe one of your libraries are using the SWFTimeline. It's source code contains the very same warning.
The following code snippet is from the SWFTimeline.as file, starting at line 84.
// Adjust position (just in case the parser under- or overflows)
if(data.position != pos + tagHeader.tagLength) {
trace("WARNING: excess bytes: " +
(data.position - (pos + tagHeader.tagLength)) + ", " +
"Tag: " + tag.name + ", " +
"Index: " + (tags.length - 1)
);
data.position = pos + tagHeader.tagLength;
}
It seens to be caused by malformed tags or file corruptions, maybe other reasons too.