Questions tagged [self-reference]

Self-reference is the ability of a program (or logical sentence) to refer to itself, either directly or indirectly.

Self-reference is the ability of a program (or logical sentence) to refer to itself, either directly or indirectly.

Useful Links:

Stanford Encyclopedia 'Self Reference' Entry

Related Tags:

596 questions
4
votes
1 answer

On DELETE CASCADE fails in self referencing MySQL table having depth more than 15 levels

I have a MySQL table with self referencing foreign keys. ON DELETE CASCADE works absolutely fine in it but I noticed a weird behavior that it is working only up to 14 levels for a parent entity. As soon as I add an 15th level child and try to delete…
prem
  • 3,348
  • 1
  • 25
  • 57
4
votes
1 answer

C: Run machine code from memory

I want to execute some code from memory; my longterm goal is to create a self-decrypting app. To understand the matter I started from the roots. I created the following code: #define UNENCRYPTED true #define sizeof_function(x) ( (unsigned long)…
K. Biermann
  • 1,295
  • 10
  • 22
4
votes
2 answers

C Struct-Function Pointer-Passing Self Reference As Argument

I would like to run the function pointed by my struct with auto-filling functionality. This is the part that I'm working on: #include #include struct Fra { //Fraction int n; //Numerator int d; //Denominator void…
user3163916
  • 318
  • 4
  • 16
4
votes
2 answers

How to get a function/macro definition from CL REPL?

I've got another question involving self-reference in Common Lisp. I found a thread on Stack Exchange which poses a problem of writing the shortest program that would print all printable ASCII characters NOT present in the program's source code.…
Wojciech Gac
  • 1,538
  • 1
  • 16
  • 30
4
votes
1 answer

module importing itself

I'm trying to import a module from an application-specific terminal (Maya in this case, but eventually others). I've downloaded a project off git, and I have a structure like so: modulename submodule __init.py__ subsubmodule …
D W
  • 45
  • 1
  • 1
  • 4
4
votes
2 answers

Java serialization order and self-references

Here's a simplified class: class Foo implements Serializable { private static final long serialVersionUID = 1L; private Integer id; private Set children; public Foo( Integer id ) { if( id == null ) { throw…
Dave
  • 44,275
  • 12
  • 65
  • 105
4
votes
1 answer

EntityFramework Code First self-referencing one to one (1:1) relationship mapping - Unable to determine the principal end

I have this class: public class Message { public long Id { get; set; } public string Subject { get; set; } public string Message { get; set; } public virtual Message ParentMessage { get; set; } public virtual Message…
Serj Sagan
  • 28,927
  • 17
  • 154
  • 183
4
votes
1 answer

Entity Framework: How to specify the name of Foreign Key column on a self-referencing Parent-Child relationship?

I am trying to specify a column name to map a "Foreign Key" to using the Fluent API. I am connecting to an instance of SQL Express. I have searched Stack Overflow and Google, but many of the different configuration examples gave me the same…
4
votes
3 answers

Hibernate3: Self-Referencing Objects

Need some help on understanding how to do this; I'm going to be running recursive 'find' on a file system and I want to keep the information in a single DB table - with a self-referencing hierarchial structure: This is my DB Table structure I want…
monojohnny
  • 5,894
  • 16
  • 59
  • 83
4
votes
1 answer

Self reference within an object method

Just started crash coursing in Matlab OO programing and I would like to write a set method for a object that will set the value then reciprocate by setting itself in the relevant field on the other object. classdef Person properties age; sex; …
csleys
  • 45
  • 6
4
votes
3 answers

Removing children from entity with self-referencing One-to-Many association

I have a self-referencing One-to-Many association on an entity (User) mapped by 'parent' and inversed by 'children'. I want to be able to remove users that are not parents. My entity is declared as follows. class User implements UserInterface { …
Gopi Kalyan
  • 129
  • 2
  • 13
4
votes
0 answers

How to build a self referencing table with composite key in fluent api and EF

I'm building a hierarchical Database with "closure table" to build the tree It is a self referencing table, and the two keys should become the primary key. The Problem is, I end up with 5 columns, when I expect only 3. Here is what I tried: …
4
votes
3 answers

Database design parent child table vs multiple tables

I am trying to create a parent child relationship for country-state-city-head. I considering two approaches- 1) Create a single table- pk| name | type | parent 1 | US | country | …
blue01
  • 2,035
  • 2
  • 23
  • 38
3
votes
1 answer

A bad interaction between self-referential types and bounded wildcards

This case seems to be another one where Eclipse's Java compiler crushes javac. The only question for me is whether it's a bug in JLS or javac. interface EndoFunctor< C, FC extends EndoFunctor< C, FC > > { /*...*/ } interface Algebra< C, FC extends…
Judge Mental
  • 5,209
  • 17
  • 22
3
votes
1 answer

JPA: one-to-one + self referential + bidirectional

I have an entity called 'Instructions'. Sometimes each Instructions has to keep track Instructions before and after it. For Example I have new instruction B which is continuing from existing instruction A, Instruction B has to aware that Instruction…
blukit
  • 113
  • 2
  • 5
  • 12