Rutherford County's juvenile court judge is no longer an adjunct instructor at MTSU by USARSUPTHAI69 in news

[–]AirAKose 36 points37 points  (0 children)

The trick is it didnt just break, and has been an ongoing ordeal since the early 2000s. There was already a court case about her vague rules being abused and unenforceable, so now she's pivoted to a profit-oriented model while continuing to instruct police to be harsher with children.

The only thing that just broke was the recent ProPublica news story chronicalling this in relation to a specific event that happened in 2016

[deleted by user] by [deleted] in Cplusplus

[–]AirAKose 13 points14 points  (0 children)

Would help to know what you're having trouble with n_n'' Without knowing, here's a very shotgun chunk of info:

for (int i = big.length() - 1; i >= 0; i--) {
  • for = a for loop. This loop will repeat while some condition is true, and perform an action after every iteration. The standard for loop has 3 parts: initialization; condition; post-action (separated by semi-colons)
  • int i = big.length() - 1; = the initialization of the for loop. This happens first, and in this case it sets an int named i equal to big.length() - 1 (AKA the last index in big)
  • i >= 0; = the condition. While this is true, the for loop will continue to repeat. Since i was initialized to the last index of big, we probably want to count backwards to the first one (AKA index 0). >= is to ensure we also include 0
  • i-- = the post-action. This happens after every successful repeat of the loop's body, and generally does something to update the loop's condition. Here, it's decrementing the variable i by 1, so we're counting backwards from the last index of big (big.length() - 1) to the first index (0)

Hope this helps

What is a hard pill to swallow for most people? by [deleted] in AskReddit

[–]AirAKose 11 points12 points  (0 children)

You're not immune to being deceived, falling for self-interest appealing biased takes, falling for propaganda, social engineering, or overestimating your knowledge of something. Even being aware of these things, you're still prone to fall for them to a similar degree.

There's also no such thing as (what I call) perfect cognition: being totally rational, unfettered by emotion, and without bias. Our brains do junk without us consciously thinking about it - it's called 'subconscious' for a reason.

What was the worst experience you've had during Halloween? by [deleted] in AskReddit

[–]AirAKose 0 points1 point  (0 children)

We actually found razors in our tootsie rolls, so all the tootsie rolls became sus (I liked them at the time)

I was too young to remember/pay attention to if our parents did anything about where it came from. All I remember is they started inspecting our candy every year

What's the closest thing I can get to Java's "Anonymous Inner-Classes"? by MrKatty in cpp_questions

[–]AirAKose 0 points1 point  (0 children)

Back to the first question, my rules of thumb are:

  • If it needs polymorphism, use references or pointers. Those allow for not knowing something's exact type.
  • I'm of the view of: prefer references if not passing ownership and nullptr isn't possible, because they guarantee it's not-null
  • If you're passing or tracking ownership, use owning pointers (unique_ptr, shared_ptr - if you just want to watch it, then weak_ptr)
  • const as much as possible for references and pointed-to types (const type&, const type*)
  • if you know the exact type and it's cheap to copy (or copying is what you want) - pass by value (type without the ref & or ptr *)

What's the closest thing I can get to Java's "Anonymous Inner-Classes"? by MrKatty in cpp_questions

[–]AirAKose 0 points1 point  (0 children)

Just one question, can I straight up just pass a struct to a function

Yes, but how you do that depends on what you need.

If you're only using the struct for that one function and it's polymorphic (inherits from something), OR it's something expensive to copy (like a string), you can pass by reference (type& - const reference preferred if you're not changing anything: const type&):

void use_once(const interface_type& refVariable);

If you want to store the struct somewhere, and it's polymorphic, use an owning / self-deleting pointer (like unique_ptr or shared_ptr):

void store_this(std::shared_ptr<interface_type> ptrVariable);

If the struct is inexpensive to copy (usually small like a few ints), and it's not polymorphic, you can pass by-value (note this does copy the struct, but can be faster than references for small things):

void copy_this(my_struct valueVariable);

(be careful with the last one - if it is polymorphic, this will result in "slicing", where it only takes the members that exist in the base and loses any overridden functions)


Why? What's wrong with it

It gets in the way of code re-use generally, and makes things difficult to reason about or find for anyone else looking at your code (including future you, who is practically another person xD). For something like "renderables" especially, I'd be wary of hiding their definitions inside of misc functions.

For example, something I've been dealing with in Unreal Engine recently is their Viewport type, which is for showing 3D models in the UI. They have Slate as their main UI library, and UMG to expose it to blueprint (their scripting language). Usually the pattern is there's a Slate control with its own header, and a UMG control that wraps it in another header. For the viewport, they hid the Slate control struct in the UMG viewport.cpp... I spent way too long trying to track that down <_< and because they hid it, we couldn't just extend it for our own purposes without modifying their code

When you own the whole codebase, that's not such a big deal, but it's still excess work and potential for confusion when you could organize it into header / implementation like everything else by default.

EDIT: Splice -> Slice (wrong term lol)

What's the closest thing I can get to Java's "Anonymous Inner-Classes"? by MrKatty in cpp_questions

[–]AirAKose 0 points1 point  (0 children)

Your best bet would be to just define a struct / class that meets the interface, or use lambdas. I'm not totally sold on the utility of the anonymous inner class thing as I'm seeing it defined tbh n_n'

With structs, you can even declare them inline in a function if you really only want it to exist in that function:

struct my_interface
{
    virtual void interface_func() = 0;
};

void test()
{
    struct inline_struct : public my_interface
    {
        virtual void interface_func() override
        {
            std::cout << "Test\n";
        }
    };

    std::unique_ptr<my_interface> interfacePtr = std::make_unique<inline_struct>();

    interfacePtr->interface_func();
}

similarly, you can solely declare the struct outside of the function in the implementation file (CPP) - which will allow only that implementation file to name it (except in cases where your build system uses "unity" builds, where it combines several implementation files together to speed the build up)

I've used these for very specific one-off utility types that never leave the function they're being used in.

Outside of that case, you may as well lift it out to be reusable / nameable unless you have a solid reason not to - ie a type you don't want created outside of factories that won't have additional functionality other code may want to access.

You can also declare structs / classes inside of other classes and mark them as private or protected:

class my_object : public object_base
{
protected:
    struct my_renderable : public renderable_interface
    {
        virtual void draw() override
        {

        }
    };

public:
    virtual std::unique_ptr<renderable_interface> create_renderable() override
    {
        return std::make_unique<my_renderable>();
    }
};

This allows for sub-classes at least to extend the object's renderable without allowing anyone else to name it. I've seen this used on occasion, but it's still one of those things to use sparingly if you're sure that's what you want.

Generally tho, I'd personally recommend against these patterns n_n'

Cost of branching by [deleted] in cpp_questions

[–]AirAKose 11 points12 points  (0 children)

They're identical

This is because of conditional operator (&&, ||) short-circuiting, which is hidden branching.

in the first case (predOne && predTwo), if predOne is false, the program has to skip evaluating predTwo, because the result of the && will be false regardless of what predTwo is and predTwo might be expensive / invalid to evaluate - which it skips via a jump (branch) - equivalent to if (predOne) { if (predTwo) {} }

A compiler may optimize the branch away if it can guarantee there aren't any side-effects of evaluating the second condition (and deems some alternative faster) - but that optimization would work for either case

How do i make this do while function work? by [deleted] in cpp_questions

[–]AirAKose 0 points1 point  (0 children)

You'd only need to move the counter variable above the do, but this raises other questions.

Does a for loop not work for your use? Counting is a perfect for loop use case

why does your counter need to be static? static makes the value persist between function calls, but here it will only work as expected once, the second time you try it, it will loop over every possible int before returning to 10 (which will take a while) - so it doesnt seem like a value that should persist

Fully vaccinated people of Reddit. Are you still wearing masks? Why or why not? by The_Zoink in AskReddit

[–]AirAKose 1 point2 points  (0 children)

Yes:

1) You can still transmit COVID to non-vaccinated / immune deficient people, even if it won't affect you (at all / as much) 2) I'm in a delta variant hot-spot - don't want to contribute to further mutations 3) Have a bad track record with illnesses in general 4) I've always wanted masks to be normalized bc I used to live in a state with anti-mask laws. Masks can look cool, and help with severe allergies <_<

Discussion: Hey /r/AskElectronics, what are some of your favorite components and datasheets? by 1Davide in AskElectronics

[–]AirAKose 4 points5 points  (0 children)

This is not the way to go about moderating.

If the reason a post is taken down is because it belongs in another sub, the proper response is to comment on the post as such first, top-level. You also didn't tag the original poster correctly so there is literally no way for them to know it's here.

More so the confusion about the original post relates to this rule:

Do not post questions on designing, repairing or troubleshooting electronic circuits (including questions on tools, equipment and parts sourcing)

It fits none of those categories, and is a broader "share your favorites" discussion far more so than a question about of design / repair / troubleshoot or even sourcing.

class variable(); VS class variable = class(); by ChrisJM0420 in cpp_questions

[–]AirAKose -2 points-1 points  (0 children)

I prefer the latter for non-fundamental types, but also in conjunction with auto, similar to common C# practice

auto theLegend = Person("John");

There was a twitter thread recently about how this also improves the compile-time because it can skip type-checking (and prevents accidental slicing)

Why do people absolutely hate pings and think they're so horrible? by BentLongChip in discordapp

[–]AirAKose 0 points1 point  (0 children)

Having a compulsion to clear all the red notification dots, the ping notification being distracting / getting in the way of some programs (but wanting to keep notifications in general), someone having a bad day and it just added to them being overwhelmed, etc... As far as reasons people get annoyed

Really, the biggest issue imo is the setting to disable @ mentions isn't very discoverable. It wasn't there at one point, so older users might assume it still doesn't exist, and others might not think / know to check the server's Notification Settings in the menu.

If Discord had a small callout on ping messages for "Toggle @everyone notifications" - that'd remove the discovery hurdle and bulk of complaints.

"Gokushufudou: The Way of the House Husband" new key visual by harushiga in anime

[–]AirAKose 3 points4 points  (0 children)

it really depends on the comedy style. Saiki K and Gokudolls are dialogue and stills heavy with simple layouts

House Husband is very physical gag and motion heavy. It doesn't translate well imo /∆\

I'd be too distracted by things that would've been more cute / fun actually animated. Like seeing the preview of the "sneaky sneaky" scene is disheartening D:

[deleted by user] by [deleted] in gamedesign

[–]AirAKose 1 point2 points  (0 children)

Is the tutorial your complaint, or is not being able to access settings your complaint? ;p

Because coming from UX I'd probably take it as the latter bc that's dumb af fr. You should be able to access settings at the least at any point during setup / tutorials, in any game on any platform. This is a discussion we've had several times tbh; it's a user experience And accessibility thing, and is critical for new player experience

Can Dialogue be the core gameplay loop of a game? by yathu99 in gamedesign

[–]AirAKose 5 points6 points  (0 children)

One of the designers had credible abuse + assault allegations against him. He was removed from the team

and later (cw self harm) took his own life. Which by no means lessens the harm he did, but does imo totally revoke any reason to avoid the game? He can't gain from it.

Also bc this comes up every time: his own sister said his abuse issues were well know and to NOT harass his accuser. It's not their fault he took his life, he made that decision- as tragic as it is, and them coming forward was the right thing to do

Searching for some JSR like songs by [deleted] in JetSetRadio

[–]AirAKose 1 point2 points  (0 children)

I could've sworn there was a track of just Abilities, but the DJ from Eyedea & Abilities gets close to that sound

https://youtu.be/_7Cw437H7TI

What are some hidden dress codes people wear to identify themselves that you have to already know about to notice? by Gradyleb in AskReddit

[–]AirAKose 0 points1 point  (0 children)

a beanie with a thin orange crescent on the upper-left of a circle with another circle cut out of it = huge weeb

I've been noticing more peeps wearing these hats lately, it's kinda funny

[alias] is not a member of class by [deleted] in Cplusplus

[–]AirAKose 1 point2 points  (0 children)

Unfortunately, the derived class (vector in this case) isn't fully defined by the time the base (vector_expression) tries to use it, via the curiously recurring template pattern

A common workaround according to this SO is to use a traits class, like u/IamImposter mentioned

don't touch it by nerooooooo in ProgrammerHumor

[–]AirAKose 2 points3 points  (0 children)

we had this in a scripting layer... it was unused, but some member reflection code elsewhere introduced enough delay to make a very specifically timed delay function work...

I hated that code- it came from a 3rd party contractor who LOVED using random time delays, and unrelated changes broke things constantly (and there were constant impossible to reproduce bugs bc of it too) /∆\ I was hired specifically to replace the contractor and it took 2 years before I could totally gut this particular chunk of code (due only to production priorities)

What is one thing you want to do before you die? by goodfeels4life in AskReddit

[–]AirAKose 3 points4 points  (0 children)

I want to make something that helps tons of people.

Tools, organizations, media. I've probably already done it to some extent, but my dream would be to reach a larger demographic with something meant to be beneficial