This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
hi there, i know this is cheecky and probably wrong but i really need help, i am in an assinment now and i have 30 minutes to do it in and i don't have a clue, here is the codes, all we have tyo do is fill out the codes, so can someone please help me: import java.applet.Applet; import java.awt.*; import java.awt.event.*;
Looks like your 30 minutes are up. People here don't just do homework for others. We will help you learn, but not do it for you.
John Amiereie
Greenhorn
Joined: Apr 27, 2005
Posts: 4
posted
0
thank you and i will try to do something with it, but i REALLY NEED THE CODES< PLEASE HELP OUT THERE < PLEEEEEEAAAAAASEEEEEEEEEE
COME ON GUYS, I KNOW I WILL HELP SOMEONE IF THEY WANTED IT URGENTLEY. [ April 27, 2005: Message edited by: John Amiereie ]
John Amiereie
Greenhorn
Joined: Apr 27, 2005
Posts: 4
posted
0
Oh well, exam is finished, but thank the first person that replied; I owe them; if I wasn't polite , but thank you . PEACE [ April 27, 2005: Message edited by: Mark Spritzler ]
John, <rant> How dare you post asking people to do your work for you and get mad when they don't do it! If this was an exam that makes it even worse! Why is it our responsiblity to make sure your work is done? Last time I checked you didn't pay my salary. The people here are volunteers, here to help. Doing your work for you does not help you. Doing your work for you means you don't learn, but you pass. You get your degree and get into the workplace and then those of us who did do the work have to babysit you and hold your hand through basic coding. I just hope you end up reading this post! </rant>
Hentay Duke
Ranch Hand
Joined: Oct 27, 2004
Posts: 198
posted
0
I would guess he'll never see the reply and furthermore I'm guessing we'll never have to worry about him in the workplace. If he couldn't manage to figure out what goes on in the constructor, he's not going to go too far into programming.
I would agree that we probably won't see this person anytime soon in the workplace. We don't want folks like this at JR anyway. Hentay, LOL on the "tick tick tick." I imagined Hannibal Lechter saying that!
James Carman, President<br />Carman Consulting, Inc.
We should have just written a completely unrelated program using the same overriden Applet methods, like putting Threads to sleep, or calling the garbage collector
Hentay Duke
Ranch Hand
Joined: Oct 27, 2004
Posts: 198
posted
0
We should have a stock program that prints out something like "I cheated and got this code from JavaRanch, and really have no chance of ever becoming a programmer."
I doubt most of the people like him would even bother to check the code, but it would be funny when the prof looked at it.
Ok, so it's easy enough to make code that would be hard for the noob to decipher. But how do we A) get it past the noob so that he leaves it in and B) make sure that the professor sees it?
Perhpas we try to get the noob to say when the assignment is due and then have the cheat code kick in iff the current date is past the due date. If I were cheating by getting my assignements done by others, I know I would at least try the program once or twice. And I would certainly look into any method named cheat() in the plagiarized code.
Also, we need some comments to give a reason for the extra obfuscated code. How about...
Maybe we can have this method set a few static fields. Maybe include some calls that do at least get the JRE or JVM version or OS (and then ignore them).
Ryan
Hentay Duke
Ranch Hand
Joined: Oct 27, 2004
Posts: 198
posted
0
I think all we need to do is not call the method cheat. If the person takes the time to look at the code and figure out that it's not correct fine, at least they're putting some effort into it. It's the person that is just going to copy and paste the code in without even checking it that really deserves this.
Steven Bell
Ranch Hand
Joined: Dec 29, 2004
Posts: 1071
posted
0
Do something like this for the above example:
[ April 28, 2005: Message edited by: Steven Bell ]
*roflmao* This is awesome. We should save this thread for future use and hand it out to anyone looking for a free ride. Good job guys! And thanks for the laughs.
Maybe we should write a little program that writes an obfuscated program (or a method) which prints out a given string, so that we can customize it to the situation (maybe include the person's name).
Steven Bell
Ranch Hand
Joined: Dec 29, 2004
Posts: 1071
posted
0
I thought of writing a method that would convert it's own source file into all unicode escape characters, still allowing it to run and compile, but making it impossible to work with. I think it might take to much code to really work though.
[ April 28, 2005: Message edited by: Ben Souther ] [ April 28, 2005: Message edited by: Ben Souther ]
K Riaz
Ranch Hand
Joined: Jan 08, 2005
Posts: 375
posted
0
The date method would be the best way. Get the "student" to tell us the final due in date for the assignment, and then the method should fire off the message on or after the date.
On the actual due in date, the message should fire off after about 30-60 seconds in a separate thread, so the professor and student can get a real "feel" of the working program, although I admit that this is solely to get a kodak moment (wouldn't you just love to see the look of the students face when it suddenly scares the hell out of him/her?).
Disguise it as some sort of helper method in a utility class with lots of business logic (e.g. mixed up with some JDBC code if doing database I/O). Some spagetti programming where its all mixed up should do it to avoid a suspecting student from tinkering with it (and then breaking it). Tell them its a good way to use encapsulation!
The best assignment would probably be a client/server socket program. You could have a client connect to the server as usual, and in return, the server will deliver our special message for the recipient! Acually, wouldn't it be funny if it connected to another special server on the internet to get the message so we can all laugh when we know a client connected and got the message?!! How about starting an eBay-type counter?
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Steven Bell
Ranch Hand
Joined: Dec 29, 2004
Posts: 1071
posted
0
If we went as far as hitting a server for the string we could pass the id string to the thread in the forum. Letting us know which thread it was that took the code. Or even be more evil and use Runtime.getRuntime().exec("place URL to thread here"); so the prof gets to see the thread too.
Love the unicode conversion. Just need to find a way to get the source file of the current running class. That was where I got stuck.
[Edit:]Hmmm, could we edit that unicode post, it's making everthing scroll in a pretty bad way. [ April 28, 2005: Message edited by: Steven Bell ]
Joel McNary
Bartender
Joined: Aug 20, 2001
Posts: 1815
posted
0
Originally posted by Steven Bell:
Love the unicode conversion. Just need to find a way to get the source file of the current running class. That was where I got stuck.
You could do:
and then use that to do the conversion, but that assumes that the .java is in the runtime CLASSPATH (not always the case, especially in productions systems...)
Steven Bell
Ranch Hand
Joined: Dec 29, 2004
Posts: 1071
posted
0
I tried that, but .java and .class files aren't in the same directory so it didn't work.
The only thing I could think of that would always work was doing a full file scan.
Hmmm. Converting all .java files into unicode escapes would probably be going to far. Not to mention hard to test.
K Riaz
Ranch Hand
Joined: Jan 08, 2005
Posts: 375
posted
0
We should submit a proposal to SourceForge and get an open-source project going. We need a CVS repository so everyone can contribute and ship v1.0 some time next week
James Carman
Ranch Hand
Joined: Feb 20, 2001
Posts: 580
posted
0
I swear some of you folks must be related to me. You are truly evil!
For the date thing, you could just make it trigger after one day. Most noobs will only run the program once or twice (if at all!) to see that it 'works' and then hand it in.
Joel McNary
Bartender
Joined: Aug 20, 2001
Posts: 1815
posted
0
I was thinking that you could write the code as normal, but add a "test" method along the lines of:
You then encode what's at the data: label in unicode, and explain that test cases like this date back to BASIC days, when you would separate your data and the method.
James Carman
Ranch Hand
Joined: Feb 20, 2001
Posts: 580
posted
0
How's this for obfuscation...
Here's what I did. I created a class called Messages (no package). In it, I declared a public static final String field called MESSAGE with the value "I cheated on this homework assignment. I asked people from JavaRanch to do my work for me!" Then, I ran a little utility using the byteCodeAsString() method, to print out the actual bytecode of the Messages class. Then, I copy and pasted the bytecode of the Messages class into the CONST field of the Evil class. I use the "EvilClassLoader" to define the Messages class at runtime using its bytecode. Then, I use reflection to get the value of the MESSAGE field. How evil is that? I don't think a newbie could figure that out. [ April 29, 2005: Message edited by: James Carman ]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.