Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Alan Greenspan
Jun 17, 2001

fret logic posted:

I'm just a CS freshman with little to no background in anything beyond basic Java/C syntax. Was just wanting to get some basic theory in my head while I'm learning these languages.

http://www.cs.rochester.edu/~scott/pragmatics/
http://www.amazon.com/Programming-Language-Pragmatics-Michael-Scott/dp/1558604421

This book is extremely awesome.

Adbot
ADBOT LOVES YOU

Alan Greenspan
Jun 17, 2001

I have no clue about graphics programming so I don't know what keywords to google for. I have a set of rectangles I need to draw onto a 2D plane and I need to find out which rectangles are actually visible and which are hidden by other rectangles and don't need to be drawn (I have a Z-order on the rectangles).

Since I'm pretty drat sure that this is a problem that was solved at least 40 years ago I don't want to invent my own algorithm.

What keywords can I google for? What standard algorithms exist?

Alan Greenspan
Jun 17, 2001

ShoulderDaemon posted:

If you're actually drawing filled rectangles, and you have a strong z-ordering, then a very simple, fast, and easy to optimize algorithm is to simply draw all of them, starting from the back and moving to the front. This is the simplest kind of fragment rendering, imposes almost no overhead when there are few overlaps, and can be implemented in very small code with no conditionals that only has to consider one rectangle at a time.
Unfortunately just drawing them is not possible. In the application a realistic number of rectangles is up to 200K and I want to be able to handle up to 1 million rectangles. Furthermore the rectangles are non-trivial to draw because of their content.

The good news is that the average screen is so small that more than like 100 rectangles are probably not visible at the same time unless the user is an rear end in a top hat Asperger headcase who gives each rectangle exactly one pixel of screen space in which case a single redraw probably takes half an hour. However I still need to find out which 100 rectangles to draw and which 999.900 not to draw.

quote:

Possibly the best is to render them as above into an off-screen buffer somewhere, each with a separate color, then check all the pixels in your buffer to determine which colors are visible.

This is actually really cute. Thanks for the suggestion.

Alan Greenspan
Jun 17, 2001

Plastic Jesus posted:

Suggestions? Does any of this make any sense at all?

If you have access to a library or something check out this book. Pages 91-96 discuss your problem. It's available on Safari if you've got a subscription. Undocumented source code is available here. The example "// Find leftmost byte having an upper case letter." can be modified for your range of valid bytes (assuming your range of bytes between your lowest byte and your highest byte is less than 128).

Alan Greenspan
Jun 17, 2001

Blacknose posted:

When using Eclipse to code java I know there is a way to make it automaticaly insert stubs for javadoc comments, but I can't for the life of me find out how. Anyone know if it's an add-on or pre-installed, and how to use it? Can't find anything useful on google.

I just go into the line right above a function and hit

/** [SHIFT-ENTER]

That picks up on the parameters, thrown exceptions, etc

Edit: Simply hitting ENTER seems to work too.

Alan Greenspan
Jun 17, 2001

Donald Duck posted:

The books listed were Code Complete and Practice of Programing, as well as the Art of Programming. Would all these books be useful for me? I imagine most of the Knuth book would be beyond me at this stage
Yes. And Probably.

quote:

Second question, pretty much everything we've done has been just in Java, with a tiny bit of C in one of my modules. I've picked up the K&R C book to help me learn C over the summer. Since I want to know more than just Java, what else is worth learning?

I'd try to get some clue about concepts instead of programming languages. In my opinion every CS students needs to read this. Since this book introduces all kinds of programming language concepts you can also use it to find out what to learn next.

Alan Greenspan
Jun 17, 2001

Factor Mystic posted:

This is kind of a programming related question: Is there any way to identify the function called in a compiled module? Example, given this output from Process Monitor, can I find out what the functions are?



http://www.hex-rays.com/idapro/idadown.htm

Download either the free version 4.9 or the 5.2 trial. Load the DLL you want into IDA. Make sure to say "Yes" if IDA asks you to download debug information from the Microsoft server (not sure if 4.9 does that, at least the full version of 5.2 does that). In IDA hit "g" to enter the address of the function (like 0x77A99523). If you're at the start of a function now that's probably the function you're looking for (you can double-check using the method I describe in the next paragraph).

If you're not at the start of a function it's probably that the DLL file was loaded to another address in memory than suggested in its header. In that case scroll all the way up in IDA until you see the first offset of the file (say 77A90000). Add +0x9523 manually to that address. Now you should be at the function you're looking for. If not, ask back and describe your problems.

Alan Greenspan
Jun 17, 2001

Triple Tech posted:

Why again is emulation for video games slow? Is it because the programmers lack the EXACT documentation for the original architecture? Basically is it a matter of accuracy or is it really processing power?

I guess it couldn't be processing power if today's systems are magnitudes more powerful than consoles... Also, just how powerful are the specialized components in consoles that couldn't be emulated away (quickly) in a modern desktop? (graphics, sound, "emotion", etc)

What emus are you talking about? I've only tried emus up to Playstation 1 and they all worked well. Emus of modern consoles are most likely limited by processing power. In the past, emulators were simple interpreters of the game code (fetch instruction, simulate it on x86 hardware, loop forever). Unless the modern console emus try to get some JIT compilation going I don't see a lot of hope to get them to emulate games properly on current systems.

Alan Greenspan
Jun 17, 2001

Edit: No wait. :hehe:

Alan Greenspan
Jun 17, 2001

The company I work for needs about 50 custom-designed icons. What would be a typical price tag for that? Where do you guys get custom icons from?

Adbot
ADBOT LOVES YOU

Alan Greenspan
Jun 17, 2001

tef posted:

Alternatively, if there are similar pieces of software for ci that suck a lot less I'd be interested too

We use http://www.viewtier.com/products/parabuild/index.htm at work. You will tear your hair out once in a while but we have like 30 builds up and running that are built by Parabuild and once you have set up a build things should work smoothly afterwards. Maybe try the eval version.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply