Q: Finding IP Address of Oracle Database Server A:
Execute this once you login with sqlplus or sqldeveloper

SELECT sys_context('userenv','server_host') FROM DUAL;


Q: What is the returned value of a subquery based on the count of result rows? A:
In scalar context the subquery will return:

NULL if 0 rows returned

The value returned if 1 row returned

An error if 2 or more rows returned.


Q: Wpf or Win Forms - tile editor A:
I'm asking because the editor application is supposed to be a fun side project but if one approach took too long compared to the other it's not time efficient. I didn't realise this sort of question would grind someone's gears, sorry. I wasn't expecting either to be easy to learn but if one was built for more complicated programs it's not as useful to me as the other.

Is this sort of question not welcome on this site?


Q: XREF table in a pdf file A:
0000 n 0000057522 00000 n 0000057771 00000 n 0000057791 00000 n 0000058080 00000 n 0000059511

00000 n 0000059533 00000 n 0000059918 00000 n 0000059939 00000 n 0000061370 00000 n 0000061392 00000 n 0000061777 00000 n

0000061798 00000 n 0000063229 00000 n 0000063251 00000 n 0000063636 00000 n 0000063657 00000 n 0000065088 00000 n 0000065110

00000 n 0000065495 00000 n 0000065516 00000 n 0000066947 00000 n 0000066969 00000 n 0000067354 00000 n 0000067375 00000 n

0000068806 00000 n 0000068828 00000 n 0000069213 00000 n 0000069234 00000 n 0000069287 00000 n 0000069333 00000 n 0000069386

00000 n 0000069439 00000 n 0000069492 00000 n 0000070575 00000 n 0000085235 00000 n 0000069664 00000 n 0000070554 00000 n

0000135271 00000 n 0000085258 00000 n 0000085507 00000 n 0000085527 00000 n 0000085816 00000 n 0000086065 00000 n 0000086085

00000 n 0000086374 00000 n 0000086623 00000 n 0000086643 00000 n 0000086932 00000 n 0000087181 00000 n 0000087201 00000 n

0000087490 00000 n 0000087739 00000 n 0000087759 00000 n 0000088048 00000 n 0000088297 00000 n 0000088317 00000 n 0000088606

00000 n 0000088855 00000 n 0000088875 00000 n 0000089164 00000 n 0000089413 00000 n 0000089433 00000 n 0000089722 00000 n

0000089971 00000 n 0000089991 00000 n 0000090280 00000 n 0000090529 00000 n 0000090549 00000 n 0000090838 00000 n 0000091087

00000 n 0000091107 00000 n 0000091396 00000 n 0000091645 00000 n 0000091665 00000 n 0000091954 00000 n 0000092203 00000 n

0000092223 00000 n 0000092512 00000 n 0000092761 00000 n 0000092781 00000 n 0000093070 00000 n 0000093319 00000 n 0000093339

00000 n 0000093628 00000 n 0000093877 00000 n 0000093897 00000 n 0000094186 00000 n 0000094435 00000 n 0000094455 00000 n

0000094744 00000 n 0000094993 00000 n 0000095013 00000 n 0000095302 00000 n 0000095551 00000 n 0000095571 00000 n 0000095860

00000 n 0000096109 00000 n 0000096129 00000 n 0000096418 00000 n 0000096667 00000 n 0000096687 00000 n 0000096976 00000 n

0000097225 00000 n 0000097245 00000 n 0000097534 00000 n 0000097783 00000 n 0000097803 00000 n 0000098092 00000 n 0000098341

00000 n 0000098361 00000 n 0000098650 00000 n 0000098899 00000 n 0000098919 00000 n 0000099208 00000 n 0000099457 00000 n

0000099477 00000 n 0000099766 00000 n 0000100015 00000 n 0000100035 00000 n 0000100324 00000 n 0000100573 00000 n 0000100593

00000 n 0000100882 00000 n 0000101131 00000 n 0000101151 00000 n 0000101440 00000 n 0000101689 00000 n 0000101709 00000 n

0000101998 00000 n 0000102247 00000 n 0000102267 00000 n 0000102556 00000 n 0000102805 00000 n 0000102825 00000 n 0000103114

00000 n 0000103363 00000 n 0000103383 00000 n 0000103672 00000 n 0000103921 00000 n 0000103941 00000 n 0000104230 00000 n

0000104479 00000 n 0000104499 00000 n 0000104788 00000 n 0000105037 00000 n 0000105057 00000 n 0000105346 00000 n 000010


Q: Is there a BASIC dialect which uses "==" as the comparison operator? A:
Isn't the reason for the double-equal in algol family to distinguish equality from assignment? What, then, would you have us do with the "LET" keyword? Abandon it? It was my favorite keyword! So permissive...

http://www.freebasic.net/

Open source, FTW!


Q: How to deal with NHibernate parent\child relationship with childs in ISet and generated IDs? A:
I have pretty much te same kind of base-class for my entities like you have.

The base class has overriden Equals / GetHashcode methods, etc...
In my implementation of the Equals method in the base class, I check whether the entity is transient (not yet persistent).  An entity is transient, when the Id that has been assigned to it, is still the default value.

When this is the case, I do not check the equality based on the Id.

If both entities that have to be compared, are transient, I use the ReferenceEquals method in order to determine equality.

In my implementation of GetHashCode, I do this:

I have a private member variable oldHashcode in my entity, which is of a nullable type.

when oldHashCode is not null, I return oldHashCode.

else, when the entity is transient, I call base.GetHashCode() and store the returned value in oldHashCode.  I return this value.

else, I generate the Hashcode based on the Id.  Id.GetHashCode()

private int? _oldHashCode;

    public override int GetHashCode()
    {
        if( _oldHashCode.HasValue )
        {
            return _oldHashCode.Value;
        }

        if( IsTransient )
        {
            _oldHashCode = base.GetHashCode ();

            return _oldHashCode.Value;
        }

        return Id.GetHashCode ();
    }

Using this kind of 'strategy', I've never ran into any weird issues 'till now...