|
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 January 18 2014 22:32 TheSwedishFan wrote: A easy one. What does [1,n] mean? I've studied database modeling before and there were something similar called a "one-to-many" relationship between entities. Translating that to a programming language would suggest an array. However, i get the sense that it means a range where 1 is the smallest value and "n" the biggest. So does it mean range or array? Or something else? In Algorithms let's say an Array[1...N] would present an array of N elements called Array.
In Databases if you're studying the relations between entities, it represents cardinality number in a relation, for example of a 1 to N cardinality relation, let's say one doctor can have N patients.
Maybe it's something third but I cannot think of anything else right now.
|
i really think it depends on where you are using it. [1,n] might also mean from 2 to n-1 (excluding 1 and n). I'm not sure im too lazy to confirm
|
On January 18 2014 22:54 icystorage wrote:i really think it depends on where you are using it. [1,n] might also mean from 2 to n-1 (excluding 1 and n). I'm not sure im too lazy to confirm 
In maths it means the interval from 1 to n (inclusive), while ]1,n[ means from 2 to n-1 when talking about integers. https://en.wikipedia.org/wiki/Bracket_(mathematics)#Intervals
|
In some languages, I think python being one of them, it also means "Array/string slice from index 1 to n".
I think in this context it means the 1 to n relation in databases though.
|
Hey, so I've been playing with something last night that I think maybe a couple of people here would be interested in.
https://microcorruption.com/
What is it?
Your target is a small embedded device; a microcontroller running compiled C code.
You get access to the device, disassembly of its code, and a low-level debugger and assembler. We "run" the devices, you interact with them via a vanilla web interface.
At each level, you'll get a simple input that, owing to some C software bug, can be used to own the target. You'll use the debugger to reverse the target, find the input, and then deliver it to a "production" instance to beat the level.
You'll face a series of revisions of the target, starting from "comically broken" and proceeding vendor-fix by vendor-fix through basic memory corruption, stack overflows, randomization, memory protection schemes, allocator vulnerabilities, and DRM-style software protection.
All this happens on an architecture you've probably used, but likely never have written any code for. Have you ever reverse-engineered a program from its assembly code to understand what it's doing? That'll happen too.
We're keeping a leaderboard, by completion time, CPU cycles, and input size. Part of the fun of a challenge like this is to see how others are doing in real-time.
If you've done a lot of exploit development, you won't have much trouble. But we hope the real fun is reserved for the people who haven't: you'll get to play with concepts that, in the real world, involve tedious toolchain installs and comprehensive knowledge of the memory layouts of gigantic browser library codebases. You won't need any of that here: we're looking forward to seeing people who have never written a line of assembly beating people who've been doing this for years.
It's been pretty fun so far, I've beaten the first 3 levels. You don't need any experience with exploit development, and knowing assembly helps, but it's pretty easy to pick up. They have a little manual attached for it:
https://microcorruption.com/manual.pdf
|
On January 18 2014 14:24 Warri wrote:Show nested quote +On January 18 2014 13:18 TimKim0713 wrote: Hello, I'm fairly new to Java, and I have been stuck understanding somewhat of concepts.
So, the main (problem) concept is about using methods/constructors/variables from different class to another... For Example, (https://docs.google.com/file/d/0B17THXdfP8JwLTBIMUdWQkszWmM/edit)
There are 3 classes and under ClassRoom class, it has " Arraylist<Student> roster ".
Does the Arraylist roster have all the methods under Student Class? Meaning it can do - roster.getID(); and roster.getRoom(); ? If not, how does the arraylist roster have access methods or do something from Student? Methods under Student Class are used by whom? (how?)
OR am I totally off?
Can someone please explain what uses what methods and etc under which class?
Gahh.... Confusing!
Thanks. I appreciate it.
You need to understand that java is mostly about references to objects. The ArrayList is an object itself and contains references (the location where the objects are stored in the memory) to other objects, in this case from the student class. So if you already have the references stored in the arraylist, the objects are already created. To access them you can define a new reference to the object in question. For example Student s = roster.get(0); No new object is created here, the only thing that happens is that s is now a reference to the object that is also referenced in the ArrayList (which it still does after this call). Now you can work with that objects methods by using s.getID(); Or, you could have done it directly with roster.get(0).getID(); Student s = new Student(); this on the other hand, would create a new object of the student class which gets referenced by s.
Thanks for your help! Does this mean that In the Arraylist of roster, Students are in there?
like for(int x=0; x<roster.size(); x++ { roster.get(x); }
would this go throguh all the students since that "roster" arraylist is made of Students?
(roster.get(0) would be a student ?)
Thanks :D I guess in ArrayList<**THISTHING**> name, "<**THISTHING**> would be the type of stuff in the arraylist then...
Did I understand correctly?
|
On January 19 2014 00:00 Morfildur wrote: In some languages, I think python being one of them, it also means "Array/string slice from index 1 to n".
I think in this context it means the 1 to n relation in databases though.
No, [1:n] is what you're thinking of. Also, in python [1, n] is the same as [(1, n)] so it tries to grab element at index (1, n) which doesn't exist for lists.
|
On January 19 2014 04:09 TimKim0713 wrote:Show nested quote +On January 18 2014 14:24 Warri wrote:On January 18 2014 13:18 TimKim0713 wrote: Hello, I'm fairly new to Java, and I have been stuck understanding somewhat of concepts.
So, the main (problem) concept is about using methods/constructors/variables from different class to another... For Example, (https://docs.google.com/file/d/0B17THXdfP8JwLTBIMUdWQkszWmM/edit)
There are 3 classes and under ClassRoom class, it has " Arraylist<Student> roster ".
Does the Arraylist roster have all the methods under Student Class? Meaning it can do - roster.getID(); and roster.getRoom(); ? If not, how does the arraylist roster have access methods or do something from Student? Methods under Student Class are used by whom? (how?)
OR am I totally off?
Can someone please explain what uses what methods and etc under which class?
Gahh.... Confusing!
Thanks. I appreciate it.
You need to understand that java is mostly about references to objects. The ArrayList is an object itself and contains references (the location where the objects are stored in the memory) to other objects, in this case from the student class. So if you already have the references stored in the arraylist, the objects are already created. To access them you can define a new reference to the object in question. For example Student s = roster.get(0); No new object is created here, the only thing that happens is that s is now a reference to the object that is also referenced in the ArrayList (which it still does after this call). Now you can work with that objects methods by using s.getID(); Or, you could have done it directly with roster.get(0).getID(); Student s = new Student(); this on the other hand, would create a new object of the student class which gets referenced by s. Thanks for your help! Does this mean that In the Arraylist of roster, Students are in there? like for(int x=0; x<roster.size(); x++  { roster.get(x); } would this go throguh all the students since that "roster" arraylist is made of Students? (roster.get(0) would be a student ?) Thanks :D I guess in ArrayList<**THISTHING**> name, "<**THISTHING**> would be the type of stuff in the arraylist then... Did I understand correctly?
Yes, you should get all students from that loop. However, I personally prefer, maybe others too, enumeration like this:
Syntax: Object type | variable | the container (collection) variable
for (Student s : roster) { s.method(); // method implemented by the Student class }
Alternatively, you may still use your initial loop approach like this. It is similar to the above code:
for (int x=0; x<roster.size(); x++) { roster.get(x).method(); // method implemented by the Student class }
And to your second question, yes, you need to specify the type of object when you use a container (ArrayList, Vector, Stack, Map, Set, HashSet, etc).
So in this case: ArrayList<Student> roster = new ArrayList<Student>();
|
On January 19 2014 02:44 Mr. Wiggles wrote:Hey, so I've been playing with something last night that I think maybe a couple of people here would be interested in. https://microcorruption.com/Show nested quote +What is it?
Your target is a small embedded device; a microcontroller running compiled C code.
You get access to the device, disassembly of its code, and a low-level debugger and assembler. We "run" the devices, you interact with them via a vanilla web interface.
At each level, you'll get a simple input that, owing to some C software bug, can be used to own the target. You'll use the debugger to reverse the target, find the input, and then deliver it to a "production" instance to beat the level.
You'll face a series of revisions of the target, starting from "comically broken" and proceeding vendor-fix by vendor-fix through basic memory corruption, stack overflows, randomization, memory protection schemes, allocator vulnerabilities, and DRM-style software protection.
All this happens on an architecture you've probably used, but likely never have written any code for. Have you ever reverse-engineered a program from its assembly code to understand what it's doing? That'll happen too.
We're keeping a leaderboard, by completion time, CPU cycles, and input size. Part of the fun of a challenge like this is to see how others are doing in real-time.
If you've done a lot of exploit development, you won't have much trouble. But we hope the real fun is reserved for the people who haven't: you'll get to play with concepts that, in the real world, involve tedious toolchain installs and comprehensive knowledge of the memory layouts of gigantic browser library codebases. You won't need any of that here: we're looking forward to seeing people who have never written a line of assembly beating people who've been doing this for years.
It's been pretty fun so far, I've beaten the first 3 levels. You don't need any experience with exploit development, and knowing assembly helps, but it's pretty easy to pick up. They have a little manual attached for it: https://microcorruption.com/manual.pdf
Pretty fucking cool, especially considering I'm taking an assembly course in school right meow ^^ thanks for sharing!
|
On January 19 2014 05:19 Prillan wrote:Show nested quote +On January 19 2014 00:00 Morfildur wrote: In some languages, I think python being one of them, it also means "Array/string slice from index 1 to n".
I think in this context it means the 1 to n relation in databases though. No, [1:n] is what you're thinking of. Also, in python [1, n] is the same as [(1, n)] so it tries to grab element at index (1, n) which doesn't exist for lists. It's..a bit more similar to Ruby? str[s,n] returns a string of n letters starting at index s.
e.g.
$ irb > str = "abcde" > str[2,2] #=> "cd"
He definitely meant databases though, 1 to many relation.
|
i need to compile this java program with ant. it's not finding the class in the external jar: "Exception in thread "main" java.lang.NoClassDefFoundError: org/jsoup/Jsoup" it compiles correctly, but i'm getting this error after go into the build directory and try to run the program (java prog ...) the code works if I manually compile it w/o ant.
EDIT: nevermind, i figured it out. i feel so silly...
directory structure
project /src /lib (external jar here) /build build.xml
here's the build.xml:
<project name="Project1" default="compile" basedir="."> <description> Project1 </description> <property name="src" location="src"/> <property name="lib" location="lib"/> <property name="build" location="build"/>
<path id="classpath"> <fileset dir="${lib}" includes="**/*.jar"/> </path>
<target name="init"> <tstamp/> <mkdir dir="${build}"/> </target> <target name="compile" depends="init" description="compile the source " > <javac srcdir="${src}" destdir="${build}" classpathref="classpath"/> </target>
<target name="clean" description="clean up" > <delete dir="${build}"/> </target> </project>
|
|
|
1-3 lines functional/declarative, 3-5 lines imperative 
Its "throwaway code" though, so I don't really count that. My code is pretty bad when I'm casually testing stuff on a single file, then when I realise there's some merit to it I will refactor the whole thing.
I would only care if it was a longer term project that requires maintenance. Although I certainly would not like to work on that particular code.
|
On January 19 2014 11:33 darkness wrote: Edit: Why does his .h (header) file provide actual implementation? So in a lot of style guides you are allowed to inline some small stuff into the header file. Not the way he's doing it, but certain things are ok.
|
On January 19 2014 02:44 Mr. Wiggles wrote:Hey, so I've been playing with something last night that I think maybe a couple of people here would be interested in. https://microcorruption.com/Show nested quote +What is it?
Your target is a small embedded device; a microcontroller running compiled C code.
You get access to the device, disassembly of its code, and a low-level debugger and assembler. We "run" the devices, you interact with them via a vanilla web interface.
At each level, you'll get a simple input that, owing to some C software bug, can be used to own the target. You'll use the debugger to reverse the target, find the input, and then deliver it to a "production" instance to beat the level.
You'll face a series of revisions of the target, starting from "comically broken" and proceeding vendor-fix by vendor-fix through basic memory corruption, stack overflows, randomization, memory protection schemes, allocator vulnerabilities, and DRM-style software protection.
All this happens on an architecture you've probably used, but likely never have written any code for. Have you ever reverse-engineered a program from its assembly code to understand what it's doing? That'll happen too.
We're keeping a leaderboard, by completion time, CPU cycles, and input size. Part of the fun of a challenge like this is to see how others are doing in real-time.
If you've done a lot of exploit development, you won't have much trouble. But we hope the real fun is reserved for the people who haven't: you'll get to play with concepts that, in the real world, involve tedious toolchain installs and comprehensive knowledge of the memory layouts of gigantic browser library codebases. You won't need any of that here: we're looking forward to seeing people who have never written a line of assembly beating people who've been doing this for years.
It's been pretty fun so far, I've beaten the first 3 levels. You don't need any experience with exploit development, and knowing assembly helps, but it's pretty easy to pick up. They have a little manual attached for it: https://microcorruption.com/manual.pdf Thanks for recommending this, I just beat the first non-tutorial level. I've been looking for something like this, a game which is actually really useful for training assembly, reverse engineering etc. It's almost scary how realistic it is, it's more or less exactly how you crack programs IRL.
|
On January 20 2014 06:30 Tobberoth wrote:Show nested quote +On January 19 2014 02:44 Mr. Wiggles wrote:Hey, so I've been playing with something last night that I think maybe a couple of people here would be interested in. https://microcorruption.com/What is it?
Your target is a small embedded device; a microcontroller running compiled C code.
You get access to the device, disassembly of its code, and a low-level debugger and assembler. We "run" the devices, you interact with them via a vanilla web interface.
At each level, you'll get a simple input that, owing to some C software bug, can be used to own the target. You'll use the debugger to reverse the target, find the input, and then deliver it to a "production" instance to beat the level.
You'll face a series of revisions of the target, starting from "comically broken" and proceeding vendor-fix by vendor-fix through basic memory corruption, stack overflows, randomization, memory protection schemes, allocator vulnerabilities, and DRM-style software protection.
All this happens on an architecture you've probably used, but likely never have written any code for. Have you ever reverse-engineered a program from its assembly code to understand what it's doing? That'll happen too.
We're keeping a leaderboard, by completion time, CPU cycles, and input size. Part of the fun of a challenge like this is to see how others are doing in real-time.
If you've done a lot of exploit development, you won't have much trouble. But we hope the real fun is reserved for the people who haven't: you'll get to play with concepts that, in the real world, involve tedious toolchain installs and comprehensive knowledge of the memory layouts of gigantic browser library codebases. You won't need any of that here: we're looking forward to seeing people who have never written a line of assembly beating people who've been doing this for years.
It's been pretty fun so far, I've beaten the first 3 levels. You don't need any experience with exploit development, and knowing assembly helps, but it's pretty easy to pick up. They have a little manual attached for it: https://microcorruption.com/manual.pdf Thanks for recommending this, I just beat the first non-tutorial level. I've been looking for something like this, a game which is actually really useful for training assembly, reverse engineering etc. It's almost scary how realistic it is, it's more or less exactly how you crack programs IRL.
Hahaha tell me about it, so cool! I just made a program execute arbitrary machine language that I typed in as a password ^^ I'm like 9 levels in so far, we'll see how far I get tonight =D
|
On January 19 2014 06:30 Cyx. wrote:Show nested quote +On January 19 2014 02:44 Mr. Wiggles wrote:Hey, so I've been playing with something last night that I think maybe a couple of people here would be interested in. https://microcorruption.com/What is it?
Your target is a small embedded device; a microcontroller running compiled C code.
You get access to the device, disassembly of its code, and a low-level debugger and assembler. We "run" the devices, you interact with them via a vanilla web interface.
At each level, you'll get a simple input that, owing to some C software bug, can be used to own the target. You'll use the debugger to reverse the target, find the input, and then deliver it to a "production" instance to beat the level.
You'll face a series of revisions of the target, starting from "comically broken" and proceeding vendor-fix by vendor-fix through basic memory corruption, stack overflows, randomization, memory protection schemes, allocator vulnerabilities, and DRM-style software protection.
All this happens on an architecture you've probably used, but likely never have written any code for. Have you ever reverse-engineered a program from its assembly code to understand what it's doing? That'll happen too.
We're keeping a leaderboard, by completion time, CPU cycles, and input size. Part of the fun of a challenge like this is to see how others are doing in real-time.
If you've done a lot of exploit development, you won't have much trouble. But we hope the real fun is reserved for the people who haven't: you'll get to play with concepts that, in the real world, involve tedious toolchain installs and comprehensive knowledge of the memory layouts of gigantic browser library codebases. You won't need any of that here: we're looking forward to seeing people who have never written a line of assembly beating people who've been doing this for years.
It's been pretty fun so far, I've beaten the first 3 levels. You don't need any experience with exploit development, and knowing assembly helps, but it's pretty easy to pick up. They have a little manual attached for it: https://microcorruption.com/manual.pdf Pretty fucking cool, especially considering I'm taking an assembly course in school right meow ^^ thanks for sharing! Which flavour of assembly?
I actually find assembly quite fun so far. It can be finicky but once you figure something out there is no transparency to it. It can be tedious at times but not too bad and it is quite reliable. It will do exactly what I expect it to.
|
In my school last semester we did MIPS, this semester we're doing x86. Interesting stuff, but it takes forever to write simple programs. On Wikipedia it says that the person who made Rollercoaster Tycoon did it entirely in Assembly. That person is likely insane.
|
On January 20 2014 12:56 WarSame wrote: In my school last semester we did MIPS, this semester we're doing x86. Interesting stuff, but it takes forever to write simple programs. On Wikipedia it says that the person who made Rollercoaster Tycoon did it entirely in Assembly. That person is likely insane. Ah I see. We are doing MIPS as well.
Also, Chris Sawyer is the guy who made those RCT games. He's a maniac apparently. Fun games though. He did all his games in x86 Assembly back then
|
Hey quick question. When I'm trying to split a text file in into an array list, which I know how to do but the problem is, this text file is a lot larger than others, and to split each segment of the text file, the Line where the segment needs to be split contains only "SP" short for split here. So my question is how do make my loop check for that SP line to split the segments into the arraylist.
while( !((input = in.nextLine()).equals("SP")))
does not seem to work for me, am I at least on the right track with it?
|
|
|
|
|
|