This is my first question on stackoverflow.
I searched over the web to no avail, and I really can't figure out what's wrong, so here we go.
I am trying to add a dialog window to Marionnet. The window information is mostly contained in the glade file, with some bits modified from code. lablgtk is the framework that allows gtk2 (and thus glade-generated files) to be used with the ocaml language.
The application is successfully compiled, however it generates this runtime error at launch:
(marionnet.byte:5384): libglade-CRITICAL **: glade_xml_build_interface: assertion `wid != NULL' failed
Fatal error: exception Failure("Glade error: GtkDialog:dialog_RELATIVIZATION is not accessible.")
Raised at file "pervasives.ml", line 22, characters 22-33
Called from file "gui.ml", line 617, characters 9-85
Called from file "gui/gui_menubar_MARIONNET.ml", line 356, characters 17-49
Called from unknown location
Called from unknown location
The error suggests that the class constructor doesn't exist or something like that, but I checked multiple times and I didn't spot any typo in the identifiers I used. What am I missing here? What does the exception actually mean?
To prove that there are no typos or missing identifiers, I'll show you the file contents.
The file gui.ml is generated by lablgladecc2, which reads the contents of gui.xml (the glade file). This is an extract from gui.xml:
<widget class="GtkDialog" id="dialog_RELATIVIZATION">
<property name="visible">True</property>
<property name="title" translatable="yes">Relativization</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="icon">marionnet-launcher.png</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
[...]
So the id "dialog_RELATIVIZATION" is there. Indeed, the generated gui.ml file has the correct class and method:
[...]
class dialog_RELATIVIZATION ?(file="gui.glade.patched") ?domain ?autoconnect(*=true*) () =
let xmldata = Glade.create ~file ~root:"dialog_RELATIVIZATION" ?domain () in
object (self)
inherit Glade.xml ?autoconnect xmldata
val toplevel =
new GWindow.dialog_any (GtkWindow.Dialog.cast
(Glade.get_widget_msg ~name:"dialog_RELATIVIZATION" ~info:"GtkDialog" xmldata))
method toplevel = toplevel
val dialog_RELATIVIZATION =
new GWindow.dialog_any (GtkWindow.Dialog.cast
(Glade.get_widget_msg ~name:"dialog_RELATIVIZATION" ~info:"GtkDialog" xmldata))
method dialog_RELATIVIZATION = dialog_RELATIVIZATION
[...]
This is the code where I try to access the window:
let rel_dialog = new Gui.dialog_RELATIVIZATION () in
rel_dialog#toplevel#set_title (s_ "Relativization");
rel_dialog#label_frequency#set_label (s_ "Frequency");
rel_dialog#label_convergence#set_label (s_ "Convergence");
rel_dialog#checkb_existing_machines#set_label (s_ "Apply to existing machines");
Google didn't help me, and I did not find good documentation about lablgtk. Does anyone know what the exception means and what the cause could be?
Related
Have a spring integration application where files are routed from a folder to S3 buckets using s3-outbound-channel-adapter. If the file processed successfully, then file will be moved to corresponding target-bucket. if any error , file move to error bucket via error channel.
Have to generate a daily statistics report in a text file containing below details.
Total no of files processed:
Total success :
Total Error:
Would like to know how to get no of files processed successfully/error. Is there any way to achieve this requirement.
Any suggestion or example would be helpful.
Gone through the DefaultMessageChannelMetrics and Micrometer Integration in documentation. Not sure it will help my requirement.
Have separate gateway and adapter to process success and error files.
Success :
<int-aws:s3-outbound-gateway id="s3FileMover"
request-channel="filesOutS3GateWay"
reply-channel="filesOutS3ChainChannel"
transfer-manager="transferManager"
bucket-expression = "headers.TARGET_PATH"
key-expression="headers.file_name"
command="UPLOAD">
<int-aws:request-handler-advice-chain>
<ref bean="retryAdvice" />
</int-aws:request-handler-advice-chain>
</int-aws:s3-outbound-gateway>
Error :
<int-aws:s3-outbound-channel-adapter id="filesErrorS3Mover"
channel="filesErrorS3MoverChannel"
transfer-manager="transferManager"
bucket="${aws.s3.error.bucket}"
key-expression="headers.TARGET + '/' + headers.file_name"
upload-metadata-provider = "fileMetaDataProvider"
command="UPLOAD">
<int-aws:request-handler-advice-chain>
<bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice">
<property name="onSuccessExpressionString" value="payload.delete()"/>
</bean>
</int-aws:request-handler-advice-chain>
You can query and reset the MessageChannelMetrics directly on the message channels directly.
getSendCount();
reset();
All standard message channels implement that interface so just inject the channel as that...
#Autowired
private MessageChannelMetrics filesOutS3GateWay;
private int getCount() {
return this.filesOutS3GateWay.getSendCount();
}
I am just trying to plant AJAX Chat for my website users. I have successfully completed the installation process with database configuration. But when I am trying to brows the domain.com/ajaxchat/index.php its returning this error given below:
XML Parsing Error: junk after document element Location: http://futurenext.esy.es/inc/chat/ Line Number 2, Column 1:
I think that the problem is in AJAXChatTemplate.php , and here the code is:
function getContent() {
if(!$this->_content) {
$this->_content = AJAXChatFileSystem::getFileContents($this->_templateFile);
}
return $this->_content;
And the error message is like:
" Non-static method AJAXChatFileSystem::getFileContents() should not be called statically, assuming $this from incompatible context in line 37"
Now please any one can help me to fix the problem. What is the problem here I can't really understand. Thanks.
In my app I want to save some information for the user somewhere. I picked the Application Support Directory, which I am trying to get like so:
let savePath = NSSearchPathForDirectoriesInDomains(ApplicationSupportDirectory, UserDomainMask, true)
Im getting a compile error in XCode saying "Use of unresolved identifier", even though the function is requesting a NSSearchPathDirectory type, which according to Apple's documentation clearly exists:
enum NSSearchPathDirectory : UInt {
case ApplicationDirectory
...
case ApplicationSupportDirectory
...
}
The same problem occurs with 'UserDomainMask'
Is this a bug or am I missing something? (Also, I would prefer not to use a workaround like substituting an integer literal...)
The correct statement is:
let savePath = NSSearchPathForDirectoriesInDomains(.ApplicationSupportDirectory, .UserDomainMask, true)
println("savePath: \(savePath)")
output:
savePath: [/Users/zaph/Library/Developer/CoreSimulator/Devices/24F94BD2-9DD7-4BC6-AA66-128AC1E7555F/data/Containers/Data/Application/9FFA8987-A36B-4A4D-A607-1BC220ADBBF2/Library/Application Support]
A leading "." is needed for the enumeration values.
I can't call a java wrapping service in Acceleo because it doesn't recognize parameters type. This is my simple test code: the main calls a query stored in Services.mtl, that calls the java service that just return the name of an object "Send"
Main.mtl
[file ('system.P', false, 'UTF-8')]
[for (t : Send | aSystemBehavior.transitions)) ]
[getName(t)/]
[/for]
[/file]
Services.mtl
[query public getName(arg0 : Send) : String
= invoke('myPackage.Services', 'getName(myPackage.Send)', Sequence{arg0})
/]
Services.java
public class Services
{
public String getName(Send t)
{return t.getName();}
}
The Error Log shows:
Invalid result for expression
self.invoke('myPakage.Services',
'getName(myPakage.Send)', Sequence {arg0}) at line 0 in
Module services for query getName(Send). Last recorded value of self
was org.eclipse.emf.ecore.impl.DynamicEObjectImpl#1f00eb36 (eClass:
org.eclipse.emf.ecore.impl.EClassImpl#2c2aade3 (name: Send)
(instanceClassName: null) (abstract: false, interface: false)).
Problem found while generating the file system.P'.
If I use a String as parameter type instead of Send, everything works fine.
Does the package containing the service "Services" has been exported? If not, open the file MANIFEST.MF, go in the runtime tab and add its package to the list of exported packages. Are you sure that your "Send" object has a name? This message only indicates that null was returned by the query getName.
I don't have anymore this problem... I created a new Acceleo project from scratch, and it works. I am not sure what was the problem... maybe it's something about che choice of metamodels to import during the creation of the Module (I have to choose between run-tim and develop-time metamodel).
I am trying to call cudppSort to sort a set of keys/values. I'm using the following code to set up the sort algorithm:
CUDPPConfiguration config;
config.op = CUDPP_ADD;
config.datatype = CUDPP_UINT;
config.algorithm = CUDPP_SORT_RADIX;
config.options = CUDPP_OPTION_KEY_VALUE_PAIRS | CUDPP_OPTION_FORWARD | CUDPP_OPTION_EXCLUSIVE;
CUDPPHandle planHandle;
CUDPPResult result = cudppPlan(&planHandle, config, number_points, 1, 0);
if (CUDPP_SUCCESS != result) {
printf("ERROR creating CUDPPPlan\n");
exit(-1);
}
The program exits, however on the line:
CUDPPResult result = cudppPlan(&planHandle, config, number_points, 1, 0);
and prints to stdout:
Cuda error: allocScanStorage in file 'c:/the/path/to/release1.1/cudpp/src/app/scan_app.cu' in line 279 : invalid configuration argument.
I looked at the line in scan_app.cu. It is,
CUT_CHECK_ERROR("allocScanStorage");
So apparently my configuration has an error that is causing the allocScanStorage to bomb out. There are only two calls to CUDA_SAFE_CALL in the function and I don't see a reason why either has anything to do with the configuration.
What is wrong with my configuration?
So that this doesn't sit around as an unanswered question (I'm not sure if this is the right SO etiquette but it seems like an answered question shouldn't sit around unanswered...), I'm copying the comment I made above here as an answer since it was the solution:
I figured this out (I'm still learning CUDA at the moment.) Because the error checking is asynchronous errors can show up in strange places if you don't check for them from time to time. My code had caused an error before I called cudppPlan but because I didn't check for errors the cudppPlan reported the error as if it was in cudppPlan.