instance

Closure axiom for instances so that reasoner can correctly classify instances in ontology

懵懂的女人 提交于 2019-12-11 02:39:38
问题 I am a geographer and a new comer in the field of ontology trying to make sense out of these two. Therefore, I have created a simple ontology, as follows: Thing Feature Lane Segment(equivalent to Arc) Geometry Arc (equivalent to Segment) Node Dangling_Node Intersection_node you can find the .owl file here instantiated with a very simple spatial road dataset (fig1). the ontology is consistent without and with instances, but when I run the reasoner, the Dangling_node instances (nodes that are

C++ ecosystem simulator (inheritance)

佐手、 提交于 2019-12-11 02:36:17
问题 I am a beginner developing an ecosystem in C++. It works like this: I have PLANTS (not shown here) and ANIMALS on my grid. If something is an ANIMAL , it is either a CARNIVORE or an HERBIVORE . I created this hierarchy: class ANIMAL { private: int a_CUR_food_lvl; const int a_MAX_food_lvl; const int a_hunger_rate; public: ANIMAL(int curr, int max, int rate) : a_CUR_food_lvl(curr), a_MAX_food_lvl(max), a_hunger_rate(rate) {} virtual ~ANIMAL() { delete this; } virtual void Move() = 0; virtual

After tap on app icon,launcher create a new instance of root activity again & again.

房东的猫 提交于 2019-12-11 01:59:10
问题 After tap on app icon,launcher create a new instance of root activity & onCreate() of root activity is called when root activity already present in background i.e onPause(). It creating a new instance of root activity again & again instead of onResume() root activity. I know This is due to the intents being used to start the app being different. Eclipse starts an app using an intent with no action and no category. The Launcher starts an app using an intent with android.intent.action.MAIN

Android app widget: content added twice

微笑、不失礼 提交于 2019-12-11 00:48:08
问题 I am writing an app widget which I intend to populate with a list of items. I'm trying to do it the easy way by extending AppWidgetProvider . I am seeing some strange behaviour where the list of items gets added to the parent widget twice. Here's the code: @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.i("MyApp", "onUpdate called"); DbAdapter dbAdapter = new DbAdapter(context); dbAdapter.open(); final String[] columns = {

Changing Machine Type on Google Cloud

寵の児 提交于 2019-12-11 00:47:37
问题 I am looking to upgrade the machine type on my Google Cloud. The handful of solutions I've found all mentioned the follow: 1) Delete old instance while preserving disk. 2) Create new instance using the disk from the old instance. None of the solutions provide any details though. How do you accomplish the 2 steps above in detail? I created a test instance (Bitnami LAMP stack), then tried deleting it, but it didn't give me any option to "preserve disk" when deleting, or "select another disk"

Android Honeycomb, get instance of Fragments?

余生颓废 提交于 2019-12-10 23:44:02
问题 I have a PreferenceActivity that loads two Fragments via the xml file for the headers. I don't seem to be able to set a tag or an ID. or a tag for the fragments in the header xml (that is loaded using loadHeaderFromResource(); Since I don't instantiate it myself I have no ID. or reference to get hold of it. What do I do? 回答1: I don't think preference fragments loaded via XML are given a tag, and AFAIK they don't have a known ID, so the only way to do this may be to (1) maintain a separate

How to refer to an instance of a class using a string?

我怕爱的太早我们不能终老 提交于 2019-12-10 23:39:00
问题 I'm a bit inexperienced with python, and I've been searching and searching but can't find a useful answer to this. I have instances of a class named tool1, tool2, etc. How do I take a string that is defined by user input and use it to set a variable (current_tool) equal to one of the instances of the class? For example: tool1 = ... tool2 = ... current_tool = 0 my_string = 'tool1' How do I set current_tool equal to my_string so that current_tool = tool1 ? I'm essentially looking for how to

I am getting duplicate nodes on my family tree

妖精的绣舞 提交于 2019-12-10 22:14:30
问题 My function is duplicating some nodes on the tree. When I am calling that function in a recursive way. I have a database table of all father, mother, wife, husband, child ids. I am taking all persons from their father id only. I don't know from where these extra nodes are coming and how should I handle ie it. Output image <?php function categoryTree($parent_id = 0,&$alreadyThereArr=array()) { $ci =& get_instance(); //$query = $ci->db->query("SELECT * FROM tbl_user WHERE father_id = $parent_id

How do I create many precise instances of a class (to access their attributes) through a while/for loop?

隐身守侯 提交于 2019-12-10 21:46:11
问题 I'm trying to make an atari breakout style game using pygame, and I want the breakable blocks to be objects with certain attributes that I can change as the game progresses. As such I created a "Block" class and a subsequent function that loops through this class several times assigning the instances to a list. The problem that I encountered is that I didn't have a distinct "name" for each object so that made it sort of tough to access their individual attributes. Here is an example: class

How to create local database Instance using SMO

余生颓废 提交于 2019-12-10 21:27:56
问题 I have installed localdatabase and created a shared instance, and using smo I am able to create localdatabase. For my requirement I have to create a localdb shared instance. I am creating local database using SMO like this. ServerConnection serConn = new ServerConnection(@"(localdb)\.\sharedIns"); Server ldbServer = new Server(serConn); Database db = new Database(ldbServer , "databaseName"); db.Create(); Before creating database, I am creating shared instance through command prompt using