I created the AbstractContentFragment object following the instructions for tutorial #9. After copying in the code from the book I get the error "The method getWebView() is undefined for the type AbstractContentFragment"
I have checked the code - it is exactly what is in the book.
I have the actionbarsherlock library included in the project - no issues with Tutorial #8.
I can see the getWebview() method in the webviewfragment class.
Pointers?
I have checked the code - it is exactly what is in the book
Pretty much, by definition, it is not.
I can see the getWebview() method in the webviewfragment class.
Presumably, your AbstractContentFragment is not extending WebViewFragment. This is covered in Step #3 of Tutorial #9 (at least in Version 4.5 of the book -- different book editions may have slightly different editions of the tutorial).
Related
Ok folks this is a long one, so please bear with me. I'll preface this by stating that I am -for all intents and purposes- a noob.
I'm trying to link to a running instance of a program (ETABS) using IronPython. The program has an API and decent documentation on how one can go about hooking into the running instance (EXAMPLE). However, their examples are for Python, C#, VB.net but not IronPython.
No biggie I thought, the Marshal module can be used to hook into it. So I tried this:
from System.Runtime.InteropServices import Marshal
csiApp = Marshal.GetActiveObject("CSI.ETABS.API.ETABSObject")
SapModel=csiApp.SapModel
Unfortunately I get errors on that last line - "ETABSObject has no attribute SapModel".
And yes, I've tried running it with csiApp.SapModel() as well with the same results.
So I delved deeper into it and apparently the object needs to be cast into another type - at least that's the way its been done for the C# example (LINK). Since - to my knowledge - we can't really cast objects around in Python (and yes, I've already tried clr.Convert) I came to the conclusion that the object being returned to Ironpython is a few abstractions removed from the object that I really need. Apparently comtypes can handle this automatically in the background (seeing as the python example works flawlessly). The code block below shows the object types returned to Ironpython and to pure python respectively:
Ipy : <System.MarshalByRefObject object at 0x000000000000002B [CSI.ETABS.API.ETABSObject]>
Python with comtypes : <POINTER(cOAPI) ptr=0x2e68d17f7c8 at 2e690b36a48>
I'm working on Ironpython 2.7.3 and can't really update it (for several reasons not relevant to this post). Would love to have advice on how to fix this or on how to install comtypes on Ipy.
So I think I've found the reason why this is happening - Ironpython cannot directly use MarshalByRefObjects (source) since Reflection doesn't work on these. It seems I'll need to create a C# class which can cast this object into the one I want, compile it into a dll and load that into my Ipy code.
I'll leave this here in case someone with more knowledge has a better answer.
Context
As a university project we want to change the the pharo vm to use an object-table and see what happens.
We use a pharo-vm clone from github and VMMaker. Building the VM works fine.
To get started we added a primitive that returns an incremented Integer:
InterpreterPrimitives>>primitiveIntegerIncrement
"increments an integer"
self pushInteger: self popInteger + 1 .
and modified StackInterpreter class>>initializePrimitiveTable accordingly
MaxPrimitiveIndex := 576.
"... and so on ..."
(575 primitiveFail)
(576 primitiveIntegerIncrement))
And it works.
Problem
When we make changes to the VM we want to test-run already in the SmalltalkImage so we do not need to compile and see it did not work.
Something like:
StackInterpreter test: '1 inc'
And then I can debug if the primitive is wrong or an error occurs. Of course there needs to be done much more but how can I achieve this?
What we tried
category VMMaker-InterpreterSimulation class StackInterpreterSimulator. Trying the code in the comments
DoIt
^ (StackInterpreterSimulator new openOn: Smalltalk imageName) test
errors:
displayForm := 'Display has not yet been installed' asDisplayText form.
the ByteString does not understand asDisplayText
(CogVMSimulator new openOn: Smalltalk imageName) test
(InterpreterSimulator new openOn: Smalltalk imageName) test
error:
PrimitiveFailed: primitive #basicNew: in Array class failed
I also found this screen cast but it only debugs the VM from outside using gbd: http://vimeo.com/22485382#
Our project is hosted here: http://smalltalkhub.com/#!/~kirstin/PharoObjectTable
Current Status
We started implementing an object table. The lookup of attributes can go throught the object table. Full object table support and no usage of direct pointes is very tricky since pointers are expected everywhere. So we use pointers into the object table to identify when a lookup should go through the OT. We also found all object creation primitives and add new objects to the table.
How long is your project and how many people are you ? To me what you try to do is quite some work. Do you have good knowledge about low level behavior ?
To answer your question, the main problem here is that the cog simulator is not maintained in the pharo vm fork. This is because no one in the pharo crew use the simulator. We only use external debugging from gdb. In fact the pharo folks work mostly on VM plugins, the core of the VM is mainly maintained and developed by Eliot Miranda which works on Squeak. Therefore we report to him when there's a bug in the VM core.
For your project you would have to split it in at least 2 steps:
step 1: make the object table work with the stack VM
step 2: make the JIT work with your object table
Note that for step 2 I would recommend not to change the way an object access its header, therefore having a VW-like object table where you have the fixed size header on the one in the the object table, and the fields of the objects (and maybe header extensions) in the heap.
So use the StackVMSimulator and build the StackVM first. When everything will work (including context), you can think about hacking the JIT. Recently Guillermo Polito ported the Stack VM to the build process (see PharoSVMBuilder instead of PharoVMBuilder), a guy reported problems with this builder but you could hack it a bit to make it work.
Now to make the simulator work on Pharo 2.0 (which is the Pharo version of the generator image you have), you have to open the monticello browser and merge from Eliot's branch the Cog package (repo MCHttpRepository location: 'http: //source. squeak. org/VMMaker'), but not the latest Cog, the one at around the same date as the current VMMaker package of pharo-vm because the latest Cog and VMMaker of Eliot's branch are not stable.
The alternative being to start from Eliot's build image and merge things from the pharo branch. Here are infos about how to build the squeak development image (http://www.mirandabanda.org/cogblog/build-image/).
Then Eliot gave me this script once:
| cos |
cos := CogVMSimulator newWithOptions: #(Cogit SistaStackToRegisterMappingCogit).
cos desiredNumStackPages: 8.
cos openOn: 'my/favourite.image'.
cos openAsMorph; toggleTranscript; halt; run
You don't need the SistaStackToRegisterMappingCogit option. I guess some similar script with the StackVMSimulator should work.
Lastly there are some documentation about the simulator but it is only for the CogSimulator (these documentations expects you already knows how the StackSimulator works, and just give you hints about how to use it with the JIT):
http://www.mirandabanda.org/cogblog/2008/12/12/simulate-out-of-the-bochs/
and in one of the video named "Cog VM (part x)", x being from 1 to 6, Eliot shows how he uses the simulator to disassemble x86, print the stack and inspect the heap.
Another tip, ask your questions on the pharo mailing list (pharo users or pharo dev), because here no one may notice your question (fortunately someone pointed me out your question this time).
And tell on the pharo mailing list if you managed to run the simulator in Pharo 2.0, some people (as me) are very interested in it. I was planning to do it at some point.
Good luck ! Nice project anyway.
The last time I tried to use the simulator is roughly a year ago, and I did not make it work.
However, there are a few patches, which I assume never got integrated that might be of help:
https://code.google.com/p/cog/issues/detail?id=106
https://code.google.com/p/cog/issues/detail?id=107
https://code.google.com/p/cog/issues/detail?id=108
Issue 107 includes a patch for your asDisplayText issue.
Newbee question - I am trying to learn Aida from the 6.0 version for Dolphin Smalltalk using the tutorial for Pharao (I think). I know Smalltalk quite well but I am new to Web.
From AIDA tutorial:
**3. Registering a root domain object
After our ADemoAddressBook is prepared, we register its URL in Aida, so that it is accessible from web. In our workspace we evaluate:
AIDASite default register: book onUrl: '/addressbook'
But I get : register:onUrl: not understood, and I cannot find the method in the AIDASite class or in the image??
Really strange - what is the correct method to use ?
OBS OBS
Wow - I found it. Inspired by the french tutorial on the Wiki http://community.ofset.org/index.php/Aida_Tutorial.
The following works:
AIDASite default urlResolver defaultURL: '/addressbook' forObject: book
I don't know on Dolphin but on Pharo3.0, the code:
AIDASite default register: book onUrl: '/addressbook'
works fine.
Anyway this question is still marked as non answered whereas the author edit it with a solution and Janko said it's an issue of Aida's versions. So this answer is just to "close" this question.
I am trying to run my own multi-gpu example, and I am following the NVIDIA's example. However, I cannot find where CUTThread is defined and then the compiler says:
error: ‘CUTThread’ was not declared in this scope
The short answer is 'dont use cutThread at all'. It comes from the SDK, not the toolkit, and it not intended for general use - NVIDIA don't document any of these function, nor do they guarantee that they either work, or won't change in definition or function from release to release. If you are interested in multiGPU computing, have a look at this answer to a very recent Stackoverflow question.
I'm using Emgu.CV which is a C# wrapper for the OpenCV libraries.
I changed the Emgu.CV source to invoke from the latest OpenCV library cv110.dll instead of cv100.dll and now I get this error (where ????? is cv110.dll). I have placed the cv110.dll file in all the same locations as the cv100.dll file however this does not help.
On a broader scale, what is the folder search order when looking for dlls, and are there anyone other reasons for this error.
It seems there is a subtle difference between those two assemblies. Without code its hard to tell, but I suggest you to take a look to this blog, specially this post: http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx and http://blogs.msdn.com/suzcook/archive/2003/08/11/57236.aspx
Suzanne Cooks worked in the fusion/CLR loader, and her blogs has tons of tips and advices for this kind of issues.
Good Luck!
You need VCRT(Visual C run time) 8.0 SP1, available from the following link:
http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en
See this post on Emgu CV discussion forum for more information:
http://www.emgu.com/forum/viewtopic.php?f=7&t=88