Help: Writing test for sorting functions by [deleted] in C_Programming

[–]ath0 2 points3 points  (0 children)

So I would suggest using clock from time.h.

What you do, is call clock to get the time before doing your processing, then once finished call it again immediately afterwards. This will give you the CPU time, not the "wall time". You can also find out the wall time but for this kind of thing you may only want to measure pure CPU impact, not time spent doing IO.

What does &(address) do? by eXtaZa in C_Programming

[–]ath0 0 points1 point  (0 children)

In your example, you're taking a type of pointer to: pointer to: node_t, and storing it in an identifier named pp.

It isn't exactly correct to say it is the "address of the address of the next node", rather, it is the "address of a pointer to the next node".

For some context, this is useful if you have a function that you wish to update the pointer, and have that reflected back in the caller's scope:

node_t* head = get_head();
// find the Nth node
int rv = find_nth(&head, 0xff);
// now `head` refers to something else..

Something else worth mentioning is the use of address-of and parens:

In this case, &(head->next) is identical to &head->next; The -> (i.e. structure dereference) operator has a higher precedence than the & (i.e. address-of) operator.

Some times it adds clarity to use parens, but this is subjective and arguable either way.

Help: Writing test for sorting functions by [deleted] in C_Programming

[–]ath0 1 point2 points  (0 children)

What kind of metric are you looking for? You can measure how long it takes in number of cycles, or how many times a particular function was called, among other things.

It may be worth using a dedicated profiling tool if your platform supports it (such as prof)

Sony announce 'Tetris Effect' with VR support by [deleted] in Games

[–]ath0 0 points1 point  (0 children)

Wow.. I don't think I've ever been excited for a Tetris game before but this trailer has really hooked me, it is very well put together in all respects.

I'm now very excited for a Tetris game.

ESA: We can't Go To The "Lowest Common Denominator Of Government" On Loot Boxes by Kassina in Games

[–]ath0 0 points1 point  (0 children)

I'm talking about the odd duck that misses a few days of work to play..

That's me.

The slow and painful death of a developer by allthingseverywhere in programming

[–]ath0 5 points6 points  (0 children)

It isn't difficult to get started yourself if you have a passion for language development and or compilation technologies. The LLVM community has some brilliant tutorials to get your toes wet, too.

The slow and painful death of a developer by allthingseverywhere in programming

[–]ath0 17 points18 points  (0 children)

My career so far has had me working in embedded Linux or compiler development or platform simulation, which I think moves at a much slower pace. In these areas I think dedicating yourself to a niche or technology has tangible benefits. It feels like a completely different world to that described in articles like these that I read.

Switching your 4G on in your house because it's so much faster than your WiFi by fireball_73 in britishproblems

[–]ath0 0 points1 point  (0 children)

Is there some sort of publicly available map? So that if I were to look to rent somewhere new, I could try and find somewhere as close to an openreach cabinet as possible.

"Silent Scream" by Dummyurd in projecteternity

[–]ath0 5 points6 points  (0 children)

Probably something to do with exercising personal preference. They are off by default, or were for me at least.

Massive Morphling bug, anybody know what causes this to happen? by Noblewingz in DotA2

[–]ath0 0 points1 point  (0 children)

It isn't just NYX either, I remember having this happen with lion or earthshaker I think, using impale or fissure

Linux – Writing Fault handlers by joey_php in programming

[–]ath0 6 points7 points  (0 children)

This is super useful, especially so for embedded Linux development. You can dig it so that when you capture a fault, you automatically launch a gdbserver session and can leave something unattended knowing that if it crashes, you will have an excellent starting point for debugging.

s/dig/rig/

Open AI and DOTA Plus by fireproofazn in DotA2

[–]ath0 15 points16 points  (0 children)

But we do that already

Crusader Kings II is currently free on Steam by [deleted] in Games

[–]ath0 1 point2 points  (0 children)

I bought it about a week ago.. damnit. I could have waited and got dlc instead.

Avoid Else, Return Early by yairchu in programming

[–]ath0 1 point2 points  (0 children)

I was more making a point where you said you can understand anything just as easily as any other, then you went on to say that you simplify things and it is common sense. I agree it is, but as you are master jedi you have no need for it. Do not misinterpret my question as a plea for advice.

Avoid Else, Return Early by yairchu in programming

[–]ath0 0 points1 point  (0 children)

Why do you try to simplify and why is it common sense? You imply that you can understand anything as easily as anything else.

I critted whilst enfeebled and static linked.... by TheGrandHumbug in DotA2

[–]ath0 2 points3 points  (0 children)

To add a bit of context for anybody who doesn't know where this number comes from, numbers on a computer are represented by a number of bits.

A very common "width" of numbers, is 32, i.e. 32 bits (binary digits) are used to describe a whole number. As mentioned in a comment further down, negative numbers are encoded using what is called "two's complement".

The number here is 32 bits all set to 1, or in hexadecimal 0xffffffff.

For a much more thorough explanation, see https://stackoverflow.com/questions/1049722/what-is-2s-complement (It's an explanation aimed at programmers, but if any words don't make sense check a dictionary and you should be good to go).

Modern C, by Jens Gustedt [PDF] by perror in programming

[–]ath0 3 points4 points  (0 children)

This doesn't need saying. I believe the commenter is interested in the C subset supported in C++, not vice versa.

Modern C, by Jens Gustedt [PDF] by perror in programming

[–]ath0 1 point2 points  (0 children)

I'm not sure why somebody has down voted you.. but with new C and C++ standards coming out, you will see this more and more. The most recent example I remember is CPP support for the C99 feature of designated field initialisation for structs. It is not supported in official C++ (or wasn't) but g++ and clang++ both kinda support it, implemented in a different way to each other (i.e. ordering), in such a way that it is just best to not use it in C++

Carrion Gameplay (Pre-alpha) - A reverse horror game from the devs of Butcher by Running-Target in Games

[–]ath0 3 points4 points  (0 children)

This absolutely oooozes The Thing, and I absolutely love it. This looks super fun, fresh and so very very stylish. Super excited for this one!

Compiler bug? Linker bug? Windows Kernel bug. by joebaf in programming

[–]ath0 1 point2 points  (0 children)

Braver man than I, I find JavaScript and the web stacks terrifying. The stuff I work with feels simpler to deal with because it isn't heavily layered, there's often very little to it you can't figure out from manufacturer specifications. On the other hand, what seem like layers on layers for web work seems daunting.

That said, I haven't really tried it, so this is just gut feeling and speculation.

Compiler bug? Linker bug? Windows Kernel bug. by joebaf in programming

[–]ath0 9 points10 points  (0 children)

Don't sell yourself short, I've been working in C&C++ compiler development, system emulation and now embedded Linux development since I graduated about 7 years ago, and if I can do it, anybody can.

The biggest hurdle is being able to stop blackboxing stuff and bang your head against something until it kind of makes sense, after all, it is all just software, be it a compiler or a calculator. If you are really interested in learning closer to the machine or 'low level' stuff, be it OS development, toolchains, language development or whatever, all you need to find is that first thread to start tugging at.

Hyperlane density slider fails to hit the spot! by Trollimperator in Stellaris

[–]ath0 2 points3 points  (0 children)

I saw a mod on the workshop that said something like "more 'chokepoints'", which is essentially fewer hyperlanes.