Jeremy Tartaglia

Ranch Hand
+ Follow
since Mar 11, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeremy Tartaglia

Hi, my name is Jeremy Tartaglia, and I'm a recent graduate of the University of Florida. I'm currently holding two Bachelor's Degrees (a BS in Computer Science and a BA in Mathematics), and would like to find an entry level programming job working with Java technologies, preferrably with web game creation or translators/compilers.

I have a strong background in parsing and compiler technology and theory, and, in fact, my senior project was to create a compiler for a subset of C, to be used in a compiler project in later years at UF. I'm currently working for the University in modifying and maintaining a translator written in MatLab, to convert Image Algebra algorithms into both MatLab code and Assembly-like code (mostly for work analysis), for the Computer Vision field.

I also have a strong understanding of graphics programming, and have written numerous software 3D renders based on both ray-casting and algebriac/matrix mathematics.

I am willing to relocate, even to other countries, but may require some assistance in this respect. Of course, it all depends on where I'd have to relocate. (If relocating to another country, I should note I speak a moderate amount of German and am studying Japanese.)

Since I'm not sure how to post my resume, or if that's even allowed, please feel free to email me at nychold@yahoo.com .

Thanks for your time.
[ June 27, 2006: Message edited by: Jeremy Tartaglia ]
17 years ago
Actually, I think using a simple 2D array for the board would be the easiest solution:



The '.' characters would have to be "no such square" markers of some kind, while the S characters would be either empty squares, or the piece which currently occupies the square. Then, movement is a breeze:

Let x,y be the array position of a legal piece on the board. The possible moves are:

y-2 (up)
y+2 (down)
x+1,y-1 (up and right)
x+1,y+1 (down and right)
x-1,y-1 (up and left)
x-1,y+1 (up and right)

If these expressions yield impossible squares, you know for a fact the move is invalid. Of course, for multiple square moves, it will probably be simpler on programming to go one step at a time, but then I don't know the rules to your game.

You could even pad the board with a few extra columns so that you won't have to check for "out of bounds" exceptions.
[ March 31, 2006: Message edited by: Jeremy Tartaglia ]
17 years ago
It's probably Hyper-Threading.
17 years ago
My guess is that you're not taking into account that you have two classes. The variable is only defined in your first class, not the second. Like this:



In Class2, x is not defined. So the compiler will question why you're using it. If you need to access an attribute in another class, there are two accepted ways: direct access, and accessor methods. Direct access seems to be frowned on, but for low security data, often modified data, or simple projects, I don't see it as a problem. This method is to make the attribute protected (accessible by subclasses), package, or public, and just access them through an object:



With Object Oriented programming, a new idea was created: accessor methods. The idea behind this is to limit all attributes to private, and write functions to view or modify the data:



This has become the most accepted way to deal with attributes, as you can limit a variable to read only, write-only, or read-write depending on the object itself. It also allows you to perform the modification at an appropriate time, to avoid crashes.
17 years ago
Your best bet to writing a command line calculator would probably be to write a parser, which was stated before. Since the lines will likely be short, a top-down (infinite recursion) approach would be probably best, or LL(1). LR(0) would also work, but it's much tricker to design and implement, especially if you have little to no experience in parsing.

It may be overkill to do a full lexer and parser for a simple calculator program. In fact, a ver powerful, full functioning calculator can be written with nothing but lex (a lexer creator program), but it is definitely worth the time to learn how to do it. There are plenty of sites with information on LL/LR parsing, and even more on simple lexing algorithms.
17 years ago
Actually, I disagree with Bert. While it is important that you understand exactly what's going on when you compile your programs, command line interfaces are not to be taken lightly. They can be difficult to get used to, annoying to work with, and disheartening when all you see are errors.

The most important thing right now is that you learn how to program in Java. Without the strain of also learning the compiler, the command line interface, the VM flags, and how to properly install the JDK into your chosen OS, you can better understand how Java programs themselves must be written. Then, you can learn all the details of the JVM if you wish.

As for good IDEs, I can personally recommend JBuilder, NetBeans, Forte, and Eclipse (in my order of preference). They all do the job admirably, and are relatively easy to use, if somewhat heavyweight. (JBuilder requires something like 512-768 MB of memory.)

So, goodluck on your Java learning.
17 years ago
Well, look at what it's doing. You have a for loop in which a new variable (num) is defined. But printNumInEnglish is using your static bottles variable, which is never altered. You need to change that value, or you need to modify your code so that printNumInEnglish uses a parameter passed to it.
18 years ago
Your compilation errors are simple typos:

System.exit(int x) requires an error code to be passed. System.exit(void) doesn't exist. So just add a parameter to System.exit(). I use 0 frequently, though other numbers should work equally well.

Your function printNumInEnglish() doesn't take a parameter, but you pass a parameter to it three times. You'll have to iron this out on your own, in the best interest of your program.

That should get it to compile.
18 years ago
If you're asking "how will we know if an object is eliminated by the garbage collector", the answer is, quite frankly, that you won't. Garbage collectors work like this:

1) Unmark all resources
2) Check every variable in use
3) If a variable points to object x, mark it
4) Delete all unmarked resources
5) Reorganize data to eliminate memory fragmentation

In short, in order to determine whether object x has been deleted, you'd need a reference to object x. If any reference to object x exists, the garbage collector leaves it alone. It makes a paradox.

You'll just have to trust that at some point it will be deleted. That's one drawback to GC.
18 years ago
There are two types of data in Java: intrinsics and objects.

An intrinsic is a built in data type which is a single element. Ints, Floats, Doubles, Chars, Bytes, Shorts, and Longs are all intrinsics. They have no methods or properties assoicated with them, since they are a single element. They "point" to nothing, if you want to think of it like that.

An object is a class derived from java.lang.Object, which is every class written in Java. (This raises the question of what to call java.lang.Object, but let's ignore that little wrinkle. ) All Objects have certain methods and properties associated with them, like toString and hashCode. When you set a variable to an object, what you get is a pointer, more recently called a reference. (Sorry hardcore Java gurus, I'm an old ASM/C guy at heart, so they're pointers to me, not references. ) It "points" to an area in memory where the information about the class is stored. Predefined properties, abstract methods, the whole nine yards.

When Java says "x can't be dereferenced", it means you're trying to tell it that an intrinsic is an object. If you absolutely MUST get an int into a String, this code should work fine:



There are other ways, but this is probably the most concise.
18 years ago
You obviously have no experience in Java, so making games should be the least of your worries if you want to learn Java. Games are just too complex, even the simple ones. Start making simple applications (read input, do something, output answer), then make simple applets using graphics (Fire algorithm, fireworks, gravity, etc), followed by some more advanced ones with user input (Convex Hull Detection, paint program with infinit undo/redo, etc.), and finally learn to make a Swing/AWT application using graphics and user input. Some of these programs may not seem within the scope of making a game, but they will improve your ability to code in Java without having to look at a book, tutorial, or the specification for every little thing.

If you have no experience in programming games, you'd be better off making something simple. Say, a Tetris applet in Java. Then add sound, followed by something multiplayer, like competitive Tetris. Slowly add up until you understand all of the following subjects well enough to code them:

1) Graphics
2) Sound
3) Networking
4) Artifical Intelligence
5) Data Structures (trees, graphs, lists, and hashtables to be sure)
6) Multithreading (often needed in Java games)
7) Game scripting (if needed)

You'd be best off to simply buy a book in creating games in Java, since that will cover most if not all of the aspects necessary for a Java game.

Speaking frankly, with a MMORPG, you're in for a world of hurt. MMORPGs are monsters; highly complex servers with graphical shell clients, able to handle an infinite number of players without slow downs.

I wish you luck with your project.
18 years ago
I'm going to keep this simple, because the most common way for MUDs and other MU*s to do this is a little complicated to explain.

Probably the easiest way to code this would be to use an Interface (or an Abstract Class) called GameObject (or similar). Then to derive from that all the possible subclasses you would need (Room, Creature, Item, Weapon, Exit, etc.) trying to abstract whenever possible. For instance, GameObject -> Creature -> Character -> NPC or PC would be an intelligent design.

Every game object should be allowed to "contain" other objects. Thus, rooms could contain Players, Monsters, Items, and Exits. In that way, you incorporate tree/graph abilities to every GameObject, even for ones which couldn't/wouldn't use it. If you maintain a root GameObject, you could easily traverse through all known game objects in existance for things like searching, or making sure the map is complete (ie: no unenterable or unexitable rooms unless you wanted that).

That's just my opinion, but it's how most MU*s work on a smaller scale.
18 years ago
The throws keyword is a way to define a method so that the compiler knows it will not handle a specific exception or even multiple exceptions. Using it is quite easy:



No guarrantees on the above code, but it's a similar process.
18 years ago
I would say B, not D. Although a transient static or final variable may not make sense, it shouldn't be prohibited. Afterall, transient only really becomes important with persistance and serialization classes.

However, the native keyword quite obviously violates platform independence; it requires a dynamically loaded library to be written in native code. This library limits the platforms on which the Java program will work.
18 years ago
Simply put, without access to a pointer (or reference) of a crawler class, you can't. If you want, you can make a list of all crawler classes, and store them in a static list of main:



That's sort of a cop out, but it works.
[ February 25, 2006: Message edited by: Jeremy Tartaglia ]
18 years ago