« first day (2314 days earlier)      last day (2851 days later) » 
01:00 - 17:0017:00 - 22:00

user6857832
17:00
x = triangle.get(i).get(j)?
.get(i).get(j)
user6857832
Yeah
@Hemlata Your break stops the loop, when a certain condition is met and after the loop the only thing you do is print out the value right? After that the method is ended.
So instead of that you can just return the value and save a lot of lines and get rid of that label.
user6857832
@geisterfurz007 I just want to loop till or when I get the max value, then further I don't need to check. So that's why I break out of loop.
17:02
Wait yeah
I just checked again...
user6857832
@geisterfurz007 No, It again loop.
Welp I am not at that point at all :> Will have to worry about things like that later ^^
@ItachiUchiha Are you available by now?
user6857832
Yeah haha
user6857832
Looks like itachi is busy haha
That's quite unfortunate :/
user6857832
17:06
How do I get the index of 64?
triangle.add(Arrays.asList(75));
triangle.add(Arrays.asList(95,64));
user6857832
@geisterfurz007
triangle.indexOf(64);
user6857832
I did like that but it's not working
Or if it is in one of the inner lists
for (int i=0; i<=triangle.size().1; i++){
  triangle.get(i).indexOf(64);
}
I think Javas compiler should add a CodeNotWorkingException soon...
user6857832
I will try
17:11
Yeah I am an idiot. Only the second one will work for nested lists :D Because 64 will never be java.List@f4d52a I assume ;)
user6857832
It is working If I use for (List<Integer> row : triangle), but it is not working for loop: for (int i = 1; i < triangle.size() - 1; i++) {
user6857832
@MadaraUchiha Can you please help me?
Your second loop is wrong. it starts at 1 and will go up to the point where i is less than 1
@Hemlata In your code, triangle is an array, not a list
which means it will not execute
17:13
Also, that ^
user6857832
Yeah, I didn't updated my code.
user6857832
But it is an list.
user6857832
List<List<Integer>> triangle = new ArrayList<List<Integer>>();
triangle.add(Arrays.asList(75));
triangle.add(Arrays.asList(95, 64));
triangle.add(Arrays.asList(17, 47, 82));
When did I drink my tea?! Already empty...
Must have vanished somehow...
user6857832
https://hastebin.com/ixolusoqiq.cs
Can you please have a look at it? It's updated code @MadaraUchiha
17:16
for (j = j;
what is that construct?
user6857832
It means j = 0
and your loop is still wrong
user6857832
Can anyone please write code with this list:
triangle.add(Arrays.asList(75));
triangle.add(Arrays.asList(95, 64));
triangle.add(Arrays.asList(17, 47, 82));
and just show me how to get the index of 47 in here with "for loop" like I used?
user6857832
@MadaraUchiha
user6857832
Can you please help me?
user6857832
17:19
@geisterfurz007 Nah, my loop is working.
@geisterfurz007 may be in another quarter hour
for (int i=0; i<=triangle.size()-1; i++){
int index = triangle.get(i).indexOf(47);
}
@ItachiUchiha aye :)
user6857832
It doesn't work.
user6857832
@ItachiUchiha Can you please help me? I jus need your 2 minutes.
Code works perfect for me....
prints -1 if not found for each line and 1 as index for the third
I do not see your problem except the fact that in the code you posted above you are missing the first and last line you add with your messed up loop
@Hemlata
user6857832
17:26
Where is another loop in it?
what for another loop?
You do not need another loop
you only need to access each of the stored integer lists.
user6857832
I want 		for (int i = 1; i < triangle.size() - 1; i++) {
				for (j = j; j <= triangle.get(i).size(); j++) {
                                   //here is my max variable, so I need to use getIndex() here
}
}
triangle.get(i).indexOf();
and fix your loop
you are missing out the first list item and the last one
except that that is intended
user6857832
Nvm. You are not getting what I am trying to say.
Then you are not good in explaining. Note that a mcve is usually better to explain your problem..
user6857832
17:29
I already said I wanna use getIndex() after this loop: for (j = j; j <= triangle.get(i).size(); j++) {
user6857832
2 mins ago, by Hemlata
I want 		for (int i = 1; i < triangle.size() - 1; i++) {
				for (j = j; j <= triangle.get(i).size(); j++) {
                                   //here is my max variable, so I need to use getIndex() here
}
}
THEN DO IT GOD DAMNIT
2 mins ago, by geisterfurz007
triangle.get(i).indexOf();
user6857832
I think it is explaining what I am trying to say
You come with quotes, I do as well
user6857832
@geisterfurz007 It is NOT work.
17:30
Does not work is not an error message!
user6857832
working*
user6857832
It gives -1
-1 = not found in current list item
user6857832
but it is there in the list
user6857832
Can you show me code which is working?
17:31
6 mins ago, by geisterfurz007
https://hastebin.com/nasizebita.cs
@geisterfurz007 I am stuck. May take longer. I will ping you if I get some time or tomorrow.
user6857832
Can you please write code with both for loops?
user6857832
Like I said where I wanna use getIndex()
Then tomorrow @ItachiUchiha It already is time for dinner here ;)
Alright
17:33
I will ping you when I am here; is that fine?
@Hemlata what is getIndex?
user6857832
Nvm. I will figure it out myself.
Here is one with two loops. Command stays the same though...
user6857832
-1
-1
-1
-1
-1
-1
1
1
1
user6857832
This is the output which is wrong.
user6857832
I just copied your code and ran it.
user6857832
17:37
I didn't read
Was wrong what I wrote
user6857832
Yeah, it is.
It's good practice to figure why geiister's code is wrong.
Aww
why did you tell her
-1 not found in first list
-1 not found in second list
-1 not found in second list
1 found in third list at position 1 (zero-based)
1 found in third list at position 1 (zero-based)
1 found in third list at position 1 (zero-based)
Is the output with the corrected version + interpretation
user6857832
It is still not working
user6857832
17:40
-1
-1
-1
0
0
0
user6857832
When I searched for 17
user6857832
It is still wrong
user6857832
-1
-1
-1
1
1
1
17:41
1 min ago, by geisterfurz007
-1 not found in first list
-1 not found in second list
-1 not found in second list
1 found in third list at position 1 (zero-based)
1 found in third list at position 1 (zero-based)
1 found in third list at position 1 (zero-based)
user6857832
It is for 47
user6857832
@geisterfurz007 Yeah, it is wrong.
WHAT THE HECK HEM
I even wrote the explanation there
The output is correct
user6857832
It should be
-1
-1
-1
-1
1
-1
user6857832
17:42
Yes
But fine you can get that
user6857832
It should give the index if the value is found and -1 otherwise
user6857832
@geisterfurz007 Here there is 3 one
for (int i=0; i<=triangle.size()-1; i++){
			for (int j=0; j<=triangle.get(i).size()-1; j++){
				if (triangle.get(i).get(j) == 47) System.out.println(j);
					else System.out.println(-1);
			}
		}
user6857832
Oh yeah, it is working.
user6857832
17:44
Thanks! I will try with it.
After that I am out ;)
Good luck with the task!
@geisterfurz007 HADOKEN!
user6857832
@geisterfurz007 Lol it is working, but I don't want the index of current value, but it is just returning the index of current j
18:05
wut?
you have to adjust it... I will not write the PE code for you :P
user6857832
Yeah, it is checking here if the current value is equal to some value, and If so then it will just print the value of j
user6857832
and I want is just get the index of the max value.
user6857832
But it's fine. I will ask on SO, or someone else.
you can leave out the else System.out.println(-1) so that that goes not into output
user6857832
Yeah, but that's not what I am lookin' for.
18:07
and replace the 47 with the maxvalue
user6857832
It will still gonna give the value of j (current value)
but I am not sure what "the index of current value" is supposed to be
user6857832
And, I want index of max value
j is the index of the maxvalue...
or what is your definition of index
18:36
I can't remember who was helpful in the argument with Jonah yesterday (their name was like dhch or something) - but thank you very much.
@dcsohl yeah - you, thank you :).
You're welcome. You may not have seen that he repented. I told him he was being a jerk and he was all "really? Sorry."
Yeah I saw - it came up as a notification
I'm just sorta trying things out - and I'm learning a lot
Ok, we thought maybe you had entirely ignored him and weren't sure if anything would pop up for you.
Ah no - I went offline after that
But each time I was tagged it sends me a notif, so I saw the chat log :)
Trying things out is the best way to learn things. "The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
18:40
It's my birthday in around 10 days and I bought a book on C and C++ - super excited to learn a lower level language.
Yeah that's a true quote
Same thing goes in CS ... if you stick to what you know, you're not learning.
So kudos to you.
Yeah :)
Thank you
Is there a C chat room here? I found a C++ but no C
Oh right.. cheers. Sorry.
No worries. It's hard to find - if you search for "C" you get every room that has a 'c' anywhere in its title, including this one!
18:44
Yep I know haha, that's why I couldn't figure it out
Ok, turns out you can search rooms by tag, so if you search for [c] you'll get it.
Oh okay, thanks for that
I'm new to the chat room
user6857832
19:09
Hey @MadaraUchiha
user6857832
I have one last question lol
user6857832
I tried with triangle.get(i).indexOf(max) and it is working. I was doing something wrong earlier, but there is just one problem now. If there is same value like:
triangle.add(Arrays.asList(91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48));
91 in here and it was comparing the max of two in between 91 and 43 (index 6 and 7), So I want it to return index 6 instead of 0. Is there any way I can do that?
Here is my updated code: https://hastebin.com/ezakatulum.cs
user6857832
Please run my code first.
19:28
c/p from java and android era channel :

"
Hello, I am working on a view that extends from IconView(javax.swing.text). This view will be contained inside a JtextPane. The issue I am facing is setting the icon in default constructor. I use StyleConstants.setIcon to set the icon, but the default constructor of IconView retrieves the icon from element.getAttributes().
How do I set the icon to the element attributes?"
user6857832
20:13
Here is my code: https://hastebin.com/mozunisobu.cs
It gives the output 1064, but the answer is 1074. Even though I calculated myself without coding, I am still getting 1064. Can anyone tell me why is it so?
20:59
maybe your code is wrong
if only the difference between the output and answer was 15 and not 10, you could guess it was an off by one error
off by one by every floor = off by 15
21:20
"Every great developer you know got there by solving problems they were unqualified to solve until they actually did it." - Patrick McKenzie
9
01:00 - 17:0017:00 - 22:00

« first day (2314 days earlier)      last day (2851 days later) »