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 December 27 2013 13:24 WarSame wrote: What is the 100x better? I went through my original code and improved it a lot based off of his comments, so could you do the same thing? There was nothing that struck me as obviously bad, so there's really nothing left for me to catch for myself.
Anyway... the sad thing is I'm in 3rd year Software Engineering. Finally starting to actually use my free time to program.
Well, let me start by saying that I don't do a lot of Java (my school is mostly C++), but I'll point out some of the language-agnostic things I feel could be managed a lot better.
First: your files are WAY too big. Each class should have its own file (I'm looking at you, MouseHandler), and there is DEFINITELY too much in your TicTacToePanel class.
First thing I would do is factor out all that AI code in two ways. One, put it in its own file, in its own class - as it is, I can't tell what that class is responsible for at all. On first glance I would assume it's a UI element since it implements JPanel - but there's a SHITLOAD of logic in there that's not at all connected to that, and someone reading your code really has to read every single method definition pretty in-depth in order to understand what the class is responsible for. So write a new class - and name it something that makes sense. Classes should only be responsible for a fairly coherent set of functionality - they're not just containers for you to toss methods and data into (well, they actually ARE but you shouldn't do that! =D).
Second thing I'd do to the AI code is break it down into like five functions. As it is, like above, someone actually has to read through every single line of the method definition in order to understand what's happening - that's not good. Anyone looking at your class should be able to get a pretty good idea of what it does just by reading the method names and parameters - going deep into the methods in order to understand them takes time and frustration and you're also never sure you got it right.
So as a general rule of thumb - if your girlfriend/mom/technically retarded roommate or whatever can't get the gist of everything that method does just by you reading the name of it to them, you've done something wrong. Split it up a bit into some smaller functions. Some people (HI SLUGGASLAMMOOOOO) will tell you that every method should have less than 5 lines of code or something - I do feel like that's pretty extreme but the idea is REALLY solid. Make your code easy to understand - and that means organizing it into small, neat chunks.
You're guilty of the same thing in your checkVictory function - in fact, all of the logic that actually controls how the game works is just scattered wickedly over your three classes. This (I guess? I don't know the idea that well but from what I have seen in the thread so far) would bring you a LOT closer to that MVC setup everyone's been talking about - you should have a separate class to CONTROL everything, for the same reasons as given above.
So basically, without digging into the Java-specific stuff too much - your functions AND classes are DISGUSTINGLY huge and almost impossible for anyone to read without struggling through it line by line. Make your functions smaller, and make your classes responsible for a coherent set of functionality - one class does AI, one class does drawing the board, one class handles user input, and one class checks victory conditions (for example).
Other people can probably give you some Java specific advice ^^
lynda.com is a fantastic website for any designer, developer, or programmer. I think it's $20/mo but believe me, it's well worth it. I'm currently good at html5 and css3, and am running through tutorials for javascripting, and lynda.com is amazingly helpful and easy to understand.
On December 27 2013 13:24 WarSame wrote: What is the 100x better? I went through my original code and improved it a lot based off of his comments, so could you do the same thing? There was nothing that struck me as obviously bad, so there's really nothing left for me to catch for myself.
Anyway... the sad thing is I'm in 3rd year Software Engineering. Finally starting to actually use my free time to program.
I think he's a magician to find 100x improvement. Judging from his other posts I think at least 90x improvement would come from moving it out of java.
From my personal experience, learning the improvements being suggested isn't something that you're just going to kind of pick up from someone telling you. Everyone harps on single responsibility and readability, but when you first start (and still in Uni is definitely still way early) I always struggled to find the _why_ of these suggestions. The software works, and you wrote it from scratch so you know where everything is // what it does -- so what's the big deal, right?
Then I started unit testing... When you first try to use your own apis, it's amazing how much they suck -- mine were awful. Writing tests allows for you to to kind of become the first consumer of your software, which is a great perspective into how you should write your code. It's also great documentation to others as to how you expect the code to be used.
So, maybe you're way better at all this stuff than I am and can take these suggestions and make it better -- but if not, try writing some tests to prove that your code works. It takes a good amount of time to get better at writing tests as well, but, if you start now you'll have a great jump on a lot of the other people graduating with you.
On December 27 2013 13:24 WarSame wrote: What is the 100x better? I went through my original code and improved it a lot based off of his comments, so could you do the same thing? There was nothing that struck me as obviously bad, so there's really nothing left for me to catch for myself.
Anyway... the sad thing is I'm in 3rd year Software Engineering. Finally starting to actually use my free time to program.
I think he's a magician to find 100x improvement. Judging from his other posts I think at least 90x improvement would come from moving it out of java.
From my personal experience, learning the improvements being suggested isn't something that you're just going to kind of pick up from someone telling you. Everyone harps on single responsibility and readability, but when you first start (and still in Uni is definitely still way early) I always struggled to find the _why_ of these suggestions. The software works, and you wrote it from scratch so you know where everything is // what it does -- so what's the big deal, right?
Then I started unit testing... When you first try to use your own apis, it's amazing how much they suck -- mine were awful. Writing tests allows for you to to kind of become the first consumer of your software, which is a great perspective into how you should write your code. It's also great documentation to others as to how you expect the code to be used.
So, maybe you're way better at all this stuff than I am and can take these suggestions and make it better -- but if not, try writing some tests to prove that your code works. It takes a good amount of time to get better at writing tests as well, but, if you start now you'll have a great jump on a lot of the other people graduating with you.
A good player does not blame his equipment.
Even if they endlessly harp on which equipment is superior.
On December 27 2013 13:24 WarSame wrote: What is the 100x better? I went through my original code and improved it a lot based off of his comments, so could you do the same thing? There was nothing that struck me as obviously bad, so there's really nothing left for me to catch for myself.
Anyway... the sad thing is I'm in 3rd year Software Engineering. Finally starting to actually use my free time to program.
I quickly hacked up my own version instead, have a look. I decided to just upload the full netbeans project, makes it easier.
The AI just picks random cells, but I don't really have the time to do a full port and you should be able to implement it yourself by creating a new AI class and extending Player.
It should be easily extensible, and you should be able to make the board any size (e.g 3x3, 5x5, etc) but I haven't tested anything more than 3x3.
There's no 2D array by the way, because it doesn't need one and it makes the algorithms much simpler this way. I just have a single list for all cells. See if you can figure out how I did it.
This is the main body of the code where I check the result and see if it has been solved.
On December 27 2013 16:50 IronManSC wrote: lynda.com is a fantastic website for any designer, developer, or programmer. I think it's $20/mo but believe me, it's well worth it. I'm currently good at html5 and css3, and am running through tutorials for javascripting, and lynda.com is amazingly helpful and easy to understand.
Still destroys the 3-5 lines recommendation that I gave that certain people told me was impossible. T_T
Are you trolling or that stupid?
You said sth among the lines "your functions shouldn't be longer than 3-5 lines", and not "the average length of your function should be around 3-5 lines", if you write a getter/setter for every variable you obviously get an extremely low average.
In many if/while expression you didn't used the brackets(which many people would most probably consider to be bad), if you would have written it in the "proper way" or if you ever need to add another statement to those structure, it would obviously inflate your average. If you would have used a different coding style like Allman, it would also have increased your line count.
So yea your 3-5 lines recommendation is bullshit, since you 1) weren't talking about averages and 2) it heavily depends on the coding style.
Or you used the ternary operator, many people would have used a normal if structure instead, since those are much easier to understand at the first look, but obviously much longer.
And you were also saying that you shouldn't repeat yourself.
public List<Cell> getColumn(int columnNumber) { List<Cell> row = new ArrayList(); for(int i = 0; i < widthTiles; i++) row.add(getCell(columnNumber, i)); return row; }
public List<Cell> getDiagonalRowTop() { List<Cell> row = new ArrayList(); for(int i = 0; i < widthTiles; i++) row.add(getCell(i, i)); return row; }
public List<Cell> getDiagonalRowBottom() { List<Cell> row = new ArrayList(); for(int i = 0; i < widthTiles; i++) row.add(getCell(i, widthTiles-i-1)); return row; }
I'm in academia (linguistics) and I want to learn to code. I'm drifting towards a computer sciencey part of my field. Everybody's first recommendation is to learn python because you can do quick mockups, there are lots of existing libraries, etc. But I feel like on the long run I should learn C and some Computer Science in general (especially the math behind algorithms, etc). I'd be interested in some feedback. Thank you.
EDIT: I have a basic background in C and python already, but I want to break out of the "look up every second command and syntax from the tutorial while coding" phase
Still destroys the 3-5 lines recommendation that I gave that certain people told me was impossible. T_T
Well, now you look a bit stupid :p You just averaged over the averages. Which is quite the blunder mathematically; I don't think I have to explain why.
Counting actual lines of text is a bad idea anyways. Complexity comes from number of operations/instructions and other stuff. Which is why the common code metric "lines of code" usually doesn't count actual lines of text.
On December 28 2013 05:21 mihajovics wrote: I'm in academia (linguistics) and I want to learn to code. I'm drifting towards a computer sciencey part of my field. Everybody's first recommendation is to learn python because you can do quick mockups, there are lots of existing libraries, etc. But I feel like on the long run I should learn C and some Computer Science in general (especially the math behind algorithms, etc). I'd be interested in some feedback. Thank you.
EDIT: I have a basic background in C and python already, but I want to break out of the "look up every second command and syntax from the tutorial while coding" phase
I would talk to your school's CS department, and see if you could take Principles of Programming Languages and Theory of Computation, or whatever they're called at your school. Those are the two courses that involve the most linguistics stuff. You might have to take an Algorithms course as a prereq for Theory of Comp. If you're only interested in CS for the linguistics, you don't really need to learn any more coding than these courses require.
If these courses aren't really an option, I highly recommend "Introduction to Theory of Computation" by Sipser. Great textbook, covers theory of comp really well, and a little PPL.
Still destroys the 3-5 lines recommendation that I gave that certain people told me was impossible. T_T
Are you trolling or that stupid?
You said sth among the lines "your functions shouldn't be longer than 3-5 lines", and not "the average length of your function should be around 3-5 lines", if you write a getter/setter for every variable you obviously get an extremely low average.
Holy shit lol... can we all get over the stupidly pedantic discussion of whether or not you REALLY ACTUALLY NEED EXACTLY FIVE LINES OF CODE PER METHOD OMFG and just agree that having your functions be pretty small is unarguably a good thing? Like, even if slugg isn't exactly perfect, and even if he did his averaging a little bit wrong, and even if he WAS a bit uptight about it when he first started talking about it, everything he says is still totally true. Having 100-line-long functions is absolutely HORRIBLE for readability, and if you can break that down into 10 10-line functions, then I just don't see how that could POSSIBLY be a bad thing.
Even if you want to PM slugg and flame him like he's the fucking devil himself, can we at least agree to tell the people who are asking for help that all the clean-code ideas he advocates are pretty damn good ideas?
e: I guess all I'm saying is - try to keep it clear in your head whether you're HELPING SOMEONE or HAVING A SHITTY LITTLE ARGUMENT OVER SOMETHING SOMEONE SAID FIVE PAGES AGO. And if it's the latter, use PMs. That's what they're for.
On December 28 2013 05:21 mihajovics wrote: I'm in academia (linguistics) and I want to learn to code. I'm drifting towards a computer sciencey part of my field. Everybody's first recommendation is to learn python because you can do quick mockups, there are lots of existing libraries, etc. But I feel like on the long run I should learn C and some Computer Science in general (especially the math behind algorithms, etc). I'd be interested in some feedback. Thank you.
EDIT: I have a basic background in C and python already, but I want to break out of the "look up every second command and syntax from the tutorial while coding" phase
What do you need coding for? C is low level and not that strongly typed language. My advice is to try a higher level language such as C#/Java/Objective-C. There are many more though but those are close to the C family. possibly excluding Objective-C. Its syntax doesn't remind me of the C style too much.
Edit: It looks like it's considered to be part of it which I don't agree too much with. Although C can be used within Objective-C, Objective-C itself has... a different style?
On December 28 2013 05:21 mihajovics wrote: I'm in academia (linguistics) and I want to learn to code. I'm drifting towards a computer sciencey part of my field. Everybody's first recommendation is to learn python because you can do quick mockups, there are lots of existing libraries, etc. But I feel like on the long run I should learn C and some Computer Science in general (especially the math behind algorithms, etc). I'd be interested in some feedback. Thank you.
EDIT: I have a basic background in C and python already, but I want to break out of the "look up every second command and syntax from the tutorial while coding" phase
I would talk to your school's CS department, and see if you could take Principles of Programming Languages and Theory of Computation, or whatever they're called at your school. Those are the two courses that involve the most linguistics stuff. You might have to take an Algorithms course as a prereq for Theory of Comp. If you're only interested in CS for the linguistics, you don't really need to learn any more coding than these courses require.
If these courses aren't really an option, I highly recommend "Introduction to Theory of Computation" by Sipser. Great textbook, covers theory of comp really well, and a little PPL.
I mainly need to code relatively simple, practical tasks, like grammar parsers, etc. to generate (or examine already existing) data... These vary a lot in the specifics, but in general all involve some simple database structure (tokenized text). I guess for these kinds of tasks python is great, because it's fast (to code and learn) and has a lot of out of the box solutions to fall back on.
My aversion though stems from feeling like a cop out. The thing is that some newer theories are shifting towards "bigger picture" methods that involve stuff like neural networks, etc. So computational efficiency (might) actually start to matter. It just feels like that learning C would help one to grasp this whole "computer thing" so to say, how things actually work, and I guess that would help in all sorts of ways. Am I wrong on this?
The other part I need to know, CS, I understand is basically completely separate from coding. It's the concepts behind several different technical implementations. Thanks for the tips, I'll sniff around for some classes next semester and till then I'll check out the book you recommended.
On December 28 2013 05:21 mihajovics wrote: I'm in academia (linguistics) and I want to learn to code. I'm drifting towards a computer sciencey part of my field. Everybody's first recommendation is to learn python because you can do quick mockups, there are lots of existing libraries, etc. But I feel like on the long run I should learn C and some Computer Science in general (especially the math behind algorithms, etc). I'd be interested in some feedback. Thank you.
EDIT: I have a basic background in C and python already, but I want to break out of the "look up every second command and syntax from the tutorial while coding" phase
I would talk to your school's CS department, and see if you could take Principles of Programming Languages and Theory of Computation, or whatever they're called at your school. Those are the two courses that involve the most linguistics stuff. You might have to take an Algorithms course as a prereq for Theory of Comp. If you're only interested in CS for the linguistics, you don't really need to learn any more coding than these courses require.
If these courses aren't really an option, I highly recommend "Introduction to Theory of Computation" by Sipser. Great textbook, covers theory of comp really well, and a little PPL.
I mainly need to code relatively simple, practical tasks, like grammar parsers, etc. to generate (or examine already existing) data... These vary a lot in the specifics, but in general all involve some simple database structure (tokenized text). I guess for these kinds of tasks python is great, because it's fast (to code and learn) and has a lot of out of the box solutions to fall back on.
My aversion though stems from feeling like a cop out. The thing is that some newer theories are shifting towards "bigger picture" methods that involve stuff like neural networks, etc. So computational efficiency (might) actually start to matter. It just feels like that learning C would help one to grasp this whole "computer thing" so to say, how things actually work, and I guess that would help in all sorts of ways. Am I wrong on this?
The other part I need to know, CS, I understand is basically completely separate from coding. It's the concepts behind several different technical implementations. Thanks for the tips, I'll sniff around for some classes next semester and till then I'll check out the book you recommended.
Theory of Computation will have you work with the three big kinds of automata. Finite State Machines, Push-down Automata (also known as grammars), and Turing Machines. You'll learn what kinds of things each can and cannot compute, you'll definitely code a few FSM's and grammars, and you'll probably also code a few Turing Machines. My personal favorite parts of the class were when we had to code "simulators" for each kind of automaton. At the end of discussing one kind of automata, the prof would give us a file structure describing that automaton, and we had to code a simulator which would read the file, parse out the definitions of that particular automaton, and run it. For instance, for FSM's, the file would contain a list of states, a list of transitions, a start state, end states, and one or more sets of input. Our sim would read the file, build the FSM, and run it on the given input(s). The prof had a bunch of different finite state machines following the same format, which he would use to test our simulators. The FSM version of the assignment is pretty easy, its not much more than a linked list, but it can get pretty complicated for Push-down Automata and Turing Machines.
I would say that any language will give you some idea of how computers work. C will show you the nitty-gritty details, while say python or java will hide the minute details and do a better job showing you the bigger picture. I don't really know anything about neural networks, suffice to say you will probably want to pick a language that focuses on parallelism, considering that, if my understanding is correct, each neuron is a simple computer, and they're all running simultaneously.
Principles of Programming Languages should cover the concepts behind the technical implementations you mentioned. Unless by "technical implementations" you meant your PC, in which case you'll want to take Systems.
On December 28 2013 05:21 mihajovics wrote: I'm in academia (linguistics) and I want to learn to code. I'm drifting towards a computer sciencey part of my field. Everybody's first recommendation is to learn python because you can do quick mockups, there are lots of existing libraries, etc. But I feel like on the long run I should learn C and some Computer Science in general (especially the math behind algorithms, etc). I'd be interested in some feedback. Thank you.
EDIT: I have a basic background in C and python already, but I want to break out of the "look up every second command and syntax from the tutorial while coding" phase
I would talk to your school's CS department, and see if you could take Principles of Programming Languages and Theory of Computation, or whatever they're called at your school. Those are the two courses that involve the most linguistics stuff. You might have to take an Algorithms course as a prereq for Theory of Comp. If you're only interested in CS for the linguistics, you don't really need to learn any more coding than these courses require.
If these courses aren't really an option, I highly recommend "Introduction to Theory of Computation" by Sipser. Great textbook, covers theory of comp really well, and a little PPL.
I mainly need to code relatively simple, practical tasks, like grammar parsers, etc. to generate (or examine already existing) data... These vary a lot in the specifics, but in general all involve some simple database structure (tokenized text). I guess for these kinds of tasks python is great, because it's fast (to code and learn) and has a lot of out of the box solutions to fall back on.
My aversion though stems from feeling like a cop out. The thing is that some newer theories are shifting towards "bigger picture" methods that involve stuff like neural networks, etc. So computational efficiency (might) actually start to matter. It just feels like that learning C would help one to grasp this whole "computer thing" so to say, how things actually work, and I guess that would help in all sorts of ways. Am I wrong on this?
The other part I need to know, CS, I understand is basically completely separate from coding. It's the concepts behind several different technical implementations. Thanks for the tips, I'll sniff around for some classes next semester and till then I'll check out the book you recommended.
Theory of Computation will have you work with the three big kinds of automata. Finite State Machines, Push-down Automata (also known as grammars), and Turing Machines. You'll learn what kinds of things each can and cannot compute, you'll definitely code a few FSM's and grammars, and you'll probably also code a few Turing Machines. My personal favorite parts of the class were when we had to code "simulators" for each kind of automaton. At the end of discussing one kind of automata, the prof would give us a file structure describing that automaton, and we had to code a simulator which would read the file, parse out the definitions of that particular automaton, and run it. For instance, for FSM's, the file would contain a list of states, a list of transitions, a start state, end states, and one or more sets of input. Our sim would read the file, build the FSM, and run it on the given input(s). The prof had a bunch of different finite state machines following the same format, which he would use to test our simulators. The FSM version of the assignment is pretty easy, its not much more than a linked list, but it can get pretty complicated for Push-down Automata and Turing Machines.
I would say that any language will give you some idea of how computers work. C will show you the nitty-gritty details, while say python or java will hide the minute details and do a better job showing you the bigger picture. I don't really know anything about neural networks, suffice to say you will probably want to pick a language that focuses on parallelism, considering that, if my understanding is correct, each neuron is a simple computer, and they're all running simultaneously.
Principles of Programming Languages should cover the concepts behind the technical implementations you mentioned. Unless by "technical implementations" you meant your PC, in which case you'll want to take Systems.
I kind of already studied formal languages and automatons, but I could definitely use a refresh for sure. These approaches were extremely popular in the 60s and 70s for studying language. Really interesting topic! Ultimately all these approaches were unsuccessful, except for some very specific subsets of problems, hence all newer research is based on some sort of statistical, distributional model.
But I'm getting off topic, thanks a lot for the input! I think I'll just go with whatever language has a course I can take.
Still destroys the 3-5 lines recommendation that I gave that certain people told me was impossible. T_T
Are you trolling or that stupid?
You said sth among the lines "your functions shouldn't be longer than 3-5 lines", and not "the average length of your function should be around 3-5 lines", if you write a getter/setter for every variable you obviously get an extremely low average.
In many if/while expression you didn't used the brackets(which many people would most probably consider to be bad), if you would have written it in the "proper way" or if you ever need to add another statement to those structure, it would obviously inflate your average. If you would have used a different coding style like Allman, it would also have increased your line count.
So yea your 3-5 lines recommendation is bullshit, since you 1) weren't talking about averages and 2) it heavily depends on the coding style.
Or you used the ternary operator, many people would have used a normal if structure instead, since those are much easier to understand at the first look, but obviously much longer.
And you were also saying that you shouldn't repeat yourself.
public List<Cell> getColumn(int columnNumber) { List<Cell> row = new ArrayList(); for(int i = 0; i < widthTiles; i++) row.add(getCell(columnNumber, i)); return row; }
public List<Cell> getDiagonalRowTop() { List<Cell> row = new ArrayList(); for(int i = 0; i < widthTiles; i++) row.add(getCell(i, i)); return row; }
public List<Cell> getDiagonalRowBottom() { List<Cell> row = new ArrayList(); for(int i = 0; i < widthTiles; i++) row.add(getCell(i, widthTiles-i-1)); return row; }
'
You were going strong with the braces point, until... the don't repeat yourself is just a limitation of java imo. What you really want here (I believe) is the equivalent of filtering the list with a closure, but, good luck finding that in java.
I guess you could create an interface that is is like CellFilter that has a single method acceptCell and then have a ColumnCellFilter(int column), TopDiagonalFilter, and BottomDiagonalFilter that is used to filter the list, but I'm thinking that an interface and 3 implementation classes to prevent looping over the same loop 3 times (with separate get cell criteria) probably isn't worth it. Maybe java 8.
I still can't believe everyone is focusing on code complexity and not the fact that he uploaded his project using netbeans.
On December 28 2013 05:21 mihajovics wrote: I'm in academia (linguistics) and I want to learn to code. I'm drifting towards a computer sciencey part of my field. Everybody's first recommendation is to learn python because you can do quick mockups, there are lots of existing libraries, etc. But I feel like on the long run I should learn C and some Computer Science in general (especially the math behind algorithms, etc). I'd be interested in some feedback. Thank you.
EDIT: I have a basic background in C and python already, but I want to break out of the "look up every second command and syntax from the tutorial while coding" phase
I would talk to your school's CS department, and see if you could take Principles of Programming Languages and Theory of Computation, or whatever they're called at your school. Those are the two courses that involve the most linguistics stuff. You might have to take an Algorithms course as a prereq for Theory of Comp. If you're only interested in CS for the linguistics, you don't really need to learn any more coding than these courses require.
If these courses aren't really an option, I highly recommend "Introduction to Theory of Computation" by Sipser. Great textbook, covers theory of comp really well, and a little PPL.
I mainly need to code relatively simple, practical tasks, like grammar parsers, etc. to generate (or examine already existing) data... These vary a lot in the specifics, but in general all involve some simple database structure (tokenized text). I guess for these kinds of tasks python is great, because it's fast (to code and learn) and has a lot of out of the box solutions to fall back on.
My aversion though stems from feeling like a cop out. The thing is that some newer theories are shifting towards "bigger picture" methods that involve stuff like neural networks, etc. So computational efficiency (might) actually start to matter. It just feels like that learning C would help one to grasp this whole "computer thing" so to say, how things actually work, and I guess that would help in all sorts of ways. Am I wrong on this?
The other part I need to know, CS, I understand is basically completely separate from coding. It's the concepts behind several different technical implementations. Thanks for the tips, I'll sniff around for some classes next semester and till then I'll check out the book you recommended.
Theory of Computation will have you work with the three big kinds of automata. Finite State Machines, Push-down Automata (also known as grammars), and Turing Machines. You'll learn what kinds of things each can and cannot compute, you'll definitely code a few FSM's and grammars, and you'll probably also code a few Turing Machines. My personal favorite parts of the class were when we had to code "simulators" for each kind of automaton. At the end of discussing one kind of automata, the prof would give us a file structure describing that automaton, and we had to code a simulator which would read the file, parse out the definitions of that particular automaton, and run it. For instance, for FSM's, the file would contain a list of states, a list of transitions, a start state, end states, and one or more sets of input. Our sim would read the file, build the FSM, and run it on the given input(s). The prof had a bunch of different finite state machines following the same format, which he would use to test our simulators. The FSM version of the assignment is pretty easy, its not much more than a linked list, but it can get pretty complicated for Push-down Automata and Turing Machines.
I would say that any language will give you some idea of how computers work. C will show you the nitty-gritty details, while say python or java will hide the minute details and do a better job showing you the bigger picture. I don't really know anything about neural networks, suffice to say you will probably want to pick a language that focuses on parallelism, considering that, if my understanding is correct, each neuron is a simple computer, and they're all running simultaneously.
Principles of Programming Languages should cover the concepts behind the technical implementations you mentioned. Unless by "technical implementations" you meant your PC, in which case you'll want to take Systems.
I kind of already studied formal languages and automatons, but I could definitely use a refresh for sure. These approaches were extremely popular in the 60s and 70s for studying language. Really interesting topic! Ultimately all these approaches were unsuccessful, except for some very specific subsets of problems, hence all newer research is based on some sort of statistical, distributional model.
But I'm getting off topic, thanks a lot for the input! I think I'll just go with whatever language has a course I can take.
Formal languages & grammars are still important in the CS field. Since our programming languages are based upon those. So if you say to a CS guy "I need to do a grammar parser" they will answer accordingly.
You're probably looking for stuff like language modelling (n-grams) with smoothing (Good-Turing, ....), Katz's back-off ... Look at Matlab or R. Both have toolboxes.
Still destroys the 3-5 lines recommendation that I gave that certain people told me was impossible. T_T
Well, now you look a bit stupid :p You just averaged over the averages. Which is quite the blunder mathematically; I don't think I have to explain why.
Counting actual lines of text is a bad idea anyways. Complexity comes from number of operations/instructions and other stuff. Which is why the common code metric "lines of code" usually doesn't count actual lines of text.
2.97 my bad, it was 4am. ;_;
I don't think there was any problem with my reasoning.