« first day (2405 days earlier)      last day (2531 days later) » 
00:00 - 14:0014:00 - 19:00

12:43 AM
Dead chat. :(
 
 
1 hour later…
2:13 AM
Is there a way to force all running methods (except main) to return/terminate?
 
 
2 hours later…
4:00 AM
"I know for sure that what we dwell on is who we become." -Oprah Winfrey (source)
 
4:39 AM
morning
 
4:58 AM
@OakBot lol
 
@ColdFire Type /help to see all my commands.
 
 
2 hours later…
6:59 AM
posted on May 24, 2017 by CommitStrip

 
7:17 AM
morn
 
morn
 
Morning
 
Hi!
 
morn
 
 
1 hour later…
8:44 AM
Morning
 
9:03 AM
@CrashBandicoot how's your code going?
 
@Tavo Still trying
Not really working tbh
 
what isn't?
 
Can Java send HTTP requests?
 
I have a free hour, so I'm happy to give you a hand
yes
HttpURLConnection class (not sure about the capitalisation though)
 
@Tavo thanks
 
9:06 AM
np
 
I have to limit the number of authors to 5
 
@Tavo Thank you! I was wondering what that class was for
 
Unihedron said I should refer to line 15 and use that in the AddAuthor() method
 
Hello is here anyone with some GWT knowledge?
 
@RowanKleinGunnewiek Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
9:14 AM
@CrashBandicoot not sure what you mean
 
Basically, I'm asked to create an AddAuthor() method
 
aha
and what are the requirements?
 
Make sure that you either limit the number of authors to five, or if you want more you will need to create a new array of a larger size in order to deal with it.
That's what I'm asked to do ^
 
ok
 
Which I'm struggling to understand/implement
 
9:15 AM
ok, what is it that you don't understand
 
I understand that there can only be max 5 authors for 1 book
But how do I write this in code?
I'm sure I did that on lines 9 & 15
 
ok, your specs say that you can have a default max of 5, but you can have more, right?
 
No, there can only be a max of 5 authors
No more
 
"or if you want more you will need to create a new array of a larger size in order to deal with it."
 
Oh I see
I'll stick to the first part
 
9:19 AM
you want to comply with the requirements or not?
 
\o
 
hey @ItachiUchiha
 
9:20 AM
@CrashBandicoot so you want to be able to have more than 5
 
Ok, yeah
I can't use an ArrayList
 
so what you have done on line 9 is good
 
Line 5?
 
but you can potentially have more than 5, so what you have done in line 15 is not 100% correct
what you are doing there is limiting the size to 5 authors
 
I see
So, that complies with the first part of the requirement?
 
9:22 AM
yes, but not with the whole list of requirements
so let's forget about line 15 for a bit, and go to your addAuthors method
 
what does this method need to do?
 
So this is the Question:
It makes more sense to have an 'add author' method than to just get and set the entire array, write this method. Make sure that you either limit the number of authors to five, or if you want more you will need to create a new array of a larger size in order to deal with it.
 
mmmmmm. That is quite ambiguous
it can be understood as 'you can limit the number of authors to 5'
 
Okay, makes sense
 
9:25 AM
ok, I think you can go with your assumption of 'max 5 authors'
so what do you need to do in your addAuthor method?
 
Limit number of authors for 1 book to 5?
 
no, that's not the job of your method
 
@Tavo ssup?
 
ok, I'll split it for you with a number of questions
@ItachiUchiha reading YDKJS books. Trying to get some concepts clear. Yourself?
 
o/
 
9:28 AM
\o
 
YDKJS ?
 
@CrashBandicoot if you have 0 authors and you invoke addAuthor, what do you need to do?
@ItachiUchiha you don't know JS
 
Add an author xD
 
@CrashBandicoot brilliant. If your book has 3 authors and you invoke addAuthor, what do you need to do?
 
@Tavo Not much
 
9:29 AM
@ItachiUchiha easy joke. I admit I deserve it
 
@Tavo :O
 
LOL
it gets that information of 3 authors
 
lol
 
@CrashBandicoot no. addAuthor still needs to add the author
 
You just need to fill out that info
 
9:31 AM
addAuthor is only meant to add an author to the book. Unless you already have 5 authors
 
Yes ofc
 
then that's it. Implement that logic
 
So, I just need to basically add authors into that method?
 
unsurprisingly, yes :P
 
But, it hasn't specified that in the requirement
 
9:33 AM
lol
 
Later on, it says:
Write a toString() method for the book. It should return all the details about the book formatted in the following way:
Book: [Title, Author1, Author2,.... Price]

Return to the main function in the library.client package and create a number of books and print out the contents of them.
Add the books to an array and loop through the array printing out the contents of each object.
 
@CrashBandicoot I think whoever wrote the requirements thought that you would get what the method should do just by the name. Calling it addAuthor sounds very clear
 
@Tavo Sorry for being so dumb
xD
 
yeah how can you be this dumb
just kidding ;)
 
It's the simple stuff that baffles me
:D
 
9:36 AM
not saying you are dumb. Most of the times requirements are not nearly as clear as the ones you have
 
java is not an easy language to pic up
so there are no dumb questions imo ;)
 
Thanks!
I know the method is clearly named AddAuthor()
 
part of your job as an engineer is to be able to fill in the gaps in the requirements
actually, sometimes I feel that's most of what I do...
 
But the requirements don't specifically tell me to add any authors
 
well... name of the method again?
 
9:37 AM
And by that, do I create loads of different authors?
 
if the method was called removeAllAuthors, what should the method do?
the method name is in singular
it's called addAuthor not addAuthors
 
So, I create one Author name
But obviously, not all books have the same author
Could you show me a bit of code of what it should look like?
 
ehrm... No, it's like two lines
I don't want to code it for you
you won't learn
ask as many questions as you like. But I don't think writing it for you is a good idea
 
So, do I hard code one author name?
or do I write code that generates random names?
 
none
I'll ask the questions again
if you have 0 authors, what should your method do?
 
9:43 AM
Add an author
 
good
if you have 3 authors, what should your method do?
 
Add 3 Authors
 
I'll rephrase it. If your book already has three authors and you invoke addAuthor, what should your method do?
 
Bring back 3 Authors
 
no
what is the method's name?
 
9:45 AM
AddAuthor
Add 2 authors?
 
no
 
I don't know
 
I'll put it this way: if you have three apples in a bag and you invoke bag.addApple(), how many apples will you have in the bag?
 
exactly
 
9:47 AM
Ohhh
This method adds one author
and, if you have 1 author, this method adds another
 
and one last question: if you have 5 authors and you invoke addAuthor, what should you do?
 
Make the array expandable?
Or, stop the loop?
 
you said your limit will be 5
what loop?
 
Okay, so disallow the adding of another author?
 
just don't add it
 
9:49 AM
Okay
 
that's what your method needs to do
finally, we made progress :D
is it clear now?
 
So, would it be BookDescription.getAuthor()?
It's clear
 
that's a different method
 
AddAuthor.getAuthor()
 
what?
 
9:51 AM
I understand the concept
But the code xD
Would it have a getAuthor in it?
 
no
what's your method's signature?
 
public static void
 
no, that's not the signature, those are the modifiers + the return type
the signature is the rest
also, why would it be static?
you are missing a lot of the basics by the look of it...
 
So, the signature is AddAuthor()
 
9:55 AM
you are missing something there. What author are you adding?
@geisterfurz007 morn
 
I don't understand
 
if I tell you "add an author to the book", wouldn't you ask "what author"?
 
so what are you missing?
look at your setTitle method
 
a return statement
 
9:58 AM
no
that's the method's body
nothing to do with the signature
 
Oh sorry
the String
Of course
 
good, because I'm leaving now
 
And, then it would require a return statement
 
no
 
That's what it says in the intelisense
 
10:00 AM
@Tavo Enjoy your day/sleep :>
 
I'll leave it to you to complete. But honestly, you need to review your basics
good luck for the day
niters all!
 
bye Tavo
 
@Tavo bye
If you have String in the signature, you need a return statement don't you?
 
morning guys
 
That's what comes up in the Intellisense
@Sayros Morning
 
10:02 AM
Hey @Sayros
 
hey
 
o/
 
\o
 
who upvoted my question :D
whoever it was thank you
 
I really have some strange behavior. I let entities generate my db tables. I just removed a field from one of them and it still tries to select the field even though it's no longer in my entity which ofcourse results in an exception.
 
10:09 AM
@mahieus Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
so the tables are generated how they should be
but once I want to select/insert/... he complaints that he can't field the missing column
using spring with spring-data
 
10:42 AM
Still finding it difficult
I can't code the AddAuthor() Method
To have: public static String AddAuthor() {}
You need a return statement
 
11:09 AM
@kiheru Greetings
 
11:59 AM
Hello @Joe'sMorgue
 
Dang! Long time no hear!
How have you been?
 
I've been fine. Just rather busy
 
I know that feeling
I got a new place.
Dealt with a computer that didn't want to run properly...
JUST got a real computer, and still configuring it...
87*********/9
Sorry, my cat was standing on the KB
I got Android Studio installed, haven't started fussing with it because I've been busy getting settled, and such crap
 
12:33 PM
@CrashBandicoot you got two options on your addAuthor() method
either you declare it a "void" so it does not return a value and just does some stuff
of you can let it return a boolean in case you want feedback whether adding worked or not
 
@motaa I see
 
12:45 PM
@motaa, someone gave me this code, which I think is too complex for me
 
@CrashBandicoot take a look at this paste.ofcode.org/EYPFxu5H3UHypuyHbqvJvM
what code?
 
well he used an arraylist
/arraylist
 
I don't think I can use an arraylist
 
/javadoc ArrayList
 
12:47 PM
if you have to stick to array check the link I gave you
 
@geisterfurz007 Sorry, I never heard of that class. :(
@geisterfurz007 java.util.ArrayList: Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list. (This class is roughly equivalent to Vector, except that it is ...
unsynchronized.) @since 1.2 (1/9)
 
@motaa Okay cool
 
oh btw @CrashBandicoot he used an arraylist but converted it back to an array
 
we were not allowed to use lists either when learning arrays
 
12:49 PM
btw, this is the exercise I have to do: paste.ofcode.org/4GmEDYsjmiAY53gYXSZURW
 
pain in the ass not beeing able to work with collections in general q-q
 
well then look deeper into my suggestion
 
I'm on Question 7
 
you should not have "authorCount" in your class, its useless, you already have "authors", just deal with it
 
@Julo0sS It is not! It can be used to track how many authors are in there
Using an array, one would then always have to check how many elements are not null
 
12:52 PM
yeah but get the size of the array does the same job
 
@Julo0sS since this is an array it will always have 5 values
 
Okay, now this is confusing :(
 
change type to arrayList?
 
Could you show me the code needed to do Q.7?
 
and if he adds 3 at the beginning and wants to add another one later on
 
12:52 PM
@CrashBandicoot motaa already did :)
 
he must use arrays
 
7 mins ago, by motaa
@CrashBandicoot take a look at this https://paste.ofcode.org/EYPFxu5H3UHypuyHbqvJvM
 
@geisterfurz007 Is that all of it?
So, if I use the boolean method, that's it?
 
Either the boolean one or the one above that with the void
 
Okay cool
 
12:53 PM
there is a typo in line 15
 
@geisterfurz007 geissssssssssssssssssss
 
@ColdFire Aayyyyeeeeeeeeee
 
Shouldn't it be <= 5 and not <= 4?
Since I want a max of 5 authors
 
you are checking the length. You want the length to be less than or equal to 5
 
12:55 PM
no since you want to know how many elements there are
 
length of array -> n
Greatest index of array -> n-1
 
if it got 6 you will have to take the first 5
 
Oh I see
What's that on line 17?
 
you really should start about the basics of programming and especially object oriented programming
@CrashBandicoot it is a short for loop
a for each actually
since your array contains String
 
I understand what it is, but the exercise doesn't ask for me to use a loop there
 
12:58 PM
you just iterate over every String contained in your array
well your exercise doesn't ask you to use conditionals
and yet you are using them :D
 
It doesn't, no
 
loops and conditionals is basic coding stuff that is just needed
oone could go assembly style and start using labels and "jumping" commands :D
 
Morning, Java!
 
G'day and bye Michael ;)
 
hey@Michael
 
1:02 PM
@motaa
 
Bye :D Getting ready to drive out \o/
 
Thanks
 
@motaa One could as well not do that xD
 
and in your exercises questions it is neither exlicitly nor implicitly mentioned not to use a loop for some task you need to be solved
 
@motaa could you step me through the AddAuthor method?
Thanks for taking the time to help!
 
1:04 PM
@geisterfurz007 whatsup
 
The first part checks if the number of elements in author <=4
 
good luck and dont crash the planes@geisterfurz007
;)
 
@CrashBandicoot ye still correcting a little mistake in there
 
@Hans1984 lol
 
@motaa Also, instead of authorcount, can I just use author.length?
 
1:09 PM
no because that will always be 5
 
ohh ok
 
since you instantiated a new array of length 5
that's why we go through the array in the constructor to see how many items are already stored
and the authorcount variable will hold the count
 
I see @motaa Thanks
 
so when you use the method addAuthor(String author) you know at what index in your array you can store it without overwriting previously set authors
 
Ahh okay
I'm not quite understanding Line 49 onwards
 
1:14 PM
line 50: void means that your method will not return a result
 
Sorry, line 61
 
plus you can remove the static btw on all your methods now
we will go through line 58 onwards
 
Okay, before that
 
line 58: your method will return a boolean --> so true or false
 
I'm getting an error on line 61, which says I should change it to getAuthor()
 
1:17 PM
in our case true if adding an author worked or false if it didn't (in case there are already 5 authors in your array)
ye there might be a typo :D I freely typed it :D
 
wait a sec I will paste it into my IDE
@CrashBandicoot check this one paste.ofcode.org/cgwFbAJJKcAFYAcPRgFjba
 
Line 63, I have to change it to: this.getAuthor()...
 
does not make sense :D
 
When I do this.author()...
the author is red-lined
Saying that "the method author is un-defined for the type BookDescription"
 
1:25 PM
then you missed } somewhere
 
Hey @gei @Hans
 
1:37 PM
Wouldn't getAuthor() still work?
 
Dang it @Crash!! Update your getter method name!!
 
What should it be?
 
@NavnathAdsul Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
@Michael
 
1:45 PM
my current setup: docker image with tomcat running a spring (not spring boot) application
problem: almost non of the exceptions are logged
solution: ?
 
@Hans1984 will try my best. Well I am only there to ask questions so that should be fine :P
 
@CrashBandicoot I am pretty sure your mixed up your classnaming
 
Doesn't it do the same thing?
 
what is ur classfile named?
 
BookDescription
 
1:58 PM
in my IDE the class you pasted workd fine
 
00:00 - 14:0014:00 - 19:00

« first day (2405 days earlier)      last day (2531 days later) »