How do mods get picked anyway? I swear I never recognise any of the newly appointed.
speaking of our friends in the North, I got perhaps the greatest voice message ever the other day from our friend Kent. I must have listened to it ten times or more. I love you Kent. No homo.
What's the point in all these lovely amazing drugs we have when there's nothing that seems to be able to shift this fucking headache!!!
public static void q07(ArrayList<NSS> all){
//Show the name of the institution with UKPRN 10007759
//List every subject for this institution
ArrayList subjectList = new ArrayList();
for (NSS nss:all)
if (nss.UKPRN.equals("10007759")){
subjectList.add(nss.subject);
}
for (int i = 0; i < subjectList.size(); i++){
if (subjectList.get(i).equals(subjectList.get(i+1))){
}
else
System.out.println(subjectList.get(i));
}
}
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 248, Size: 248
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at NSSSample.q07(NSSSample.java:129)
at NSSSample.main(NSSSample.java:26)
Can some Java god help me?
I've got this code for Uni:
Code:public static void q07(ArrayList<NSS> all){ //Show the name of the institution with UKPRN 10007759 //List every subject for this institution ArrayList subjectList = new ArrayList(); for (NSS nss:all) if (nss.UKPRN.equals("10007759")){ subjectList.add(nss.subject); } for (int i = 0; i < subjectList.size(); i++){ if (subjectList.get(i).equals(subjectList.get(i+1))){ } else System.out.println(subjectList.get(i)); } }
It works as it should - I get the output that I was expecting. However at the end Eclipse displays this:
Code:Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 248, Size: 248 at java.util.ArrayList.RangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at NSSSample.q07(NSSSample.java:129) at NSSSample.main(NSSSample.java:26)
Anyone tell me what the problem is?
if (i != subjectList.getSize() - 1) {
if (subjectList.get(i).equals(subjectList.get(i+1))){
}
}
Musha why do you do thisArgo was indeed most excellent. If it wasn't for Twilight it would be my film of the year.
Either been utterly stupid or utterly brilliant posting here. Retreating to BritGAF to lick in advance any wounds I may eventually possess.
I would assume to to be something to do with:
if (subjectList.get(i).equals(subjectList.get(i+1))
As though i < subjecList.size() will prevent it from ticking over, if i is at the last one and it tries to grab i+1 you're gonna get an out of bounds error.
EDIT: yeah looking at it, that will be the case every time, gets to the end and tries to grab one past the end due to i + 1, throw in a check for that, so say
Code:if (i != subjectList.getSize() - 1) { if (subjectList.get(i).equals(subjectList.get(i+1))){ } }
or something similar
I would weigh in but my analysis would be based solely on Risk mechanics which have little to no base in real statistics so I'll just observe ;pI was reading that which is easier to invade thread involving the US and Russia and it got me to thinking, how easy would the UK be to invade (sans nukes) and how long would it take if one of the superpowers made it their mission? I remember in History our unique position and navy made us quite impenetrable during ww2, alot has changed since but our Navy is still pretty awesome and we are an Island. Anyone have any info on this?
I would weigh in but my analysis would be based solely on Risk mechanics which have little to no base in real statistics so I'll just observe ;p
Worked a charm, I owe you a pint!
Wow, nice one Cindres! I knew it had something to do that if statement but that error message brought back horrid memories of Java. Really need to get back into proper programming.
I was reading that which is easier to invade thread involving the US and Russia and it got me to thinking, how easy would the UK be to invade (sans nukes) and how long would it take if one of the superpowers made it their mission? I remember in History our unique position and navy made us quite impenetrable during ww2, alot has changed since but our Navy is still pretty awesome and we are an Island. Anyone have any info on this?
I was reading that which is easier to invade thread involving the US and Russia and it got me to thinking, how easy would the UK be to invade (sans nukes) and how long would it take if one of the superpowers made it their mission? I remember in History our unique position and navy made us quite impenetrable during ww2, alot has changed since but our Navy is still pretty awesome and we are an Island. Anyone have any info on this?
Do it sir, get yourself back into programming!
you know what? I think I will. Perhaps my attitude towards programming will change if I took a different approach and do it as a hobby/for fun.
My current job deals more with the software development lifecycle management (analysis, design, flowcharts, writing psuedocode, testing) rather than actual code development (that gets outsourced) so brushing up on my programming in my spare time will definitely prevent me from not losing a valuable skill. Cindres, do you recommend any books that discusses more of the data structure, algorithm, logical problem solving side to programming instead of the "hello world, how to" basic guides?
Any of London-GAF going to tonight's Lawrence of Arabia showing at the BFI Southbank?
Any of London-GAF going to tonight's Lawrence of Arabia showing at the BFI Southbank?
What's everyone else's weekend plans?
What's everyone else's weekend plans?
Lots of UKGAF talk going over my head lately. Phisheep contemplating the universe, everyone else discussing coding. Somebody appreciating Twilight?!
What happened to the dick jokes and toilet punching? Where are Dave and Kentpaul?!
Tonight: Pub, followed by catching up on Far Cry 3 (I played for about 4 or 5 hours last night, but now my save is gone )
Tomorrow: more Far Cry 3 until I hop on the train for the meet-up (what whhaaaaaat)
Sunday: Hangover. Supplemented by plenty of Far Cry 3.
...Far Cry 3 is pretty good, you guys.
Sports of choice (and if you'd like to alienate yourself you can provide the team you support as well): Running up to Rangers and Celtic fans and saything they're as rubbish as each other and then running away.
We all know about it, but it's not an actual holiday or anything. I think the First Minister might give a speech?
Giving farcry 3 a miss. The last thing i want is to play another generic open world first person shooter.
Been playing Forza 4 recently.. So fucking good man, If you looe control of the car you see the backend just swinging left and right then a spin..
Always great trying to drift with shitty 1.4 cars
Open world FPS games are quite rare though, aren't they? I dig the idea of Far Cry 2 but it was a bit too punishing and weird. I really just want a big wide area of jungle where I can murder people. I want to ride a boat down a shady river. I want to hear crickets. I want to start terrible fires. I want to kill all the animals.
Good choice with Forza 4, KP. Game's shit hot.
Goddamn it, now I want to play FC3. I'm only buying Vita games for the forseeable future though.
Except for the fact that it's your National holiday? And isn't it a bank holiday as well?
It's just that I don't really find myself sitting down in front of the PC or my consoles all that much at the moment. The Vita, on the other hand, fits into my life much better. It's the hardware I'm using the most so it's the hardware I want more software for. I've picked up 4 or 5 360 games and a shit-ton of PS3 games lately (mostly PS+ stuff) but haven't actually had a chance to do more than dip into 'em.That's... an odd choice. Are you trying to justify a purchase to yourself or to someone else?
Can you play ps3 games on Vita via remote play?
I know it's odd but I don't really count iOS gaming when I'm thinking about buying games. I just take it for granted that I'll buy whatever I fancy because they're so cheap. Recently, that'd be Jet Set Radio, The Walking Dead, SF Vs. Tekken and Magic Orbz. I'm planning on starting The Walking Dead tonight.smokey has given up ios gaming
thats a bigger story than the pedo-ring in the uk.