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
leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

durtan posted:

So would it make sense to create an int variable from the double variable?

Edit: Doesn't seem to make a difference. Creating an int variable from the float variable gives me the right number but I'm still counting 5 coins instead of 4. Adding a <= 0 check at the beginning of the for loop and getting the coins variable to increment in each else if statement doesn't seem to give me the right answer either.
code:
#include <stdio.h>
#include <cs50.h>
#include <math.h>

int main(void)
{
//get money
    float money;
    int money1;

    do
    {
        printf("Give me some money: ");
        money = GetFloat();
        money1 = money*100;
    }    
    while (money <= 0);
    
{
    int coins;
    
    for (coins=0; money1 > 0;)
 //check zero
        {
            if (money1<=0)
            {
            break;
 //check quarters
            }
            else if (money1%25==0)
            {
                money1 = money1 - 25;
                coins++;
            }    
 //check dimes
           else if (money1%10==0)
           {
                money1 = money1 - 10;
                coins++;
           }     
 //check nickels
            else if (money1%5==0)
            {
                money1 = money1 - 5;
                coins++;
            }    
 //check pennies
            else if (money1%1==0)
             {
                money1 = money1 - 1;
                coins++;
             }   
         }       
 //return coins
    printf ("%d\n", coins);
}   
    }
Still gives me five coins instead of four when I enter ".41".

I think what he's trying to get at is floats don't necessarily behave exactly as you think they will. Generally, it's considered a best practice to store monetary information in fixed point form because $CASHMONIES * $SOME_VAL / $SOME_VAL may not return the desired result. Machine epsilon, etc.

Adbot
ADBOT LOVES YOU

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Tusen Takk posted:

I ended up emailing the prof who said that he had a feeling it would start to be an issue and that he'll just grade it from VS.

Thanks for the help duders

You should probably just write standard compliant code and not rely on anything implementation specific. And if your class doesn't support c++0x/c++11 just deal with it and write code that is supported. It shouldn't be too difficult to get your local compiler flags to match your course.

Or just remote in for all of your assignments.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

22 Eargesplitten posted:

Okay. Looking at a presentation and document about how they made Dungeon Siege, that looks to be what they did, although back when that came out they only had two threads to work with. I've been looking for more, but right now that's all I've found. My current thought is to have two threads in a pool and one thread independent that's dedicated to loading and removing entities. This mod is for Stalker, which isn't technically an open world game, but has zones that take several minutes to run across at a full sprint. If I used std::async, would I still have to do a lot of locking to keep the processes being run from the pool from data racing? I'm thinking I would keep all of the stuff loading and being removed locked, but I'm not sure if the async function does that for you.

I hope it's okay to keep posting questions about stuff that will be used in a game here rather than the game development thread. I feel like questions like these are more specifically about the workings of C++, while most of the stuff in the gamedev thread is about how the game editors work.

You should lock or otherwise prevent data races, yes. You have no guarantees that the scheduler won't do exactly what you don't want it to do. From a practical standpoint though, if you know there will be a few minutes between when writing the data should end and reading it back should begin, the likelihood of running into an error is low. But when the solution is so simple, it's hard to see why you wouldn't want to be sure.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Chuu posted:

Either is fine, compile time strongly preferred.

-Werror is something else I can't enable for really stupid reasons outside of my control.

(I'd settle for a CMake hack if this really isn't possible in code.)

Can you not set up Werror locally? I'd probably do that and then blame the changes..

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Hubis posted:

Well, you could add a "COUNT" value at the end of the enum, then do a static_assert to ensure the enum::COUNT equals whatever number you expect elsewhere in the code.

Doesn't catch people dumping things into the enum past count, which seems like the likely place to dump new things into an enum.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Doc Block posted:

If your application is GPL or LGPL (OP said it's an open source application), then I don't see why you couldn't just put the class files in your project and call it a day.

"Users" will still be able to swap out the KDE stuff with a newer version or whatever since the source will be available, etc

edit: has anyone ever actually swapped out a .DLL or .framework or whatever of an LGPL library that shipped with a closed-source application?

Because the GPL is a legal virus that you may not want your code infected with? You can't just copy pasta code like that without thought.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Ralith posted:

Yes, that is indeed why we have function overloading!

Are you really trying to say that templates are generally bad and should be avoided? Because that goes starkly against conventional wisdom and much of the best laid out code I've seen.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Ralith posted:

Introducing new templates is bad should be avoided when it's unnecessary, which is indeed most of the time. Having powerful metaprogramming available is wonderful, but it should always be your last resort, and if that's contrary to your understanding of conventional wisdom I don't know what to say.

The only things necessary for most functions are NOR and JMP, maybe some operators for reading/writing memory. That doesn't mean I shouldn't prefer the tools available to me that make things cleaner.

Generics are one of the features C++ has over C. I suppose you're also against smart pointers, custom allocators, and other things that generally make life pleasant?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
That could easily be the case. I'm a bit tilted because I just inherited a JavaScript project. :smithicide:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Xarn posted:

Assuming that you want to have a tree of either nodes with parent pointers, or nodes without parent pointers, not mix and match, it is definitely possible, but kinda painful in C++14 (and pre C++14 as well). You will end up writing the code twice, using template specialization.

It should be p. easy in C++17, but thats not quite out or production ready yet.

I think you could do it with the policy based design template template parameters outlined in Alexandrescu's Modern C++. Is that what you're referring to, and if so what's coming in 17 (I haven't been keeping up)?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Love Stole the Day posted:

This isn't a question but since there doesn't seem to be a C/C++ megathread to post this in afaik... I wanted to share this really creative C/C++ program that detects with version of C or C++ you compiled it in and outputs different things accordingly:



Here's where I found it: https://kristerw.blogspot.com/2016/07/code-behaving-differently-in-c90-c99.html

IOCCC is cool and good.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

raminasi posted:

Yes, but your wrapping function can be a named function. No need for a lambda.

On the other hand, is there a need to name the function if you're only using it there?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
I know in vim you can just do :make and it builds stuff and opens the quick fix. I'd expect ST to provide hooks as well, but I've never used it.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

VikingofRock posted:

Is there a standard way to do RAII with temporary files, either in the STL or in boost? I could roll my own, but I'd rather use an accepted approach if possible. This is on unix and has no need for portability with windows, if that matters.

You mean like make a file named by a UUID generated in the constructor and then destroy that file in the destructor?

Don't really think there's a standard way to do that. Though there are a few standards on generating a UUID and making a RAII UUID-named temp file would be pretty simple.

Depending on what you want the file for, you may want some other filelike object instead, like a FIFO.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

VikingofRock posted:

I should mention that I actually do need the filename, since I need to pass it to a subprocess. If there's no standard way of doing this, maybe I'll just write an RAII wrapper around mkstemp. Thanks anyways.

Are you trying to send data to or from the subprocess? Use a FIFO.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

VikingofRock posted:

So as to avoid the XY problem, I'm just gonna type out the full thing I want to do: I want to create a file, write some data to it, and then call a third-party command line utility which takes the name of the file as one of the command line arguments. That process uses the data in the file to do some analysis, and then it prints the result to stdout, which I am then reading and using in my main program. I want to make sure that the file gets deleted so that I don't have a bunch of these cluttering up the filesystem. I'm gonna be doing this O(10,000) times, across O(100) threads, and the program might get killed at any given moment because of the way that job management works on the supercomputer I'm running this on.

I think what I said before will let me accomplish this, but it's entirely possible I am missing something fundamental here, so let me know if it sounds like that's the case.

Pretty sure that's what FIFOs are for. They're like files in the file system except they don't get written to disk so the performance characteristics should be much better. If you're doing this 10k times, it probably matters.

https://www.freebsd.org/doc/en_US.ISO8859-1/books/design-44bsd/overview-io-system.html
2.6.1

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

ufarn posted:

I actually think IDEs make things a lot worse when it comes to picking up a new language. Maybe if it's the first time you try coding and want to move a turtle in different directions, but all the magic involved in creating external classes in C++ is one of the things that really put me off IDEs. I don't have a problem with using them for programming in general, I just don't see the point of programs where you struggle to even find the build button.

IDEs make it easy to find the build button. It looks like this: |>

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

rjmccall posted:

Copy-on-write strings are a really interesting case.

C++ programs back in the day used to do a really ridiculous amount of copying. That's been somewhat addressed with C++11 and move semantics, so now the level of spurious copying in a typical C++ program is just "too high" instead of "wildly excessive", but of course that's new to this decade. Strings in particular tend to have a fairly simple lifecycle of being built up / broken down in a single step and then copied all over the place; and the STL provides an obvious API for building up a string (stringstream) that in theory ought to be preferred over repeated += and have significantly better performance. So the basic idea of optimizing for copies over direct mutation is actually a pretty sound one. Of course, people who set out to write a "string benchmark" in practice end up writing something that just bangs on mutations instead of reflecting the real workload on the type, but whatever.

The problems are:
  • The language completely betrays copy-on-write types; all sorts of logically non-mutating operations end up looking like mutations in the type system. For example, code like std::string str = ...; char c = str[0]; invokes a non-const subscript operator and thus would naturally do a unique-and-copy check unless you do a lot of complex proxying (which you can't necessarily do with, say, iterators).
  • Copy-on-write reference-counting has to be atomic in a multi-threaded process. Atomic increment/decrement used to be really expensive, even for completely uncontested accesses (typical for copy-on-write data structures). This is much less true now; it's closer to one order of magnitude more expensive than two. But people mostly formed these opinions back then.
  • Streams in the STL are a very bloated and inefficient abstraction; what in principle could be as efficient as "prepare a buffer, append all these things to it, and do a little tidying when you're done" ends up doing a lot of dynamic crap, so just using += is actually seen as a major optimization.
  • Copy-on-write strings aren't really friendly to a small-string optimization because it would add another dimension of complexity to an operation that's already pretty complex. Small-string optimizations can be a major win just from doing less allocation. They also cut down on the costs of spurious copies, since spurious copies of small strings are cheaper and spurious copies of large strings are more likely to be algorithmically significant enough to skew a profile.
  • Copy-on-write types benefit a lot from a specialized optimizer that's aware of them, but library-specific optimizations are not common in C++ compilers.

^a good post. :five:

Not using std::string (or wstring, ..) has been a pretty strong leading indicator that I'm going to be dealing with a house of horrors. At least for projects started in the past 5-ish years. It's very easy for people to write things that are less performant and more broken when they think dealing with strings is easy and people who wrote the STL are obviously dumb because they read something like that but far more nuanced on the internet once.

As with all things, it's not a problem until you've benchmarked. If you aren't in a place where you can benchmark and you don't have a suitable replacement with several years of industrial use behind it, you have better things to be working on than std::string being too slow for your non-extant application.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Beef posted:

Klade's code went from not fitting on my screen to a handful of readable lines, cool.

My little nitpick would be to just do
code:
assert( sequence.size() > 0);
though.

The space after the ( is upsetting. Doubly so because there isn't one after the 0.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Nehacoo posted:

Yeah I am sure that is it, I tested their new version in the hopes that they had improved this, but nope.
Anyway I am now on a quest to find a decent C++ development setup on Linux. Based on good words I've heard I'm trying KDevelop right now and it seems okay I guess? But the syntax highlighting settings seem to Just Not Work and now I'm stuck with terrible rainbow vomit.
I'll try Qt creator as well, that one seems popular.

What I need: CMake integration, vim bindings, quick documentation lookup, go to definition, rename. If spending a day configuring vim plugins will enable that then that's fine too.

clang, vim, and at least for small/mid size projects youcompleteme is good, but i'm not sure if it works well with large projects. i also like syntastic.

lldb/gdb or whatever graphical frontend thereof you prefer for a debugger

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Slurps Mad Rips posted:

We have a several million line code base at work and not a single person uses an IDE. 5 vim users, and one guy using emacs.

I also don't personally use an autocompleter because I've discovered 9/10 times it just gets in the way and slows me down from what I want to do. A "go to definition" tool by itself is more useful.

i like having the docs window pop up if i start tabbing through completion lists though, saves me effort on looking things up on the other screen. if it ever started taking too long, i'd kill it dead though.

syntastic is basically magic though as far as i'm concerned and pretty integral to my workflow.

i set up my configs ages ago though, so it's partly just that i don't want to look at my vimrc.


besides 9/10 times you're doing twee garbage to try to ICE a compiler. of course completion is going to have trouble :v:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Beef posted:

Your business case is that the cost of upgrading to a compute environment from this decade is less than the cost of a certain programming going on a rampage and literally sacrificing security guideline managers on an altar to productivity.

has this environment been audited by a trusted party for work in this sector? let me generate 200 hours of meetings to discuss. by the way, this won't impact the ship date, right?
:suicide::suicide::suicide::suicide::suicide:

moving literally anything into a secure environment takes months of effort. i am incredibly glad i don't deal with that.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Fergus Mac Roich posted:

Anyone know how I can get started debugging an issue with my use of #pragma warning to disable warnings in MSVC? I have blocks in my header files that look like this:

C++ code:

#pragma warning(push, 0)
#include <fstream>
#include <iterator>
#include <iostream>
#include <cmath>
#pragma warning(pop)

After that, I disable some other warnings for my own files. The goal is to compile with /Wall but not get warnings for external headers. I still get a few hundred warnings, though. The odd thing is that if I change 0 to some other warning level, provided I do it in every file, I will actually get more warnings for these files.

Msdn indicated that push syntax is on 1..4

Try
#pragma warning(push)
#pragma warning(disable:#)
Includes
#pragma warning(pop)

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

baby puzzle posted:

I need to write some data in one thread and read it in another. Now, I understand mutexes and all that, but this is not a usual case. I cannot use any kind of mutual exclusion because it is in real-time code (i.e. in an audio-rendering thread which can NEVER EVER wait, allocate, etc). A different solution would be to use a non-blocking queue, which I am using elsewhere successfully, but these values change often enough that a queue or message of any type is not the right solution.

This struct for example has two different values in it, and if I just change the two values independently, then I get shearing between them. I need to change the whole struct with one atomic event.

So my current solution is to keep the changes atomic by keeping a pointer to the current values (g_TimeSyncData below) and I have many values in an array. Every time I need to update the values, I set it in the next item in the array, and then updating the global pointer is what actually makes the data available to the other threads.

However, I'm fairly sure that I've seen issues where the number of items in this array isn't big enough, and I got bad data by the data being over-written before I set the pointer. So I want a solution that doesn't re-use memory locations like this.

code:

struct TimeSyncData
{
	int64_t m_savedSample;
	int64_t m_savedSampleTimeMs;
};
static const int g_NumTimeSyncDatas = 10;
TimeSyncData g_TimeSyncDatas[ g_NumTimeSyncDatas ] = {};
int g_TimeSyncDataIndex = 0;
TimeSyncData* g_TimeSyncData = nullptr;

I think what I'm asking for is a name for this problem, and if there is a solution that is better than my janky home-brew solution.

try googling around "lock free data structures" and "compare and swap"

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Zopotantor posted:

Much as I respect rjmccall, you should always, always use curly brackets with conditionals, loops etc., even if there's only a single statement inside. Google "goto fail" if you want to know why.
Just get into the habit, it's not that much more effort typing them.

Also dumping { on a new line is bad because it introduces a place to break everything on insertion that won't cause a compile failure.

50% of the thread will now tell me I'm wrong.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Zopotantor posted:

This. And forget replacing them by singletons, too; those are just a way to get globals in languages that don't provide them natively.

rjmccall posted:

Global variables defined in the same translation unit should get initialized in the order they're defined. The rules get more complicated with static data members of class templates, and I wouldn't want to rely on compilers obeying those rules correctly, but the simple case of a bunch of non-template globals should be fine.

That said, making huge nests of global variables is generally a terrible idea that you will eventually come to regret, but ain't nobody ever been dissuaded from it by that argument yet, so godspeed, I guess.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

High Protein posted:

They keep 'improving' intellisense but last time I checked, even on rather small projects it was crap compared to VA. We use VA at work with a solution with ~200 projects and it works great. What I use most:
shift+alt+o: open file by name
alt+h: toggle code/header
alt+left: back to previous code position
shift+alt+f: find references

Do you know if you can map those to other things in vsvim? Because all of those things I already have key bindings for in vim and I am incapable of relearning keybindings.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Xarn posted:

True, but that would probably lead to ton of idiots not realizing that struct has all the features.

I mean people still think structs are for PODs only :shrug:

I had a :airquote:cto:airquote: of a :airquote:tech startup:airquote: tell me I was wrong about class and struct being basically the same after asking me for the differences in an interview.

I had to pull out the standard to correct him. Didn't get the job. :shrug:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Love Stole the Day posted:

Tell that to his bank account

Yeah I was unemployed at the time; it sucked.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

roomforthetuna posted:

I guess I should phrase this in the form of a question just in case it's me that's wrong and bad.
I had an interview where the interviewer talked about "a vector with n dimensions". What would this mean?
(I eventually deduced what he meant, but I'm curious whether other people would understand it to mean what it turned out he meant.)

Yeah, you got asked a maths question not a c++ question. Assuming he was talking about a collection of N numbers.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

sliderule posted:

Getting back into C++ after 20 years is pretty refreshing. The STL and the language advancement in 11 to 17 are very nice.

I have safaribooksonline to help me. I started with Exploring C++11 2nd ed to get my feet wet with idiomatic use of the language, but quickly got to a point where I was itching to put it to use, about halfway through the book. I checked out the new features in 17. I used a quick reference for the STL and read interesting sections of Effective STL to get going, and got to work on a simple high-precision scheduler as a simple first library.

Things plodded along as I struggled through syntax errors in lambda expressions, use of the auto specifier, direct initialization vs. copy constructor usage on classes with mutexes, and various small mistakes. As compile-time bugs popped up in new code, I grew increasingly frustrated with the quality of the error messages.

Is there anything to be done to improve the quality of g++'s output?

Sure, install clang and symlink clang++ to g++

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Ralith posted:

Worrying about efficiency is one of the worst things you can do while you're learning.

Arguably it's not that great beyond a cursory point after you're experienced, too. Until your tools tell you things are too slow anyway.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Slash posted:

This is how I do profiling, (attach debugger, randomly hit pause in the debugger and see where you are in the call stack), law of probability says you'll likely hit the offending method that's taking up all the time.

Why not spend less time and get more information by opening a single window?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

underage at the vape shop posted:

Is this the right place to ask questions about C# and visual studio? How in the gently caress do I get it to accept that I want to change namespace? I change it in properties, there doesn't appear to be a save button, and I go back to my code and it still says "namespace WindowsFormApp6". Changing the namespace is required to get the automarking system to accept it.

The .net thread is probably better.

Why can't you just change the name of the namespace in your code? It's plaintext..?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Volguus posted:

Debian, Fedora and CentOS don't have the same version, of course. So far we have found Debian to be the stable platform, but that's the problem, what if Debian, that version of gomp or omp, just so happens to not trigger existing bugs.
So far we have been going on without tackling the problem since it used to work in CentOS and Debian. Since 3 days ago, CentOS has been taken off the list and only Debian remained. We're still as clueless as before on the why it doesn't work, but now we have a platform less to work with.
Our build system is plain Makefiles as generated by the Netbeans IDE. Our developers are mainly machine learning scientists with coding not their primary skill. I am a developer and I'm just trying to keep the boat afloat by fixing their usually fantastically lovely code. It just that now the code looks fine and yet openmp spoils our party. The tools that I've tried didn't help but I guess I just have to try harder.

Build your dependencies, OP, don’t just use whatever the system feels like shoving at you. There isn’t a good reason critical parts of your application have different versions on different platforms unless you made that an active choice.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

SuperKlaus posted:

You guys have been a big help. Typically when I see the unexpected negative numbers it's because I've done something like forgetting to initialize the element of an array that I used in the calculation. Max size of data types is that sort of thing ya learn in CS 101 and then never see in practice in your courses so you forget. How embarrassing.

I’ve run into type bound issues somewhat frequently so far in my career.

One of those things you just start testing to make sure things behave reasonably at the edges.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

unidef freeman posted:

I overheard this in IRC from the good programmers, is it possible to make a trinary tree?

Sure; each node has three children.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

peepsalot posted:

Anyone know a good tool that's not Java based to help find duplicate or unused code across a C/C++ project?

http://clang-analyzer.llvm.org/scan-build.html ?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Brownie posted:

This is perhaps a dumb question, but whats the best way to throw an error with exceptions turned off? I'm writing code that in certain cases I want to fail completely (because it's only reachable due to programmer error) with a helpful debug message (in debug) and also still bomb in a Release build as well.

The code I've been using thus far comes from the official D3D11/D3D12 starter projects, and uses __debugbreak(), along with some helpful printing statements. If I only care about Windows, should I just keep using this?

Comedy option setjmp and longjmp

Adbot
ADBOT LOVES YOU

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Elfforkusu posted:

I had this happen!

The company was a zombie startup that was perpetually wandering aimlessly in search of a market. They are out of business now.

I don't even know if that sounds good or bad at this point.

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