i think what he means is that reading a book does not make you a programmer
i think what he means is that reading a book does not make you a programmer
You can't say you know a language just because you read a book
So we had our "regional" competition in algorithmic programming.
I thought I didn't do too well but apparently I was good enough and was 22. in the country.
That would mean I would continue to the country wide competition.
UNFORTUNATELY, the guys that made the problems, solutions and evaluators. The ones that organized the whole thing can't really be proud of their intelligence.
They managed to fuck up everything that was IFuckuppable.
Firstly, the problems were visible on the site before the competition began. Then they had a correction of test samples or the problem text almost every 15 minutes during the actual competition.
And I'm not talking about grammar. I'm talking about stuff that changes a problem from coding a bignum to simple multiplication.
Then, the same solutions got different scores. Solutions that shouldn't have worked, worked and the ones that should have didn't.
THEIR OWN SOLUTIONS DON'T PASS ON THE EVALUATOR!
And I was getting so happy. Now were going to redo the whole thing on the 5th of March.
This is bullshit....
More like C#
Edited:
High, C# is literally Microsoft's version of Java.
Prove that you are the very best at that competition. Make us proud be casual acquaintances of yours.
Edited:
So it turns out that when you replaced a an already equipped item with a different one, it didn't fully unequip the original. Oops.
Well, it goes like this.
School competition where you compete with the students from your school. Then, if you score high enough, you go to the regional competition. The country wide one is next.
The things is, all of those ARE country wide, they just differ in the difficulty. So you basically have a country rank after the school competition, it just doesn't mean anything. The country rating after the regional competition determines if you are going to the final one.
I was first in my region in both Geography and German language, but they still didn't let me to go to the "country wide" competition. It was blasphemy ! It was madness !
I just hit f6 to "rebuild" the popular threads page... too much programming.
Also haven't posted anything in a while from RTS but I've made a lot of progress. Harvesting resources, basic flocking (ugly), MUCH faster pathfinding, construction, stockpiles, and a lot more.
![]()
Success!
I recursively checked the reflected rays for anyone interested. Tomorrow my plan is to fix the problem whereby the rays length is not restricted when hitting a mirror, then if all goes well i'll try my hand at refraction. All the math here is home-brewed, which i'm really proud of considering GCSE math teaches us fuck all about anything interesting!
Also, making u3ber 1337 disco's is really fun but the colour code needs fixing...
Redesigning lolnotes. So much information, so little space. Compacting the players a little bit. Removing the tabs for the different queues. Instead I will just have it display the current queue stats with the ability to switch to the others. I think I will change it to only display 5 recent games at a time. That way I can display more data like gpm.
![]()
I know the language because I read a lot that book. I dedicated myself on C this time while I was reading the book. Now I am able to learn C + +because it is a derivative of C.
See ya :)
I think you should read an English language book first.
Which region?
That's not fair, English isn't his first language iirc. At least he's trying!
Oh and, free source
http://dl.dropbox.com/u/33076954/3d.rar
It's a bit of a mess, but just follow through the engine function to understand whats going on. Uses boost::thread for multithreading, dll is included
There is a lot of commented out code, and old useless code in there. I suggest ignoring it, but its in there so i can go back and steal it in the future, or see how i did something in the past
For a quick rundown on how it works (ill take it through one frame)
Parse object initially reads and loads an object from an object (.obj) file. Doesn't support any sort of texturing, faces have to be triangles, doesn't touch the .mtl files. The obj (wavefront?) file format is pretty simply, but the corresponding function to load all my the shit i've written is abysmal. Truely, truely abysmal. Gets the job done though, but it makes me cringe looking at how terrible it is
Theres some basic input handing here. Pretty reasonable stuff, except future plans is to shove it all into the engine class to simplify starting the whole thing going. Oh, and moving the camera q and e-wards does nothing, not sure why. Ill have to check the view calculations again at some point
v3d (vector 3d) light is the light position, then we set the ambience and the light (the engine ONLY supports one light currently. Ill make a light class later and array them up, but for the moment this is fine)
Then we get to draw objects. If you want to saunter across to Engine.cpp (capitalised for extra fun), then go about halfway down to find draw_objects. You'll notice that the depthsort flag does nothing - its currently a relic from when i used depthsorting rather than the current method (which is a mix of per pixel checks, and checking several points on a triangle against the current depth buffer). The latter of that bracket is extremely imperfect, but speeds up rendering somewhat at no visual cost. The former works. The swap was made because after moving to multithreading, the draw order of triangles was no longer guaranteed. You can probably hunt down an attempted multithreading fix involving mutexes and a variable in the code, but its much too embarrassing to actually point you there
So now the current system works independently of when you draw a triangle. By the way, viewer.z is the FOV. So yes, if you look a the olist iterator, it strolls through each object and on its way starts up 4, hardcoded (oh no the evil, but doing it properly would waste much time) threads to process a 1/4 of the vertices/triangles/faces from the object each
So move up a bit nearer the top of the file, until we get to add_objects. tb is the triangle to begin at, and te is the triangle to end at, and T is obviously the object we are parsing. After some wonderful view calculations on all of the vertices, where you can see the old gouraud cosine-lambert what have you lighting vertex thing all /* */'d out. The vertexes get shoved into a triangle for no proper reason, then after all 3 vertex are put into a triangle, they get added to a separate triangle (i should stop it doing that. Why is it doing that? i should just pass n to shape_handler). Anyway. You'll see shape handler down below, and some failed multithreading attempts. Technically they succeeded, but it turns out that for some, strange reason, spawning thousands of threads per second is actually surprisingly slow!
Shape handler pretty much instantly goes to triangle_shape::compile, so make your way over to triangle_shape.cpp and scroll about halfway down.
This function is a bit of a mess because its edited reasonably often, but not as bad as triangle_fill_d
essentially it checks if any of the vertices are off screen (could probably do it better with a min/max, but this works for now), checks to see if all of the corners, the center, and the points between the center and the corners are all blocked from view. If they are, dont bother with the triangle because it's completely occluded (most likely)
Oh, and perpixel is completely obsolete as well, because it does per pixel checks anyway, and just returns if a triangle is off the screen. The if(quit) return is completely useless as well, but i havent gotten around to removing it yet. There it goes.
Triangle_fill_d is where all the exciting things happen. Its in common.cpp, about 1/3rd of the way down. Probably doesn't deserve to be in common, but for the moment it'll live. It gets passed 3 vertex positions, perpixel (obsolete), screenwidth and screenheight (both obsolete and 0). This function has been rewritten so often that its a complete and utter mess.
So it starts off, finds the minimum/maximum points of the triangle (hooray for squares), then finds the area. Fairly standard. t1 is H, which is the half vector something something something lighting. Google it if you find it that exciting. Ideally, i only need to calculate it once per frame. Thats going to get integrated into my lighting class though, so for the moment s'alright being calculated once per drawn triangle
The form function calculates the area given three points and.. something which i forget. I have no idea. All i know is, its a terribly, terribly written function, and takes up a lot of processing time. I should write it into the code and simplify the whole thing a bit, but see above with regards to it not being the most important thing
So a pixel is determined to be in the triangle when it is roughly (floating point hooray) equal to the area determined at the beginning of the function, helpfully named area. Half, if you look at the comments, was originally an attempt to create fuzzy triangles (and thus edge smoothing), but i gave up on that after i realised it was a lot of hassle.
Scrolling down a bit further, past some more random commented out code, youll find the meat of the interpolation code for normal positions, and depth. I have no idea how that works, i pulled an equation off the internet then used a simultaneous equation matrix solver (or something) to sort it all out for me. Gives me the smoothed values i want, but if anyone knows of a better solution i'd love to know it. This is the actual Phong interpolation in phong shading, by the way
Scrolling a bit further downwards, you'll see the various shading methods that can be implemented by messing around with the comments. The comments are just there to remove code, not to remove it in an orderly fashion, so youll have to think for about 5 seconds if you want to enable the one embedded in the middle of cook-torrence (//'d out). The one currently in operation there is beckmann. I picked that one because why not, looks nicer than phong, runs better (much) than torrence-cook
add the ambient light to the diffuse light, to the specular light, you get light. Seeing as everyhting is white for the moment, i just multiplied that by 255 and slapped that straight onto the colour/depth buffer (after a depth check).
Moving back into Engine.cpp, and Engine::draw_objects, scrolling past the vast amount of commented out, poorly multithreaded and generally inefficient code, youll see the variable clear actually does something and cleares and draws the screen if true (otherwise just draw the screen). The draw fill here is a memory bandwidth limited operation, and there didn't seem any benefit in multithreading it much, so it runs in 2 threads for fun
Anyway. After that, SFML takes over and draws everything from the colour buffer to the screen. And then after that, the buffer is flipped (somewhere else)
Hooray. Long post, hope i bored you to death and you didn't learn anything about how to program well, efficiently, and above all, in a fashion that doesn't look atrocious
Just waiting my classes back. English classes are waiting for me. XD
What?
Splitsko-dalmatinska županija.
oh god i can't believe actually just wrote this
Code:$rating = $ratingArr['rating']; if ($rating == '1') $oneStar += 1; else if ($rating == '2') $twoStar += 1; else if ($rating == '3') $threeStar += 1; else if ($rating == '4') $fourStar += 1; else if ($rating == '5') $fiveStar += 1;
I generally find switch statements to be unwieldy, and offer no real performance gain for a small number of possibilities. An else if chain can work perfectly well, especially when the most likely possibility is the first one checked. Of course, when you're dealing with a larger set of possibilities, it makes more sense to use switch.
The syntaxes and features are very similar.
For instance, compare a hello world in C#:
to one in Javausing System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine("Hello, world!"); Console.ReadLine(); } } }
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } }http://en.wikipedia.org/wiki/C_Sharp...guage)#HistoryWikipedia posted:
http://en.wikipedia.org/wiki/Compari...Sharp_and_Java
Not sure if good or bad...
The value went up really fast, then overflowed (what i assume)
![]()
I am drawing little flowers :)
![]()
i'd believe it
point is, i can just use $rating as an index into an array
Shift click lets you build the same building type consecutively without having to go through the menu again (not shown), and stockpile types!
![]()
So I've had an Android phone for over a year, and while learning Java I tried to touch on Android development many times and faltered.
Now that I feel I'm comfortable with Java, I'm going head-first into Android starting at the top, and I'm already loving it. I forgot the thrill of learning something completely new and challenging, and learning how this OS works is actually kind of exciting.
I expect to have regular progress to show :)
I can what not to good loo.
wouldn't $star[$rating] += 1 or something have worked
Yeah seriously, who hard-codes "one" "two" "three" variables, wtf
Null himself pointed that out.
yeah, I'm all for occasionally picking on null but this is something he admitted himself.![]()
well it's php, so.......
It almost seems as if he was a nullpointer
You can start directly from C++. Learning C before attempting to C++ is waste of time. If you really want to know behind the scenes learn assembly,binary etc.
Oh no, I agree about that but I don't get why you said more like C# because it's java and not C#, unless you where trying to point out their similarities then ok.
It's not a waste of time. You need to know a lot of how C works to understand what C++ does, since it's built on C. On the other hand, you can learn a VM language like Java or C# without learning anything else.
Binary is not a programming language.
Did he explicitly say it was?