• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:10
CEST 23:10
KST 06:10
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL21] Finals Preview: Two Legacies18Code S Season 2 (2026) - RO12 Preview2herO wins GSL Code S Season 1 (2026)5Code S Season 1 (2026) - RO4 & Finals Preview5[ASL21] Ro4 Preview: On Course12
Community News
Weekly Cups (May 11-17): Classic wins double0Code S Season 1 (2026) - RO8 Results2Weekly Cups (May 4-10): Clem, MaxPax, herO win1Maestros of The Game 2 announcement and schedule !18Weekly Cups (April 27-May 4): Clem takes triple0
StarCraft 2
General
herO wins GSL Code S Season 1 (2026) Code S Season 2 (2026) - RO12 Preview Weekly Cups (May 11-17): Classic wins double Code S Season 1 (2026) - RO4 & Finals Preview Team Liquid Map Contest #22 - The Finalists
Tourneys
Crank Gathers Season 4: BW vs SC2 Team League GSL Code S Season 2 (2026) GSL Code S Season 1 (2026) Sparkling Tuna Cup - Weekly Open Tournament Maestros of The Game 2 announcement and schedule !
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 527 Hell Train The PondCast: SC2 News & Results Mutation # 526 Rubber and Glue Mutation # 525 Wheel of Misfortune
Brood War
General
25 Years Since Brood War Patch 1.08 (Spoiler) ASL21 Winner's Interview vespene.gg — BW replays in browser [ASL21] Finals Preview: Two Legacies UA StarCraft: Mawin (T) vs hanniGan (P) Showmatch
Tourneys
[ASL21] Grand Finals Escore Tournament StarCraft Season 2 [Megathread] Daily Proleagues Small VOD Thread 2.0
Strategy
Any training maps people recommend? Muta micro map competition [G] Hydra ZvZ: An Introduction Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Dawn of War IV ZeroSpace Megathread Warcraft III: The Frozen Throne
Dota 2
The Story of Wings Gaming
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
Russo-Ukrainian War Thread Trading/Investing Thread US Politics Mega-thread European Politico-economics QA Mega-thread YouTube Thread
Fan Clubs
The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software)
TL Community
The Automated Ban List
Blogs
Esports Organizations: Raisi…
TrAiDoS
Why RTS gamers make better f…
gosubay
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1309 users

The Big Programming Thread - Page 761

Forum Index > General Forum
Post a Reply
Prev 1 759 760 761 762 763 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
teamamerica
Profile Blog Joined July 2010
United States958 Posts
Last Edited: 2016-09-10 10:53:40
September 10 2016 10:02 GMT
#15201
edit: I suck at posting
On September 10 2016 08:42 Manit0u wrote:
Show nested quote +
On September 10 2016 01:37 phar wrote:
Yea this is likely not the important part of the error message. (In fact if you run with sudo the bit about a file not found may go away depending on your setup).


Please give me some credit...

1. I've tried running it with sudo (same result).
2. I've read somewhere on the interwebz that it might be the result of someone using their libraries and paths to compile the code which breaks on my machine. I've created a new C file with a single assert that's failing, compiled it and dbg'd it, the result is the same.
3. I've installed a ton of additional libraries I don't need but might be used by it (libc6-dev etc.), same thing.
4. People on the interwebz keep saying that you should ignore this error but it's driving me mad.

I did stuff like whreis file.c, which returned a manual but not the file. I've found the file eventually but under completely different path (somewhere inside /usr/share/).

I don't even know what provides this specific file and there's no info about it on the net. Please help. My perfectionist soul is dying here because I don't know if valgrind/dbg stop because of this error or errors in the application...

Edit: So far it seems to only show up on uncaught throws and asserts. Need to do more testing but I'm too drunk atm.


Browsing the internet watching GSL - you can get rid of error by putting that file in the path relative to the executable you're running as a quick fix if you rly care (but shouldn't matter tbh).

Real fix is you probably need to recompile whatever is calling it.

based off http://stackoverflow.com/questions/13152775/debugging-c-nptl-sysdeps-unix-sysv-linux-raise-c-no-such-file-or-directo and my testing just run (which is how I'm confident putting the file at relative path will get rid of error at least)


edit: looked into this a bit more since gsl finals sucked and it seems to be something about glibc. keep in mind i literally have written no c++ code ever but glibc abort.c includes signal, signal defines "raise" as an extern function, and has both a raise.c in a few places, including https://github.com/lattera/glibc/blob/master/nptl/sysdeps/unix/sysv/linux/raise.c. I'm not sure how extern is resolved by compiler but I'd assume that when it was compiled it resolved that^^ raise.c, even though it seems the glibc on ubuntu I downloaded from https://launchpad.net/glibc doesn't have the sysdeps under nptl.
RIP GOMTV. RIP PROLEAGUE.
gswittiness
Profile Joined September 2016
4 Posts
September 10 2016 10:47 GMT
#15202
When I skim through the discussions and whatnot I feel like an absolute noob, which I am haha. Started my first year through evening classes for a graduate degree in IT (choose to take the programming road and not networks) after working like an animal in something I really don't see myself doing for another 5 years, going through C# first, are there any websites (like hackerrank for example) where you can practice your C# skills? For exampe being presented with a problem and trying to find the solution and whatnot?
Ktk
Profile Blog Joined May 2010
Korea (South)753 Posts
September 10 2016 11:17 GMT
#15203
On September 10 2016 19:47 gswittiness wrote:
When I skim through the discussions and whatnot I feel like an absolute noob, which I am haha. Started my first year through evening classes for a graduate degree in IT (choose to take the programming road and not networks) after working like an animal in something I really don't see myself doing for another 5 years, going through C# first, are there any websites (like hackerrank for example) where you can practice your C# skills? For exampe being presented with a problem and trying to find the solution and whatnot?


Do the problems have to mention C#?

What do you plan on doing with C#?

but here are some mathy problems: https://projecteuler.net/
and bioinformatics problems: http://rosalind.info/problems/locations/

probably not very useful for you though, practically speaking :p
gswittiness
Profile Joined September 2016
4 Posts
September 10 2016 11:21 GMT
#15204
On September 10 2016 20:17 Ktk wrote:
Show nested quote +
On September 10 2016 19:47 gswittiness wrote:
When I skim through the discussions and whatnot I feel like an absolute noob, which I am haha. Started my first year through evening classes for a graduate degree in IT (choose to take the programming road and not networks) after working like an animal in something I really don't see myself doing for another 5 years, going through C# first, are there any websites (like hackerrank for example) where you can practice your C# skills? For exampe being presented with a problem and trying to find the solution and whatnot?


Do the problems have to mention C#?

What do you plan on doing with C#?

but here are some mathy problems: https://projecteuler.net/
and bioinformatics problems: http://rosalind.info/problems/locations/

probably not very useful for you though, practically speaking :p


Well, our prof told us we'd be focusing on C# only (at least this semester) so right now that's also the only thing I want to focus on instead of getting ahead of myself by including other languages, one step at a time. Anything that can be helpful to learn and improve my C# knowledge is basically what I'm looking for.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
September 10 2016 11:30 GMT
#15205
--- Nuked ---
Acrofales
Profile Joined August 2010
Spain18295 Posts
September 10 2016 11:53 GMT
#15206
On September 10 2016 20:21 gswittiness wrote:
Show nested quote +
On September 10 2016 20:17 Ktk wrote:
On September 10 2016 19:47 gswittiness wrote:
When I skim through the discussions and whatnot I feel like an absolute noob, which I am haha. Started my first year through evening classes for a graduate degree in IT (choose to take the programming road and not networks) after working like an animal in something I really don't see myself doing for another 5 years, going through C# first, are there any websites (like hackerrank for example) where you can practice your C# skills? For exampe being presented with a problem and trying to find the solution and whatnot?


Do the problems have to mention C#?

What do you plan on doing with C#?

but here are some mathy problems: https://projecteuler.net/
and bioinformatics problems: http://rosalind.info/problems/locations/

probably not very useful for you though, practically speaking :p


Well, our prof told us we'd be focusing on C# only (at least this semester) so right now that's also the only thing I want to focus on instead of getting ahead of myself by including other languages, one step at a time. Anything that can be helpful to learn and improve my C# knowledge is basically what I'm looking for.


Simply using it is one of the best ways to improve. Stackoverflow has a nice list of sites and forums that give hundreds of programming problems and puzzles. Some are specific for a language, but plenty are just open puzzles. Pick one that interests you and solve using C#.

http://programmers.stackexchange.com/questions/756/where-can-i-find-programming-puzzles-and-challenges
Wrath
Profile Blog Joined July 2014
3174 Posts
September 10 2016 13:59 GMT
#15207
Call me a retard but is it normal to waste full day on setting up eclipse with Symfony and run the code against apache httpd server and still not working?
Hhanh00
Profile Joined May 2016
34 Posts
Last Edited: 2016-09-10 15:08:00
September 10 2016 15:00 GMT
#15208
On September 10 2016 18:58 Manit0u wrote:
Show nested quote +
On September 10 2016 17:55 Hhanh00 wrote:
Your question is about the 'No such file or directory.' or about the reason of the abort?


No such file or directory.


The compiler leaves debugging info (unless you strip them) that relates offsets in the binary code to lines in the source code.
gdb breaks when your app raises SIGABRT (maybe because of an assert?). It tries to decode the stack by looking up return addresses. It found that the closest line is line 56 of raise.c but can't find the actual file on your system. By the way, that line is

int ret = INLINE_SYSCALL (tgkill, 3, pid, tid, sig);

which shows that we are about to go to the kernel which makes sense since we are raising a signal after all.

If you want to get rid of the message, you can download the source code of glibc and specify its location in .gdbinit
https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html

Obviously, you can also simply ignore it.

Edit: You don't have the file because it is a file from the glibc that was compiled by someone else. gdb doesn't care about what code belongs to who. Your code is treated the same way as any user code - including the C runtime.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2016-09-10 21:56:24
September 10 2016 21:55 GMT
#15209
Sensing I needed to review and make sure I understand java basics I wrote a pointless program. I wanted to check that I knew how to write things like equals, toString, getters/setters, constructors, and use inheritance correctly.

If anyone has free time could they look at my code and make sure I am not doing anything naughty?
Also I have 3 questions about the code (one in particular is important)


animal class
+ Show Spoiler +

package life;

public class animal {

private String type;
private int age;
private String size;

public animal(){
this.type = "unknown";
this.age = 0;
this.size = "unknown";
}

public animal(int a, String t, String s){
this.age = a;
this.type = t;
this.size = s;
}

public animal(animal oldAnimal){
this.age = oldAnimal.age;
this.type = oldAnimal.type;
this.size = oldAnimal.size;
}




public String toString(){
return ("This is a " + this.type + ", it is " + this.age + " years old, and it is " + this.size);
}


public boolean equals(Object other){
if(this == other){
return true;
}
if(!(other instanceof animal)){
return false;
}

animal a = (animal) other;
return this.toString() == a.toString();
}


public void move(){
System.out.println(this.type + " moved");
}

public void eat(String f){
System.out.println(this.type + " ate " + f);
}











public void setType(String t){
this.type = t;
}

public void setAge(int a){
this.age = a;
}

public void setSize(String s){
this.size = s;
}

public String getType(){
return this.type;
}

public int getAge(){
return this.age;
}

public String getSize(){
return this.size;
}


}




Human Class
+ Show Spoiler +

package life;

public class human extends animal {

private String name;

public human(){
super();
this.name = "unnamed";
}

public human(String n, String t, String s, int a){
super(a, t, s);
this.name = n;
}

public human(human oldHuman){
super(oldHuman);
this.name = oldHuman.name;
}

public String toString(){
return (super.toString() + " and it's name is " + this.name);
}

public boolean equals(Object other){
if(this == other){
return true;
}
if(!(other instanceof human)){
return false;
}

human h = (human) other;

return this.toString() == h.toString();
}






public void complain(String c){
System.out.println(this.name + " complains about " + c);
}

public void setName(String n){
this.name = n;
}

public String getName(){
return this.name;
}

}



"engine"
+ Show Spoiler +

package life;

import java.util.ArrayList;
import java.util.Iterator;

public class life {

public static void main(String[] args) {

ArrayList<human> humanList = new ArrayList<human>();

humanList.add(new human());
humanList.add(new human("Tim", "mammal", "medium", 25));
humanList.add(new human("Burt", "mammal", "huge", 43));
humanList.add(new human(humanList.get(1)));

Iterator<human> iterate = humanList.iterator();

while(iterate.hasNext()){
human thisHuman = iterate.next();
System.out.println(thisHuman.getName());
}

for(human h : humanList){
System.out.println(h.toString());
}

System.out.println(humanList.get(0).equals(humanList.get(1)));

System.out.println(humanList.get(1).equals(humanList.get(3)));


}

}



my questions
+ Show Spoiler +

1.) my equals method is based on what I was taught in lecture. my question is, what is the point of casting the object type when I am already checking if it is an instance of that object type?

in the specific example in lecture the professor does call an equals method within the equals method - he uses super.equals(other), but even with that example I don't understand why the casting is necessary.


2.) when I call super(oldHuman) in my constructor - what sorcery is this. it seems like magic. is this one of those things that java can "just do" ?



3.) System.out.println(humanList.get(1).equals(humanList.get(3))); is returning false. why? shouldn't this return true?




thank you to any kind souls who help me out
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-09-10 21:58:06
September 10 2016 21:57 GMT
#15210
On September 10 2016 22:59 Wrath wrote:
Call me a retard but is it normal to waste full day on setting up eclipse with Symfony and run the code against apache httpd server and still not working?


After 2 years of work experience, I think one could spend hours/days on stupid things which, once you figure out, could be simple. For example, I've spent about 3 work days trying to debug an application hosted by IIS. I couldn't figure out what the problem was when I was debugging from Visual Studio. It was happening, at least quickly, when there was no debugging/attaching to process involved and when there were a lot of requests in a short time. Anyway, solution was just to use 'using' block. What a stupid problem to have! :D
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2016-09-10 22:46:32
September 10 2016 22:16 GMT
#15211
On September 11 2016 06:55 travis wrote:
Sensing I needed to review and make sure I understand java basics I wrote a pointless program. I wanted to check that I knew how to write things like equals, toString, getters/setters, constructors, and use inheritance correctly.

If anyone has free time could they look at my code and make sure I am not doing anything naughty?
Also I have 3 questions about the code (one in particular is important)


animal class
+ Show Spoiler +

package life;

public class animal {

private String type;
private int age;
private String size;

public animal(){
this.type = "unknown";
this.age = 0;
this.size = "unknown";
}

public animal(int a, String t, String s){
this.age = a;
this.type = t;
this.size = s;
}

public animal(animal oldAnimal){
this.age = oldAnimal.age;
this.type = oldAnimal.type;
this.size = oldAnimal.size;
}




public String toString(){
return ("This is a " + this.type + ", it is " + this.age + " years old, and it is " + this.size);
}


public boolean equals(Object other){
if(this == other){
return true;
}
if(!(other instanceof animal)){
return false;
}

animal a = (animal) other;
return this.toString() == a.toString();
}


public void move(){
System.out.println(this.type + " moved");
}

public void eat(String f){
System.out.println(this.type + " ate " + f);
}











public void setType(String t){
this.type = t;
}

public void setAge(int a){
this.age = a;
}

public void setSize(String s){
this.size = s;
}

public String getType(){
return this.type;
}

public int getAge(){
return this.age;
}

public String getSize(){
return this.size;
}


}




Human Class
+ Show Spoiler +

package life;

public class human extends animal {

private String name;

public human(){
super();
this.name = "unnamed";
}

public human(String n, String t, String s, int a){
super(a, t, s);
this.name = n;
}

public human(human oldHuman){
super(oldHuman);
this.name = oldHuman.name;
}

public String toString(){
return (super.toString() + " and it's name is " + this.name);
}

public boolean equals(Object other){
if(this == other){
return true;
}
if(!(other instanceof human)){
return false;
}

human h = (human) other;

return this.toString() == h.toString();
}






public void complain(String c){
System.out.println(this.name + " complains about " + c);
}

public void setName(String n){
this.name = n;
}

public String getName(){
return this.name;
}

}



"engine"
+ Show Spoiler +

package life;

import java.util.ArrayList;
import java.util.Iterator;

public class life {

public static void main(String[] args) {

ArrayList<human> humanList = new ArrayList<human>();

humanList.add(new human());
humanList.add(new human("Tim", "mammal", "medium", 25));
humanList.add(new human("Burt", "mammal", "huge", 43));
humanList.add(new human(humanList.get(1)));

Iterator<human> iterate = humanList.iterator();

while(iterate.hasNext()){
human thisHuman = iterate.next();
System.out.println(thisHuman.getName());
}

for(human h : humanList){
System.out.println(h.toString());
}

System.out.println(humanList.get(0).equals(humanList.get(1)));

System.out.println(humanList.get(1).equals(humanList.get(3)));


}

}



my questions
+ Show Spoiler +

1.) my equals method is based on what I was taught in lecture. my question is, what is the point of casting the object type when I am already checking if it is an instance of that object type?

in the specific example in lecture the professor does call an equals method within the equals method - he uses super.equals(other), but even with that example I don't understand why the casting is necessary.


2.) when I call super(oldHuman) in my constructor - what sorcery is this. it seems like magic. is this one of those things that java can "just do" ?



3.) System.out.println(humanList.get(1).equals(humanList.get(3))); is returning false. why? shouldn't this return true?




thank you to any kind souls who help me out


1. It's standard practice to do an instanceof on a type before you cast it. In this specific case, you're checking if it isn't an instance of Human because if it's not an instanceof Human then it can't be equal. The way you're comparing the objects seems strange though. You should be ensuring that the fields have the same values rather than checking their toString output even though these technically produce the same thing.

2. This is a copy constructor. I'll just let you google java copy constructor and read about it.

Conventions wise; are all your class names lower case? Class names should be uppercase.
I'll always be your shadow and veil your eyes from states of ain soph aur.
ShAsTa
Profile Joined November 2002
Belgium2841 Posts
Last Edited: 2016-09-10 22:22:05
September 10 2016 22:17 GMT
#15212
On September 11 2016 06:55 travis wrote:
Sensing I needed to review and make sure I understand java basics I wrote a pointless program. I wanted to check that I knew how to write things like equals, toString, getters/setters, constructors, and use inheritance correctly.

If anyone has free time could they look at my code and make sure I am not doing anything naughty?
Also I have 3 questions about the code (one in particular is important)


animal class
+ Show Spoiler +

package life;

public class animal {

private String type;
private int age;
private String size;

public animal(){
this.type = "unknown";
this.age = 0;
this.size = "unknown";
}

public animal(int a, String t, String s){
this.age = a;
this.type = t;
this.size = s;
}

public animal(animal oldAnimal){
this.age = oldAnimal.age;
this.type = oldAnimal.type;
this.size = oldAnimal.size;
}




public String toString(){
return ("This is a " + this.type + ", it is " + this.age + " years old, and it is " + this.size);
}


public boolean equals(Object other){
if(this == other){
return true;
}
if(!(other instanceof animal)){
return false;
}

animal a = (animal) other;
return this.toString() == a.toString();
}


public void move(){
System.out.println(this.type + " moved");
}

public void eat(String f){
System.out.println(this.type + " ate " + f);
}











public void setType(String t){
this.type = t;
}

public void setAge(int a){
this.age = a;
}

public void setSize(String s){
this.size = s;
}

public String getType(){
return this.type;
}

public int getAge(){
return this.age;
}

public String getSize(){
return this.size;
}


}




Human Class
+ Show Spoiler +

package life;

public class human extends animal {

private String name;

public human(){
super();
this.name = "unnamed";
}

public human(String n, String t, String s, int a){
super(a, t, s);
this.name = n;
}

public human(human oldHuman){
super(oldHuman);
this.name = oldHuman.name;
}

public String toString(){
return (super.toString() + " and it's name is " + this.name);
}

public boolean equals(Object other){
if(this == other){
return true;
}
if(!(other instanceof human)){
return false;
}

human h = (human) other;

return this.toString() == h.toString();
}






public void complain(String c){
System.out.println(this.name + " complains about " + c);
}

public void setName(String n){
this.name = n;
}

public String getName(){
return this.name;
}

}



"engine"
+ Show Spoiler +

package life;

import java.util.ArrayList;
import java.util.Iterator;

public class life {

public static void main(String[] args) {

ArrayList<human> humanList = new ArrayList<human>();

humanList.add(new human());
humanList.add(new human("Tim", "mammal", "medium", 25));
humanList.add(new human("Burt", "mammal", "huge", 43));
humanList.add(new human(humanList.get(1)));

Iterator<human> iterate = humanList.iterator();

while(iterate.hasNext()){
human thisHuman = iterate.next();
System.out.println(thisHuman.getName());
}

for(human h : humanList){
System.out.println(h.toString());
}

System.out.println(humanList.get(0).equals(humanList.get(1)));

System.out.println(humanList.get(1).equals(humanList.get(3)));


}

}



my questions
+ Show Spoiler +

1.) my equals method is based on what I was taught in lecture. my question is, what is the point of casting the object type when I am already checking if it is an instance of that object type?

in the specific example in lecture the professor does call an equals method within the equals method - he uses super.equals(other), but even with that example I don't understand why the casting is necessary.


2.) when I call super(oldHuman) in my constructor - what sorcery is this. it seems like magic. is this one of those things that java can "just do" ?



3.) System.out.println(humanList.get(1).equals(humanList.get(3))); is returning false. why? shouldn't this return true?




thank you to any kind souls who help me out


I advise you to test for equals using the attributes themselves and not the toString. Also you need to call equals on the toString result because now you're testing for reference equality (which will fail) and not the kind of equals you want. That's probably the reason for 3)
Most IDEs can generate the equals (and hashCode) for you. Btw, if you define your own equals you should also define a hashCode method that's compatible.
If we hit that bull's eye, the rest of the dominoes will fall like a house of cards. Checkmate.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
September 10 2016 23:21 GMT
#15213
ah thanks guys

okay so class names capitalized, got it

shasta, you are correct about the problem with my equals method and your explanation makes sense. Don't know what a hashCode method is but I guess that's something new to learn
Manit0u
Profile Blog Joined August 2004
Poland17750 Posts
Last Edited: 2016-09-11 02:15:01
September 11 2016 02:11 GMT
#15214
On September 10 2016 22:59 Wrath wrote:
Call me a retard but is it normal to waste full day on setting up eclipse with Symfony and run the code against apache httpd server and still not working?


First of all, if you're developing with Symfony you don't even need Apache. Symfony has its own built-in server for development purposes if you need one.

You can of course still use Apache, Nginx or whatever else you need (for Apache note that Symfony doesn't use .htaccess and you must have proper Require All Granted etc. set in your host settings, you can look those up in the Symfony docs).

Second thing is the fact that you should not use Eclipse for that. NetBeans would be better but still shitty. Just for learning you could be using PhpStorm (with super duper mega excellent symfony plugin) in its 30-day free trial (or endless trial if you're a student). Trust me, it's miles apart from any freeware solution. I can't even look at Eclipse or NetBeans after using jetbrains products...
Time is precious. Waste it wisely.
Hhanh00
Profile Joined May 2016
34 Posts
Last Edited: 2016-09-11 03:21:58
September 11 2016 03:09 GMT
#15215
The amount of boilerplate code required to implement a trivial struct in Java is sad.

+ Show Spoiler +


public class Animal {
private String type;
private int age;
private String size;

public Animal(String type, int age, String size) {
this.type = type;
this.age = age;
this.size = size;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}

public String getSize() {
return size;
}

public void setSize(String size) {
this.size = size;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Animal animal = (Animal) o;

if (age != animal.age) return false;
if (type != null ? !type.equals(animal.type) : animal.type != null) return false;
return size != null ? size.equals(animal.size) : animal.size == null;
}

@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + age;
result = 31 * result + (size != null ? size.hashCode() : 0);
return result;
}

@Override
public String toString() {
return "Animal{" +
"type='" + type + '\'' +
", age=" + age +
", size='" + size + '\'' +
'}';
}
}



Fortunately some IDEs can generate this for you but it's still a hassle when you don't have one or you want to update the class definition later.

It's also so easy to forget about checking for null values and forgetting about hashCode() when you implement equals.

Compare this to scala:


case class Animal(tpe: String, age: Int, size: String)


A single line is all it takes.

In case you are stuck with Java, you may want to take a look at Project Lombok that uses AOP to inject the boiler plate.

The java code becomes

@Data
public class Animal {
private String type;
private int age;
private String size;
}


and ends up being the same bytecode.

PS: To the @OP, in additional to what other people told you, the main issue in your code is that equals doesn't handle null values and will throw an exception.
Also, equals is supposed to return true only if both values have the same class so an animal cannot be equal to a human. With instanceof T you are checking if the right hand side is T or derived from T.
phar
Profile Joined August 2011
United States1080 Posts
September 11 2016 03:25 GMT
#15216
Ideally you never construct a new struct-like class yourself and just use some autogens like AutoValue.
Who after all is today speaking about the destruction of the Armenians?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
September 11 2016 04:21 GMT
#15217
Also you don't have to make getters and setters unless you need to control access. Just make the members public.
There is no one like you in the universe.
Wrath
Profile Blog Joined July 2014
3174 Posts
September 11 2016 05:44 GMT
#15218
On September 11 2016 11:11 Manit0u wrote:
Show nested quote +
On September 10 2016 22:59 Wrath wrote:
Call me a retard but is it normal to waste full day on setting up eclipse with Symfony and run the code against apache httpd server and still not working?


First of all, if you're developing with Symfony you don't even need Apache. Symfony has its own built-in server for development purposes if you need one.

You can of course still use Apache, Nginx or whatever else you need (for Apache note that Symfony doesn't use .htaccess and you must have proper Require All Granted etc. set in your host settings, you can look those up in the Symfony docs).

Second thing is the fact that you should not use Eclipse for that. NetBeans would be better but still shitty. Just for learning you could be using PhpStorm (with super duper mega excellent symfony plugin) in its 30-day free trial (or endless trial if you're a student). Trust me, it's miles apart from any freeware solution. I can't even look at Eclipse or NetBeans after using jetbrains products...


I'm not a student and I can't guarantee that the workplace will provide me a phpstorm. That is why I'm trying to get a free IDE...
teamamerica
Profile Blog Joined July 2010
United States958 Posts
September 11 2016 06:19 GMT
#15219
On September 11 2016 13:21 Blisse wrote:
Also you don't have to make getters and setters unless you need to control access. Just make the members public.


The downside is in Java is that if you wanna change it to a method you have to change every callsite. You can argue that in the case you're refactoring a public property into a method that's not a big deal, but other languages let $object.property be either a direct instance variable lookup or a method call.


On September 11 2016 14:44 Wrath wrote:
Show nested quote +
On September 11 2016 11:11 Manit0u wrote:
On September 10 2016 22:59 Wrath wrote:
Call me a retard but is it normal to waste full day on setting up eclipse with Symfony and run the code against apache httpd server and still not working?


First of all, if you're developing with Symfony you don't even need Apache. Symfony has its own built-in server for development purposes if you need one.

You can of course still use Apache, Nginx or whatever else you need (for Apache note that Symfony doesn't use .htaccess and you must have proper Require All Granted etc. set in your host settings, you can look those up in the Symfony docs).

Second thing is the fact that you should not use Eclipse for that. NetBeans would be better but still shitty. Just for learning you could be using PhpStorm (with super duper mega excellent symfony plugin) in its 30-day free trial (or endless trial if you're a student). Trust me, it's miles apart from any freeware solution. I can't even look at Eclipse or NetBeans after using jetbrains products...


I'm not a student and I can't guarantee that the workplace will provide me a phpstorm. That is why I'm trying to get a free IDE...


If for some reason work refuses to pay for it I'd really recommend just buying it yourself. Idk if you're not in US but if you are it's pretty cheap; I did that for my first job and I didn't regret it at all.
RIP GOMTV. RIP PROLEAGUE.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 11 2016 07:31 GMT
#15220
On September 11 2016 12:09 Hhanh00 wrote:
In case you are stuck with Java, you may want to take a look at Project Lombok that uses AOP to inject the boiler plate.

The java code becomes

@Data
public class Animal {
private String type;
private int age;
private String size;
}


and ends up being the same bytecode.

I've looked into AOP but never actually used it. You probably have some actual experience with it. I've always wondered how it affects debugging - you obviously can't step through single lines of code if you never write them. How's that working out for you?
If you have a good reason to disagree with the above, please tell me. Thank you.
Prev 1 759 760 761 762 763 1032 Next
Please log in or register to reply.
Live Events Refresh
Patches Events
19:30
Patches' Patch Clash #7
RotterdaM427
Liquipedia
BSL
19:00
RO8 - Day 4
DragOn vs Dewalt
TerrOr vs OyAji
ZZZero.O324
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 427
JuggernautJason107
ProTech98
EmSc Tv 25
StarCraft: Brood War
Britney 26122
ZZZero.O 324
Dewaltoss 71
Zeus 63
NaDa 14
League of Legends
JimRising 478
Heroes of the Storm
Liquid`Hasu397
Other Games
summit1g7871
gofns6551
tarik_tv6358
FrodaN4778
Grubby3855
Liquid`RaSZi2680
shahzam423
KnowMe345
QueenE85
kaitlyn34
Organizations
Other Games
gamesdonequick1038
BasetradeTV82
StarCraft 2
angryscii 32
EmSc Tv 25
EmSc2Tv 25
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 19 non-featured ]
StarCraft 2
• Hupsaiya 53
• Reevou 9
• musti20045 5
• IndyKCrew
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• LaughNgamezSOOP
StarCraft: Brood War
• Michael_bg 4
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 1834
Other Games
• imaqtpie1069
• WagamamaTV409
• Shiphtur238
• tFFMrPink 15
Upcoming Events
OSC
2h 51m
Universe Titan Cup
13h 51m
Rogue vs Percival
Wardi Open
14h 51m
Monday Night Weeklies
18h 51m
Replay Cast
1d 2h
Kung Fu Cup
1d 13h
GSL
2 days
herO vs Classic
Cure vs Clem
uThermal 2v2 Circuit
2 days
Replay Cast
3 days
GSL
3 days
Maru vs SHIN
Zoun vs Rogue
[ Show More ]
WardiTV Spring Champion…
3 days
SKillous vs Strange
Lambo vs Strange
Ryung vs Strange
Lambo vs Ryung
Ryung vs SKillous
Lambo vs SKillous
Replay Cast
4 days
Maestros of the Game
4 days
Replay Cast
5 days
RSL Revival
5 days
TBD vs SHIN
TBD vs Rogue
IPSL
5 days
ZZZero vs WorsT
Julia vs eOnzErG
Replay Cast
6 days
RSL Revival
6 days
IPSL
6 days
Dragon vs Artosis
dxtr13 vs Hawk
BSL
6 days
Liquipedia Results

Completed

Escore Tournament S2: W8
2026 GSL S1
Heroes Pulsing #1

Ongoing

2026 KK StarCraft Pro League
BSL Season 22
IPSL Spring 2026
KCM Race Survival 2026 Season 2
KK 2v2 League Season 1
YSL S3
Acropolis #4
SCTL 2026 Spring
WardiTV Spring 2026
2026 GSL S2
RSL Revival: Season 5
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals

Upcoming

CSCL: Masked Kings S4
Escore Tournament S2: King of Kings
BSL 22 Non-Korean Championship
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
Bounty Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.