The Big Programming Thread - Page 802
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
![]()
TanGeng
Sanya12364 Posts
| ||
Manit0u
Poland17186 Posts
On November 24 2016 00:15 tofucake wrote: ![]() some of our devs need to learn how to manage their queries :\ That seems really small compared to what I deal with on a daily basis... One page doing 1.6mil requests in 21 seconds, another one doing 3 requests in 39 seconds... | ||
emperorchampion
Canada9496 Posts
On November 23 2016 16:16 Acrofales wrote: I believe the solution is: self.remove_meth() ![]() If only that worked IRL :/ | ||
Cyx.
Canada806 Posts
On November 23 2016 13:23 WarSame wrote: I'm making a dungeon game and my trolls around running around like they're on meth. I can't figure out how to calm them down. This is in pygame. The heartbeat: def run_game(self): where draw_screen is def draw_screen(self): The problem is that I can make the trolls slow down by increasing the wait time between game cycles, but then the player moves too slowly. I'm looking for a fair way to slow down how frequently the trolls move. Any ideas? Maybe I'm misunderstanding this, but I think what you want to do is often done by measuring how much time has passed since the last frame, and passing that value into your `move_creatures()`. Then you can scale that by movement speeds to get movement amounts:
| ||
Manit0u
Poland17186 Posts
| ||
![]()
tofucake
Hyrule18968 Posts
On November 24 2016 01:01 Manit0u wrote: That seems really small compared to what I deal with on a daily basis... One page doing 1.6mil requests in 21 seconds, another one doing 3 requests in 39 seconds... Yeah but 7 million people doing it on the landing page after login :| | ||
Acrofales
Spain17831 Posts
On November 24 2016 02:50 tofucake wrote: Yeah but 7 million people doing it on the landing page after login :| I hardly ever visit the landing page. Does that solve your problem? | ||
![]()
tofucake
Hyrule18968 Posts
On November 24 2016 04:17 Acrofales wrote: I hardly ever visit the landing page. Does that solve your problem? On our website you have to login to see anything (it's a reimbursement program thing) so everyone always sees the landing page. | ||
WarSame
Canada1950 Posts
On November 24 2016 01:46 Cyx. wrote: Maybe I'm misunderstanding this, but I think what you want to do is often done by measuring how much time has passed since the last frame, and passing that value into your `move_creatures()`. Then you can scale that by movement speeds to get movement amounts:
The creatures all move discrete distances. They have a speed, such as 1 or 2, and move that many squares per turn. Otherwise, yeah, that would make sense. On November 24 2016 01:59 Manit0u wrote: Have you tried tinkering with the frames? If I remember correctly you can speed up/slow down the game via the frames setting. Yup. The frame rate is set to a maximum of 60 FPS, and it runs at that on my computer. If I lower that, then they move slower, but the player also now can move multiple times per draw. So I'm looking for a way to slow only the trolls down, without effecting the rest of the game, if that's possible. On November 23 2016 13:49 meatpudding wrote: Lots of ways to do this. In move_creatures you could add a counter like this counter += 1 This seems like a possibility. I'll give it a shot. Thanks! | ||
Blisse
Canada3710 Posts
On November 23 2016 23:17 Nesserev wrote: SMALL RANT I'm really frustrated with the 4th Edition of 'The C++ Programming Language' by Bjarne Stroustrup. I loved the Special Edition, but it seems like the magic was lost a bit in this edition, and there's one thing that really fcking triggers me... Uniform initialization... AKA ugly squiggly braces from hell... they're fucking ugly as shit, and the book is full of it. This might sound dumb and shit, but it really ruins an otherwise perfectly good book for me. END OF RANT I actually really like the way C++ uses initialization lists. Everyone I show is like, whoa, neat, and it's very clear what its purpose is IMO. Also getting more usage in C++17 too so it's basically here to stay. What's wrong with the book? | ||
Manit0u
Poland17186 Posts
On November 24 2016 05:21 Blisse wrote: I actually really like the way C++ uses initialization lists. Everyone I show is like, whoa, neat, and it's very clear what its purpose is IMO. Also getting more usage in C++17 too so it's basically here to stay. What's wrong with the book? I agree that uniform initialization actually makes C++ a lot more concise and the code easier to write and follow. I see nothing wrong with that. | ||
Nesserev
Belgium2760 Posts
| ||
Manit0u
Poland17186 Posts
Kill me... | ||
icystorage
Jollibee19343 Posts
sweet baby jesus | ||
BluzMan
Russian Federation4235 Posts
On November 24 2016 14:17 Nesserev wrote: There's nothing wrong with the book, and I don't mind when initializer lists are used for actual "lists" (e.g. vectors, strings, etc.). But I genuinely dislike the use of the first line over the second. int i {0}; And the book is full of lines like the first one... that's all. This just feels so unnecessary... it's the only C++11/14/17 feature that I can think of that I really dislike. Curly brackets as a habit save you from the dreaded vexing parse. | ||
BluzMan
Russian Federation4235 Posts
On November 24 2016 22:23 Manit0u wrote:
Kill me... Why would anyone write PHP these days? Quick and dirty stuff can be done with Node, and "proper" PHP looks a lot like a worse version of Java. | ||
Blitzkrieg0
United States13132 Posts
On November 25 2016 06:52 BluzMan wrote: Why would anyone write PHP these days? Quick and dirty stuff can be done with Node, and "proper" PHP looks a lot like a worse version of Java. Because PHP has the biggest market share so if you're maintaining a system it was probably written in PHP. | ||
Manit0u
Poland17186 Posts
On November 25 2016 06:52 BluzMan wrote: Why would anyone write PHP these days? Quick and dirty stuff can be done with Node, and "proper" PHP looks a lot like a worse version of Java. "Proper" PHP app can be developed much faster and much cheaper than its Java counterparts while still adhering to all the "enterprise" bullshit. Also, I'd rather do PHP than JS or, gods forbid, Java... (I know, I'm biased but Java is actually at the bottom of programming languages I'd like to work with and I've tried out quite a lot of them over the past years) | ||
Birdie
New Zealand4438 Posts
| ||
Manit0u
Poland17186 Posts
On November 25 2016 09:47 Birdie wrote: Anyone know of some good quality starter resources for responsive web design? Not using any libraries like bootstrap. Bootstrap is probably the best for starters since many products are using it and many other libraries are based on it (foundation, materialize, etc.). As an added bonus you have plenty of resources for that online. May I ask why no libraries? There is very little point to reinventing the wheel if it's not absolutely necessary. What kind of resources do you need exactly? General tips and tricks? Something like Google's material design guides? html5rocks? csstricks? | ||
| ||