1. The Functionality of code, how you approached different problems and how efficient your code it.

Not differences that don't make any changes in compiled state

like

```void myfunc() {
// Do stuff
}

// vs

void MyFunc()
{
// Do stuff
}
```
Where do you work that they let you use whatever coding style you want?
Agree x 2 Optimistic x 1 (list)

2. Code:
```19:03 - |TzC| The Cupid Stunt: i know
19:03 - |TzC| The Cupid Stunt: but this is a pretty simple gamemode
19:03 - |TzC| The Cupid Stunt: this is the hardest part of it really
19:03 - |TzC| The Cupid Stunt: and i have made a full game before
19:04 - |TzC| The Cupid Stunt: so i though why dont i just go ahead and make a gmod gamemode
19:04 - King Flawless: What did you make the game in?
19:04 - |TzC| The Cupid Stunt: gamemaker```
:barf:
Funny x 28 (list)

3. That doesn't make any sense, GWEN is in C++
how is this so dumb

Edited:

Argh fucking point doesn't wanna unproject

-snip-

note to self, "divide by w" applies to unprojection too
Dumb x 2 (list)

4. So I ported my GLSL helper thing to WPF and I'd appreciate it if someone could try it with Mono.
It has some stuff that I'm not sure if Mono supports.

http://anyhub.net/file/2V9W-glslhelper.rar

5. Blogged about how other people's coding annoys me
yeah one thing i really hate is when people use hungarian notation in lua.

Edited:

OH WAIT
Zing x 19 Dumb x 2 Winner x 1 Funny x 1 (list)

6. So I'm working on my first opengl application, and I got this piece of code to choose a pixel format in windows.
Code:
```	int pixAttribs[] = { WGL_SUPPORT_OPENGL_ARB, 1, // Must support OGL rendering
WGL_DRAW_TO_WINDOW_ARB, 1, // pf that can run a window
WGL_ACCELERATION_ARB,   1, // must be HW accelerated
WGL_COLOR_BITS_ARB,     24, // 8 bits of each R, G and B
WGL_DEPTH_BITS_ARB,     16, // 16 bits of depth precision for window
WGL_DOUBLE_BUFFER_ARB,	 GL_TRUE, // Double buffered context
WGL_SAMPLE_BUFFERS_ARB, GL_TRUE, // MSAA on
WGL_SAMPLES_ARB,        8, // 8x MSAA
WGL_PIXEL_TYPE_ARB,      WGL_TYPE_RGBA_ARB, // pf should be RGBA type
0}; // NULL termination

// Ask OpenGL to find the most relevant format matching our attribs
// Only get one format back.
wglChoosePixelFormatARB(g_hDC, &pixAttribs[0], NULL, 1, &nPixelFormat, (UINT*)&nPixCount);```
However, that leaves me with an error that it cannot find a matching pixel format. However, if I remove the hardware accelerated option it finds a pixel format but nothing gets rendered at all. My graphics card supports Opengl 3.3, and the drivers are up to date. Any ideas? I'm very new to opengl so it might just be something really stupid.

7. I remember something in this thread about a terraria widescreen prog with fixed hug placements, but I can't find it anymore, anyone have a link?

8. Missed you FP :love:
Apparently, it didn't miss you.
Friendly x 5 Agree x 3 Zing x 1 (list)

9. So I ported my GLSL helper thing to WPF and I'd appreciate it if someone could try it with Mono.
It has some stuff that I'm not sure if Mono supports.

http://anyhub.net/file/2V9W-glslhelper.rar
Code:
```\$ mono GLSLDebugHelperWPF.exe
The entry point method could not be loaded```
It works fine on other programs, I also have the newest version (2.10).

10. I just found out about C++0x.
```#include <string>
#include <vector>
#include <iostream>

using namespace std;

vector<string> awesomeface = {
"HI THERE",
"Whuzup",
"HAHAHA",
"this is stupid",
};

int main(){
for(string& s: awesomeface){
cout << s << endl;
}
}
```
Late x 1 Dumb x 1 (list)

11. :(
I couldn't get Avalon syntax highlighting on WinForms.

12. How do you not know what XNA does?
Also had no idea what GWEN was.

Total herp derp moment on my part.

Edited:

So I'm working on my first opengl application, and I got this piece of code to choose a pixel format in windows.
-snip-
However, that leaves me with an error that it cannot find a matching pixel format. However, if I remove the hardware accelerated option it finds a pixel format but nothing gets rendered at all. My graphics card supports Opengl 3.3, and the drivers are up to date. Any ideas? I'm very new to opengl so it might just be something really stupid.
Replace the 1 after WGL_ACCELERATION_ARB with WGL_FULL_ACCELERATION_ARB
Dumb x 2 (list)

13. Lack of an internet connection from my desktop PC for the last couple of days sort of brought my regular programming stuff to a halt and I had been admiring high's work on a Terraria map renderer a few pages back right before I lost connection, so today I decided to give one a shot as well.

Having never messed with anything related to 2D games (sprite sheets, etc.), it was quite fun to do!
Only things left to work out are tile "styles" (which is probably the biggest thing of the whole lot), better colours for the liquids and proper background transition points (it'll probably only work on a Small map at the moment).
It renders into 1200px x 1200px tiles currently, rather than a single large image.

Some earlier renderings: http://dl.dropbox.com/u/6938670/Terr...orld1_test.png http://dl.dropbox.com/u/6938670/Terr...rld1_test2.png http://dl.dropbox.com/u/6938670/Terr...rld1_test3.png
Rendering using the current code of the column around my house: http://dl.dropbox.com/u/6938670/Terr...rariaHouse.png (Warning, it's big.)
"Deep Zoom" image of the full map (this is currently using older code, it's rebuilding right now): http://fennec.limetech.org/terraria
Programming King x 3 (list)

14. Does anyone know of a method to weigh nodes with 2-dimensional (or more general) coordinates so that their barycenter is a given point?

Mathematically

$\sum _{k=0} ^n {a_k \cdot \overrightarrow{v_k}} = \overrightarrow{S}$

How does one determine the multipliers a(k)?

(Quite clearly there are an infinite amount of solutions except for perhaps some special cases - but just one will do for me)

Edited:

Or does anyone know anything about this problem? How hard is it? Can it be reduced to some other problem?

Edited:

Oh wait, I just realized that's actually a very simple problem. Nevermind then

15. Does anyone know of a method to weigh nodes with 2-dimensional (or more general) coordinates so that their barycenter is a given point?

Mathematically

$\sum _{k=0} ^n {a_k \cdot \overrightarrow{v_k}} = \overrightarrow{S}$

How does one determine the multipliers a(k)?

(Quite clearly there are an infinite amount of solutions except for perhaps some special cases - but just one will do for me)

Edited:

Or does anyone know anything about this problem? How hard is it? Can it be reduced to some other problem?
I've never heard of this problem before, but aren't there an infinite number of solutions there?
As a heuristic, couldn't you give them all a weight of 1 initially, find S', then take the difference of S and S' to determine which way center of mass has to move? You could probably take the dot product of this difference vector and each v_k to determine a weight adjustment factor and repeat the process in an iterative fashion, with smaller adjustments each iteration.

16. I've never heard of this problem before, but aren't there an infinite number of solutions there?
As a heuristic, couldn't you give them all a weight of 1 initially, find S', then take the difference of S and S' to determine which way center of mass has to move? You could probably take the dot product of this difference vector and each v_k to determine a weight adjustment factor and repeat the process in an iterative fashion, with smaller adjustments each iteration.
That's actually the definition of a system of linear equations where v_k are the coefficients, a_k are the variables and S is the desired result. (Though in most formal math you would see k start from 1, but that's just nitpicking)

Edited:

And yes there are an infinite number of solutions if n exceeds the dimension of the space you are working in.
Winner x 4 Agree x 1 (list)

17. Beaten to it.

Edited:

It was much harder in my mind when I was thinking of all kinds of stuff like how you'd do some weird gradient shit with the nodes etc. and just writing the definition out made me realize how easy it was

18. Working on serializing my game world into a file so i can make levels

19. Crossposting from WDYNHW:

So I'm still trying to convert BBcode to JSON, and still no further. My regex really sucks.

I'm trying to turn this:

This is some text.

[url=http://example.com]This is a URL[/url]

This is an image:

[img]http://lol.com/lol.png[/img]

That was an image. Here's a YouTube video:

[media]video-id-here[/media]

[b]This is some bold text.[/b]

Into this:

Code:
```{
"tags":[
{
"text":"This is some text.\n\n"
},
{
"url":{
"content":"This is a URL",
"href":"http://example.com"
}
},
{
"text":"\n\nThis is an image:\n\n"
},
{
"img":"http://lol.com/lol.png"
},
{
"text":"\n\nThat was an image. Here's a YouTube video:\n\n"
},
{
},
{
"text":"\n\n"
},
{
"b":"This is some bold text."
}
]
}```
Any suggestions? Doing this in PHP, by the way, as part of vBulletin, so all it's functions are available for use.

20. Um, the whole point of WDYNHW is so that WAYWO isn't littered with questions like this...
Agree x 11 Zing x 2 Disagree x 1 (list)

21. Um, the whole point of WDYNHW is so that WAYWO isn't littered with questions like this...
True, but most of the questions in WDYNHW are rather simple, figured this was more of a challenge.
Dumb x 16 Disagree x 1 (list)

22. Is the post limit per thread capped at 3.5k now? If so, who's making v18?
Late x 1 (list)

23. Is the post limit per thread capped at 3.5k now? If so, who's making v18?
go for it
Agree x 5 (list)

24. i have an op ready but anyone else wants to make it go for it.

Edited:

oops i didn't save it nevermind then!
Funny x 5 (list)

25. deloc you've made the last 3, let someone else have a turn!
Agree x 6 (list)

26. Where's that automatic thing Overv made..
Disagree x 1 (list)

27. Where's that automatic thing Overv made..
i don't know, which is why i just go through posted images and pick out anything that looks interesting.
Agree x 2 Optimistic x 1 (list)

28. Where's that automatic thing Overv made..
I'll let it run on this thread.

Edit: Here you go.
Useful x 1 (list)

29. Thanks, but you posted that link literally a second after I trawled through every page.

Oh well, it didn't take too long, it's amazing how many pages of content there aren't.

Unfortunately, I must go to bed now - but here is what I've come up with.
Friendly x 1 (list)

30. I love how easy .NET makes this
Programming King x 1 (list)

31. Thomas thats a nice OP! <3

32. Thomas thats a nice OP! <3
Isn't the max post count 5k, why are we talking about v18 right now?
Disagree x 5 (list)

33. I'll let it run on this thread.

Edit: Here you go.
It goes by artistic ??
Dumb x 1 Funny x 1 Disagree x 1 (list)

34. Isn't the max post count 5k, why are we talking about v18 right now?
Nope. 3.5k now.
Agree x 1 (list)

35. Implemented a little neural network thingy during the last 2 hours.. using backpropagation for learning.
Results look promising already, will have to do some more testing when I find the time :D

```// Generate network with 2 input neurons and 1 output neuron
final Network network = NetworkFactory.generateSigmoidNet( new int[] { 2, 4, 4, 1 } );

// Teach the network to act like a logic AND gate
System.out.println( "Pre test 0,1 -> 0 ");
network.setInputValues( new double[] { 0, 1 } );
network.dumpOutput();

System.out.println( "Pre test 1,1 -> 1 ");
network.setInputValues( new double[] { 1, 1 } );
network.dumpOutput();

final int steps = 1000;
for ( int i = 0; i < steps; i++ ) {

final double learningRate = 1.0 - ( i / (double)steps );

network.setInputValues( new double[] { 0, 1 } );
network.learn( new double[] { 0 }, learningRate );

network.setInputValues( new double[] { 1, 1 } );
network.learn( new double[] { 1 }, learningRate );

network.setInputValues( new double[] { 1, 0 } );
network.learn( new double[] { 0 }, learningRate );

network.setInputValues( new double[] { 0, 0 } );
network.learn( new double[] { 0 }, learningRate );

}

System.out.println( "Post test 0,1 -> 0 ");
network.setInputValues( new double[] { 0, 1 } );
network.dumpOutput();

System.out.println( "Post test 1,1 -> 1 ");
network.setInputValues( new double[] { 1, 1 } );
network.dumpOutput();
```

Resulting in:

Code:
```Pre test 0,1 -> 0
Layer  3:	[0] = 0,84,
Pre test 1,1 -> 1
Layer  3:	[0] = 0,84,

Post test 0,1 -> 0
Layer  3:	[0] = 0,04,
Post test 1,1 -> 1
Layer  3:	[0] = 0,95,```
Winner x 2 Artistic x 1 Programming King x 1 (list)

36. Rated artistic because I don't know whats going on.
Dumb x 2 Funny x 1 (list)

37. Rated artistic because I don't know whats going on.
you dont need to tell us everytime you rate artistic.

Also managed to fix the problem i was having, boxes for everyone

It also takes into account mass so some objects can fall faster thna others
Dumb x 12 Artistic x 1 Funny x 1 (list)

38. C++ Primer Plus is awesome. I'm gonna try to make a little game where you explore a dungeon, but I can't decide on how to store the map: 2D arrays or just have several blocks. With several blocks I could enable destruction and generate random dungeons easily, while with 2D arrays I'm not sure. Should I go for 2D arrays or just instances?

Edit: And my idea is just like the game below. Damn.

39. My roguelike still isn't dead. :buddy:

I don't even remember adding the Combustible Lemon enemy. Must have been post-Portal 2's release, though.

Anyway, added a lot of stuff I can't really show...

The "Unthreatened" text on the bottom right changes depending on the situation. For instance, if your character has taken a lot of damage it will change to "Wounded", or if he's dead it'll change to "Deceased". Added a ton of items and monsters, as well.

Another neat feature is that if you stay on a particular level for an extended period of time, the game will spawn a "motivator monster" which is almost impossible to kill, forcing the player to descend and therefore stops excessive grinding. There is forewarning, though, so it's not completely cheap. In this case the "Unthreatened" text changes to "Endangered."

Also, I'm aware I misspelled "combustible". Heh.
Winner x 7 Funny x 1 Artistic x 1 (list)