|
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. |
On February 10 2014 15:56 dapierow wrote:Show nested quote +On February 10 2014 15:46 Creepseep wrote:On February 10 2014 15:18 dapierow wrote: Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?
...
The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS... Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case. 2 hours of headache... because of that shit... are you fucking kidding me... that'll teach me to write more than one class without testing it... Thanks a bunch, ima go cry now for all that wasted time.
Welcome to programming :D
|
On February 10 2014 15:56 dapierow wrote:Show nested quote +On February 10 2014 15:46 Creepseep wrote:On February 10 2014 15:18 dapierow wrote: Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?
...
The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS... Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case. 2 hours of headache... because of that shit... are you fucking kidding me... that'll teach me to write more than one class without testing it... Thanks a bunch, ima go cry now for all that wasted time.
Another thing that seems strange to me, is why are you setting up suits as ints only to transform them into strings later on?
|
On February 10 2014 17:34 Manit0u wrote:Show nested quote +On February 10 2014 15:56 dapierow wrote:On February 10 2014 15:46 Creepseep wrote:On February 10 2014 15:18 dapierow wrote: Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?
...
The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS... Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case. 2 hours of headache... because of that shit... are you fucking kidding me... that'll teach me to write more than one class without testing it... Thanks a bunch, ima go cry now for all that wasted time. Another thing that seems strange to me, is why are you setting up suits as ints only to transform them into strings later on? Because I need the int of the suit rank in case there is a draw between the values of the cards
|
On February 10 2014 19:08 dapierow wrote:Show nested quote +On February 10 2014 17:34 Manit0u wrote:On February 10 2014 15:56 dapierow wrote:On February 10 2014 15:46 Creepseep wrote:On February 10 2014 15:18 dapierow wrote: Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?
...
The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS... Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case. 2 hours of headache... because of that shit... are you fucking kidding me... that'll teach me to write more than one class without testing it... Thanks a bunch, ima go cry now for all that wasted time. Another thing that seems strange to me, is why are you setting up suits as ints only to transform them into strings later on? Because I need the int of the suit rank in case there is a draw between the values of the cards
Should just set them up as ENUMs then. Store them as strings and ints.
|
I need to automate the execution of a javascript file in Firefox imacro extension.
I'm starting Firefox and a the javascript imacro file using a batch/CMD file. I'm running the CMD file using Windows Task Scheduler.
Do you think using Windows Task Scheduler is the best way to automatically launch this every day?
I think the alternative would be to have the javascript running with a 24 hour timer or something?
Thankyou
|
On February 10 2014 19:49 FFGenerations wrote:I need to automate the execution of a javascript file in Firefox imacro extension. I'm starting Firefox and a the javascript imacro file using a batch/CMD file. I'm running the CMD file using Windows Task Scheduler. Do you think using Windows Task Scheduler is the best way to automatically launch this every day? I think the alternative would be to have the javascript running with a 24 hour timer or something? Thankyou  Any reason why you feel you shouldn't use the Task scheduler? I mean, it's used in professional settings, I can't think of a reason why you wouldn't want to use it.
|
On February 10 2014 20:06 Tobberoth wrote:Show nested quote +On February 10 2014 19:49 FFGenerations wrote:I need to automate the execution of a javascript file in Firefox imacro extension. I'm starting Firefox and a the javascript imacro file using a batch/CMD file. I'm running the CMD file using Windows Task Scheduler. Do you think using Windows Task Scheduler is the best way to automatically launch this every day? I think the alternative would be to have the javascript running with a 24 hour timer or something? Thankyou  Any reason why you feel you shouldn't use the Task scheduler? I mean, it's used in professional settings, I can't think of a reason why you wouldn't want to use it.
http://wiki.imacros.net/iimPlay
The version of iimPlay provided with the iMacros Enterprise Edition supports the playback of Javascript (.js) scripts in iMacros for Firefox. For example: ret = iim1.iimOpen("-fx") ret = iim1.iimPlay("MyScript.js")
|
On February 10 2014 20:06 Tobberoth wrote:Show nested quote +On February 10 2014 19:49 FFGenerations wrote:I need to automate the execution of a javascript file in Firefox imacro extension. I'm starting Firefox and a the javascript imacro file using a batch/CMD file. I'm running the CMD file using Windows Task Scheduler. Do you think using Windows Task Scheduler is the best way to automatically launch this every day? I think the alternative would be to have the javascript running with a 24 hour timer or something? Thankyou  Any reason why you feel you shouldn't use the Task scheduler? I mean, it's used in professional settings, I can't think of a reason why you wouldn't want to use it.
No reason but, being a nub, I need to check I'm not missing something! Thankyou :D
|
On February 10 2014 09:55 darkness wrote: How do you guys make a deep copy of an object in Java? I've done a bit of Google, and I've learnt that object.clone() is bad unless you just clone a primitive data type (Effective Java book as an argument). I've read about 2 other solutions - copy constructor and serialisation. Which one do you prefer and why? I feel like the copy constructor approach has so much code duplication (well, attributes are redefined) if I've understood the knack of it.
In case anyone is curious, I've found out some Java deep cloner library. Its link is: http://code.google.com/p/cloning/ I have to test it a little bit more to confirm if it works well, but from the quick run I've had, it does ok. I've noticed even StackOverflow users mention it.
Edit: I've noticed the cloner library depends on Objenesis (link). Is anyone familiar with it? Does it just bypass constructors and modify final variables?
|
On February 10 2014 17:28 sluggaslamoo wrote:Show nested quote +On February 10 2014 15:56 dapierow wrote:On February 10 2014 15:46 Creepseep wrote:On February 10 2014 15:18 dapierow wrote: Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?
...
The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS... Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case. 2 hours of headache... because of that shit... are you fucking kidding me... that'll teach me to write more than one class without testing it... Thanks a bunch, ima go cry now for all that wasted time. Welcome to programming :D
Haha, I know how that feels. Just recently changed one header file in one of my projects, it was just a formatting change, no biggie. Suddenly, everything stops working and starts complaining. I revert the changes and everything is back to normal except for one class that keeps complaining (and it wasn't doing that before the changes).
|
On February 11 2014 01:53 Manit0u wrote:Show nested quote +On February 10 2014 17:28 sluggaslamoo wrote:On February 10 2014 15:56 dapierow wrote:On February 10 2014 15:46 Creepseep wrote:On February 10 2014 15:18 dapierow wrote: Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?
...
The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS... Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case. 2 hours of headache... because of that shit... are you fucking kidding me... that'll teach me to write more than one class without testing it... Thanks a bunch, ima go cry now for all that wasted time. Welcome to programming :D Haha, I know how that feels. Just recently changed one header file in one of my projects, it was just a formatting change, no biggie. Suddenly, everything stops working and starts complaining. I revert the changes and everything is back to normal except for one class that keeps complaining (and it wasn't doing that before the changes). Oh my God, I fucking hate this lol... I spent upwards of three hours diffing my git logs down to every last fucking line over like three days of changes trying to find the one that had broken my game engine's FPS so horribly (made changes to unrelated part of the code, rebuild, FPS GOES TO SHIT OMG) and then I restarted my computer and everything was back to normal... why did I not think of that before I was at the point of almost breaking like twenty hours of work rofl.
|
|
|
debugging sucks, testing rocks
debugging tests sucks rocks
|
There's a revolution coming to schools across England, one designed to transform a new generation's prospects in the digital age. Come September, a change to the curriculum means the study of computing - and specifically coding - will be mandatory across all state primary and secondary schools. source
i dunno about this.
|
it's good to know a little bit of programming. I think it's a good idea.
|
On February 11 2014 14:34 nunez wrote:Show nested quote +There's a revolution coming to schools across England, one designed to transform a new generation's prospects in the digital age. Come September, a change to the curriculum means the study of computing - and specifically coding - will be mandatory across all state primary and secondary schools. sourcei dunno about this. It's an amazing idea. First of all, computers are a massive aspect of life today, it makes sense that everyone should, to some extent, be able to tell them what to do . Another reason is the fact that programming is amazing for problem solving skills, it requires a ton of logical and abstract thinking. A third reason is the fact that most people who aren't computer nerds have no idea how programming and IT actually works, which is sad since they might enjoy it and could have made a career out of it. IT is a huge area of work these days, we need every young person to know what it's about in case they want to work in it.
It actually blows my mind that programming isn't mandatory everywhere by now. If nothing else, it should be included in math education since not only is it a really good way to train math, programming in stuff like Mathlab is actually very relevant to the field.
|
On February 10 2014 23:45 darkness wrote:Show nested quote +On February 10 2014 09:55 darkness wrote: How do you guys make a deep copy of an object in Java? I've done a bit of Google, and I've learnt that object.clone() is bad unless you just clone a primitive data type (Effective Java book as an argument). I've read about 2 other solutions - copy constructor and serialisation. Which one do you prefer and why? I feel like the copy constructor approach has so much code duplication (well, attributes are redefined) if I've understood the knack of it. In case anyone is curious, I've found out some Java deep cloner library. Its link is: http://code.google.com/p/cloning/I have to test it a little bit more to confirm if it works well, but from the quick run I've had, it does ok. I've noticed even StackOverflow users mention it. Edit: I've noticed the cloner library depends on Objenesis ( link). Is anyone familiar with it? Does it just bypass constructors and modify final variables?
The Objenesis doc says "allowing to create instance without any constructor being called...." but looking at the actual source code, it seems to go to Constructor.newInstance (http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html#newInstance(java.lang.Object...)) which returns "a new object created by calling the constructor this object represents" so I'm a bit confused?
|
I'm iffy about including programming as a mandatory subject. Most people will never have a reason to code a single line in their entire life. There are more important skills to "everyday life" that we don't teach in school, such as driving a car.
On the other hand, there already are a number of technical subjects in school curricula that are equally useless. Chemistry is a big one, which I think should be ditched immediately.
|
On February 11 2014 17:24 gedatsu wrote: I'm iffy about including programming as a mandatory subject. Most people will never have a reason to code a single line in their entire life. There are more important skills to "everyday life" that we don't teach in school, such as driving a car.
On the other hand, there already are a number of technical subjects in school curricula that are equally useless. Chemistry is a big one, which I think should be ditched immediately.
Some basic chemistry is actually pretty useful (how to counter acids for example, what substances produce toxic fumes when burned etc.).
I don't know about mandatory programming either. I had that (it was ages ago though) and because no self-respecting, good programmer is going to want to work with kids we got this clueless guy who was forcing Turbo Pascal down our throats. It sucked, we hated it, and just spent entire classes playing MUDs with friends.
|
On February 11 2014 18:16 Manit0u wrote:Show nested quote +On February 11 2014 17:24 gedatsu wrote: I'm iffy about including programming as a mandatory subject. Most people will never have a reason to code a single line in their entire life. There are more important skills to "everyday life" that we don't teach in school, such as driving a car.
On the other hand, there already are a number of technical subjects in school curricula that are equally useless. Chemistry is a big one, which I think should be ditched immediately. Some basic chemistry is actually pretty useful (how to counter acids for example, what substances produce toxic fumes when burned etc.). Yeah science, bitch!
honestly, i hate chemistry. bonds, significant figures, elements and stuff
|
|
|
|
|
|