Search Results

Search found 7 results on 1 pages for 'kosta'.

Page 1/1 | 1 

  • What's the best way to get up to speed with Java?

    - by Kosta
    I'm a software developer that just switched teams so I shall write code in Java now. Last time I wrote something in the language was in programming 101 at uni (I was already an amateur coder back then). So what is the best book/tutorial to get up to speed with Java? Where's the Java - the good parts? Learn you some Java for great good? Learn Java the hard way? Or is it too enterprisey for that kind of passion...?

    Read the article

  • Overriding equals method without breaking symmetry in a class that has a primary key

    - by Kosta
    Hi, the answer to this question is probably "not possible", but let me ask regardless :) Assuming we have a very simple JAVA class that has a primary key, for example: class Person { String ssid; String name; String address; ... } Now, I want to store people in a collection, meaning I will have to override the equals method. Not a completely trivial matter, but on a bare basis I will have something along the lines of: @Override public boolean equals (Object other) { if(other==this) return true; if(!other.getClass().equals(this.getClass()) return false; Person otherPerson = (Person)other; if(this.ssid.equals(otherPerson.getSsid()) return true; } Excuse any obvious blunders, just typing this out of my head. Now, let's say later on in the application I have a ssid I obtained through user input. If I want to compare my ssid to a Person, I would have to call something like: String mySsid = getFromSomewhere(); Person myPerson = getFromSomewhere(); if(myPerson.equals(new Person(mySsid)) doSomething(); This means I have to create a convenience constructor to create a Person based on ssid (if I don't already have one), and it's also quite verbose. It would be much nicer to simply call myPerson.equals(mySsid) but if I added a string comparison to my Person equals class, that would break the symmetry property, since the String hasn't got a clue on how to compare itself to a Person. So finally, the big question, is there any way to enable this sort of "shorthand" comparisons using the overriden equals method, and without breaking the symmetry rule? Thanks for any thoughts on this!

    Read the article

  • Programmatically create properties - Out of a database table

    - by Kosta
    I already googled around to find a solution for my need, with no success. Let's say I've a table that looks like this: ID |KeyId |Name |Description 1 |153 |Currency |XXXXXXXX 2 |68 |Signature |YYYYYYYY 3 |983 |Contact |ZZZZZZZZ . Now I want to access theses values not by a collection, because I cannot remember all the values, let's say for the name. So this is not what I want: Values.Where(v = v.Name == "Currency").Select(v = v.KeyId); The table content changes rarely but still it is not a nice solution having a struct with all "Names" and getting the KeyId like this. struct Values { public static int Currency { get { return GetKeyId("Currency"); } } } I'm looking for a solution that creates me automatically properties out of this table. So that I can access the KeyId with intellisense. As you have for Resources in ASP.NET. There the class is automatically updated as soon as you add a new entry in the RESX file. For example: Values.Currency , this gives me back the corresponding KeyId. Thanks for reply

    Read the article

  • openldap-servers-2.2.13-12.el4_8.2 RHEL 4 err=6

    - by coderwhiz
    I have been seeing these following error codes on our LDAP server: zgrep -o err=[0-9]* ldap.log.1.gz | sort | uniq -c 106664 err=0 146 err=16 288 err=4 29 err=49 8106 err=6 Can someone explain what err=6 is exactly and if its a big problem? I have been seeing lately some failures to authenticate and wonder if it is related to these errors? I have seen a possible timeout problem in the 2.2 Code base and not sure if theres a patch or if I would have to upgrade to the latest openldap version? thanks kosta

    Read the article

1