What I did today

Congrats!

You are well prepared now for the job-interviews where they ask you to reverse a float[] :point:

Seems like a simple enough challenge :slight_smile:


void reverse(float[] array){
    for(int i = 0; i<array.length/2; i++){
        float cache = array[i];
        array[i] = array[array.length-1-i];
        array[array.length-1-i] = cache;
    }
}

How’d I do?

Nice job)
Times goes so fast:
I remember couple years ago you post here that entering Georgia Tech and now you already finished it ^^

[]taolf )

While Riven was joking (or at least poking fun at how pathetic most industry interviews are) I do have some advice.

You’ll find that if the company is any any good at all, for the first simple warm-up questions you will impress them more with succinct answers. Know a relevant method in the API, a quick shortcut etc. It doesn’t need to be optimised, just so long as it’s reasonable big-O.

I would first ask if Python was ok, then give
f[::-1]

A couple of days ago, I managed to get some huge improvements in NNGINE’s performance. Seriously, it’s frigging insane how much faster it got. In addition, it was really simple and just took a day to do. There were huge GPU performance improvements throughout the entire engine, especially in the G-buffer filling pass, and the memory controller load is down a lot too! A scene which could barely maintain 60 FPS is now doing a crazy 280 FPS!!!

TL;DR: [spoiler]Upgraded from one GTX 770 to two Zotac GTX 1080s, with 5 years warranty to avoid one of them breaking 2 months after the 3 year warranty ends again…[/spoiler]

Theagentd: Mad programming skillz

Jono: That’s good to know! :slight_smile:

I’d suggest to review the code which consumes the output, and check why (if) it needs to do the reverse operation in the first place. :wink:

I have already accepted a full-time offer from Google after interning with them last summer. I am starting later this year!

Thankfully my interview questions were more difficult than that! :point:

Attempted to duplicate this tweet: link

Results were meh but it was a fun little day project.

(made in Java2D btw)

I haven’t read anything anywhere that would give me the idea that helper methods are necessarily bad (they can be of course if you get really insignificant with them I guess). I’m not sure if you guys use a lot of libraries in your development, but what are your opinions on helper methods? For example, to help cut down on something like this:

(Quick-probably-broken-code-examples)


Connection conn = ((DataSource)InitialContext().lookup("java:comp/env/jdbc/DatabaseNameHere")).getConnection()
PreparedStatement prep = conn.prepareStatement("SELECT * FROM table WHERE id=?;")
prep.setInt(1, 1)
ResultSet set = prep.executeQuery()
if(set.isBeforeFirst()){
   while(est.next()){
      //use the data
   }
}
set.close()
prep.close()
conn.close()

Having helper methods that could be strung together to look like this:


getConnection()
   .executeQuery("SELECT * FROM table WHERE id=?;", /*ArrayList with 1 in it*/, {set-> /* use the data */})
   .close()

Inevitably the same code gets executed (and depending on how much you abstract the code, more might be executed). On the other hand, if you’re going to be making the same exact calls 200 times, that’s less code you have to write, by a lot. And if you’re working on embedded devices that’s a big plus too right? There’s also a lot less “cleanup” (in this case) that you could forget. Part of me feels like some code like this is really helpful, but part of me feels like abstracting away something or even just “wrapping” common code away could prove to be problematic later down the line if I ever try to go back and change the code.

What’s y’alls opinions on things like that? Do you do it, and if so do you have a guideline for when you allow yourself to do it or not?

There’s no harm in helper methods unless they reduce functionality. In mine and theagentd’s game engine, he usually writes complex systems that I in turn abstract and make helper methods for (so that you have the option of taking both routes for maximum customization). We’ve ran into a trouble a few times when I over-abstracted, but in cases like yours, I think you only stand to gain from simplifying it into function calls if you’re going to be doing it a lot.

TLDR; it’s helpful and OK, as long as it doesn’t hamper performance or functionality IMO

Sorry for the delayed reply, for some reason my browser showed errors everytime I tried to reply before today.

Thanks for the tips and write up! The learning process sounds fun so I’m looking forward to it. I actually bought a bunch of electronic stuff on eBay like servos and arduinos but I’ve not yet had time to fully dive in.
I did get a servo working on my c2 odroid mini computer using Java, and I wired up a laser pointer to an arduino programmed in their default IDE but that’s it.
My dream is to eventually build a remote control thing of some sort. Given my inexperience with flying I think I’ll start with a wheeled vehicle first.
Thank you for your code, very interesting. It looks like you have 7 servos on the plane judging by the code, nice!

I realized that there is a game called “Wonder Dog” for Sega CD that uses the EXACT same color scheme as mine for the title. I use ROYGBIV for the colors of the letters of “DODGER DOG”. The WIP thread title picture doesn’t reflect that, but it does in the actual title of my game. lol. Has anyone ever played Wonder Dog?

Put up Lethal Running on Steam Greenlight:

qUTHgiq4e68

Please vote :slight_smile:

I got bored programming outlines and put in some toon shading too
When I’m done today, players should be able to grab objects and have an outline around them

Daaaaaaamn, how did you pull that off in Java2D?

@Emmsii
I created a 3d Array of Voxels that have an x,y,z. Looped through using OpenSimplexNoise to get height. Set voxels under a certain height to visible. Rotated in 3d and projected to 2d coordinates.

To get the Z ordering right i just placed a pixel on a buffered image. Voxels with a higher z placed their pixel after and on top of voxels with lower z’s. This is horribly slow but i wasn’t going for performance so I used it.

please do :wink:

Been tweaking my SSR a little bit today:

The second image was inspired by a post I saw a few years ago from some SSR thread.

Awesome, I am reading Jaws right now for like the 10th time!