EXEC_BAD_INSTRUCTION on calling Appcelerator Module - appcelerator-mobile

I am working with Appcelerator module. On Device I get EXEC_BAD_INSTRUCTION error while I call the module.

I found out that I was using version 1.0, instead of 0.1, so, error was there. ;)

Related

Exception in TOpenDialog when closing program

When I use TOpenDialog, after closing the program, there is an exception in the Vcl.Forms module.
Program I'm using:
std::auto_ptr<TOpenDialog> OpenDialog (new TOpenDialog(this));
if ( OpenDialog->Execute() ){}
Exception: 'access violation at 0x008133a4: read of address 0x000000c4'
Highlighted is line: if not FHandleCreated then
function TApplication.GetDialogHandle: HWND;
begin
if not FHandleCreated then
Result := SendMessage(Handle, CM_DIALOGHANDLE, 1, 0)
else
Result := FDialogHandle;
end;
I confirm this issue. I have project that uses TOpenDialog component.
There was no problem with RAD C++ Builder 10.2 (Tokyo).
But now I get same error after upgrading to RAD C++ Builder 10.4 Update 2 (Sydney).
I don't use dynamic creation TOpenDialog with auto_ptr.
Instead, I just dragged component on my form. So code is very simple:
if(!OpenDialog1->Execute())
return;
It's enough to open this dialog, do nothing, press cancel and then close app.
After that I got the same access violation like Jacek had.
So problem is in C++ Builder 10.4
UPDATE:
The problem is not in C++ Builder 10.4 itself.
The error raises when application uses Custom Styles (Themes).
I just disabled Custom Styles in my app and there is no error with OpenDialog.
One possible workaround is to disable styling for common dialogs:
TStyleManager::SystemHooks = TStyleManager::SystemHooks >> TStyleManager::TSystemHook::shDialogs;
Another possible workaround is to set the option ofOldStyleDialog.
The dialog looks old-style but has colors compatible with Widows Themes.
OpenDialog1->Options << ofOldStyleDialog;

Using Motion in CosmicMind's Material

When i try to use CosmicMind's motion animation framework, I receive an error whenever I try an example. For example, taken straight from the Sample's repo:
dateLabel.animate(.delay(1),
.duration(0.5),
.background(color: Color.cyan.base),
.completion({ [weak self] in
self?.dateLabel.animate(.delay(1),
.duration(0.5),
.background(color: Color.deepPurple.base))
}))
throws the error 'Extra argument in call'
I can't animate anything because I always receive this error. What can i do to fix it?
Thanks!
I had tested the animation with Material 2.8.1 and all worked correctly. Please make sure you are using the latest Material version. All the best!

Disable or Catch VTK warnings in vtkOutputWindow when embedding Mayavi

I'd like to either disable the VTK warning window or, better yet, catch them to handle with my application's logging system. My application is using an embedded mayavi view, and I don't want error windows popping up that I have no control over. The following code demonstrates the warning window.
import numpy as np
from mayavi import mlab
x1 = np.array([1, 1, 2, 3])
y1 = np.array([1, 1, 4, 2])
z1 = np.array([1, 1, 5, 1])
mlab.plot3d(x1, y1, z1)
mlab.show()
Ok, I've done some research and discovered that vtk.vtkObject.GlobalWarningDisplayOff() will disable the window completely, which is nice. Better yet the followingcode will log the warnings to a file (found it here):
def redirect_vtk_messages ():
""" Can be used to redirect VTK related error messages to a
file."""
import tempfile
tempfile.template = 'vtk-err'
f = tempfile.mktemp('.log')
log = vtkpython.vtkFileOutputWindow()
log.SetFlush(1)
log.SetFileName(f)
log.SetInstance(log)
So while this is nice, I'm still unable to pipe the warnings directly into a logging handler. I'd rather not have to have a vtk_log file next to my regular log files. Also I might want to handle the warnings in my GUI somehow, or give the user options on how to handle them and constantly watching a log file for changes seems like a poor way to do that.
Any suggestions on a robust pythonic way to handle vtk warnings in an application which embeds mayavi/vtk?
I don't know whether this will work in the Mayavi environment, but this works for Python wrappings to VTK
# pipe vtk output errors to file
errOut = vtk.vtkFileOutputWindow()
errOut.SetFileName("VTK Error Out.txt")
vtkStdErrOut = vtk.vtkOutputWindow()
vtkStdErrOut.SetInstance(errOut)
I guess this partially answer your question, but you could implement an error observer in python as explained here http://public.kitware.com/pipermail/vtkusers/2012-June/074703.html and add it to the vtk class you are interested.
In c++ I find much simpler to redirect the output to stderr (this example is for windows):
vtkSmartPointer<vtkWin32OutputWindow> myOutputWindow = vtkSmartPointer<vtkWin32OutputWindow>::New();
myOutputWindow->SetSendToStdErr(true);
vtkOutputWindow::SetInstance(myOutputWindow);
In python I tried
ow = vtk.vtkOutputWindow()
ow.SendToStdErrOn()
it sends the error to console, but I still see the vtk window and it doesn't really seem catching the errors.
Another option could be to recompile vtk with VTK_USE_DISPLAY turned off ( http://osdir.com/ml/python-enthought-devel/2009-11/msg00164.html). I am not going to try this because I am using the vtk distribution already compiled in paraview
You can create a subclass deriving from vtkOutputWindow and implement your message handling in the method void DisplayText(const char* someText). I did this is in a C++ project to redirect all output to cerr and even suppress specific warnings.
An approach I found similar to #SciCompLover's answer that suppresses the output window while also printing to the console:
import vtk
vtk_out = vtk.vtkOutputWindow()
vtk_out.SetInstance(vtk_out)
Tested on Mayavi 4.7.1 with VTK 8.2.0 on Windows and MacOS.

printing mathematical signs not enabled

I get an error when I try to call the init_printing function from scipy
init_printing(use_latex=True)
TypeError: init_printing() got an unexpected keyword argument 'use_latex'
How do I correctly enable latex?
help(init_printing)
Help on function init_printing in module sympy.interactive.printing:
init_printing(pretty_print=True, order=None, use_unicode=None, wrap_line=None, no_global=False, ip=None)
Initializes pretty-printer depending on the environment.
You probably aren't using a new enough version of SymPy. Make sure you are using 0.7.4.1, the latest.

module handle through base address

Im' trying to get the module handle of a module in C++ on windows.
My problem is that I have only the base address and File handle of the module but GetModuleHandle receives only its name as a parameter.
Is there a way in c++ on windows to obtain a module handle without knwoing the module's name?
Have you tried using GetModuleHandleEx (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)lpBaseAddress, &module)?
Use GetModuleHandleEx if you use WindowsXP or later. For previous Windows versions like Windows2000 this function is not available, but there is alternate solution, check comments at the bottom of this page: http://msdn.microsoft.com/en-us/library/ms683200(v=VS.85).aspx