u/diodine - 12 Archived Voat Posts in v/programming
u/diodine
  • home
  • search

u/diodine

0 posts · 12 comments · 12 total

Active in: v/programming (12)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: Forcing women into programming is a fucking mistake

I'm copying their style for comparison's sake.

0 18 May 2018 02:43 u/diodine in v/programming
Comment on: Forcing women into programming is a fucking mistake

Horrible coding practices - ignoring the egyption brackets, heres a proper implementation (written by a man):

// proper object orientation of shit in https://kek.gg/i/63TqP-.jpg
// using more epic object orientation
// i have no idea if the lang in the image is c#, js, java, etc, so this isnt making full use of any feaures from those languages
// u could probably expand this by having a base class for both, yaddadada...
class Girl
{
    private int age; // private cuz u dont know their age just by looks...exactly...
    Girl(int _age)
    {
        age = _age;
    }
    public boolean willGoOutWithGuy(Guy guy)
    {
        return age >= 22 && isGuyUgly(guy);
    }
    private boolean isGuyUgly(Guy guy)
    {
        // can be expanded later
        return guy.isUgly;
    }
    public boolean willGoOut(Guy guy)
    {
        return willGoOutWithGuy(guy) && guy.willGoOutWithGirl(this);
    }
}
class Guy
{
    public boolean isUgly; // public cuz u can obv see if they're ugly
    // dont forget initializers daft hoe
    Guy(bool _isUgly)
    {
        isUgly = _isUgly;
    }
    // guy will basically fck any girl (systemic sexism?? maybe he wants to fuck dudes????)
    public boolean willGoOutWithGirl(Girl girl)
    {
        return true;
    }
    // check both
    public boolean willGoOut(Girl girl)
    {
        return willGoOutWithGirl(girl) && girl.willGoOutWithGuy(this);
    }
}
0 17 May 2018 22:52 u/diodine in v/programming
Comment on: (((active users)))

Readability reasons I guess.

0 04 Feb 2018 14:31 u/diodine in v/programming
Comment on: CIA Leaks - Process Hollowing. Starting a benign process with suspended threads, then replacing the address space with another executable before resuming the threads.

TBH, this really isn't that amazing. This has been seen in the wild and in fact, some completely benign software also puts code into another process's space without the process's knowledge (things like overlays)

Windows provides an API specifically to do this (NtWriteProcessMemory / NtAllocateVirtualMemory), while on Linux you'd have to use ptrace first to get a stub into the target process to then call mmap.

4 08 Mar 2017 02:03 u/diodine in v/programming
Comment on: Can video game hacks ever be stoped?

Or these developers could just procure dedicated servers instead and let the user base deal with bandwidth.

1 25 Jan 2017 09:52 u/diodine in v/programming
Comment on: Can video game hacks ever be stoped?

Because these AAA titles usually are peer-to-peer so they don't have to pay for servers and a huge amount of bandwidth.

1 25 Jan 2017 09:38 u/diodine in v/programming
Comment on: What is the best comment in source code that you have ever encountered?

One of my favorites, from Linux 1.0:

IBM designers who came up with it should be shot.

9 06 Dec 2016 20:08 u/diodine in v/programming
Comment on: Basics of AI?

Keep in mind that all living things are very simple:

Stimuli -> Response

Make your guy listen for events - such as a hook thats called whenever a sound is played or when something enters LoS. When you simplify it like such, making him react to these stimuli is easy.

As for making your AI intentionally dumb, that's also easy. If hes shooting a gun, just make his aim-angles bob around with something like sin(time()) x (1-difficulty_pct). For path finding, make him take intentionally long paths, or even better make him only know about certain nodes by visiting them (or having a buddy who has a radio on his model visit the area). If you have a bunch of guys in an area who need to go somewhere, make their willingness to take a certain path with their buddies random (to simulate them doubting their buddies) or make them split up (such as marking 2 bots as being "leaders" and each inferior bot having a high-willingness to follow them)

You should generally try to follow the whole "willingness" thing. Like, for example, certain bots might be 60% willing to run away from a fight, 20% willing to run right in, and 20% willing to stay where they are. Make certain stimuli effect these percentages - such as if he sees 3 opponents his willingness to run away goes up 10% and his willingness to stay or push go down based on what equipment he thinks his enemies have. Make it so if he hears or sees a grenade hit the ground his willingness to run away goes to 75%, his willingness to stay goes to 0%, and his willingness to push ahead goes to 25%. The chosen skill level might change how these percentages scale.

That's all I have to say. I'm not in this field so I can't say any of this is the best way to do it.

2 16 Sep 2016 18:40 u/diodine in v/programming
Comment on: A conservative city for programmers?

Also, we don't have Donald Trump!

You have Muhammad, Ahmed, and female genital mutilation.

8 09 May 2016 02:40 u/diodine in v/programming
Comment on: Does anybody here reverse engineer viruses?

I do. I generally don't spend too much time though being a hobbyist rather than a full time reverse engineer, but if the malware isn't overly complex I will look at it. PM me the files if you want.

1 06 May 2016 03:40 u/diodine in v/programming
Comment on: Programming tip: Stay away from throwing exceptions.

Most C++ compilers simply make a function call for exceptions (MSVC is something like CxxRaiseException) and thus optimization is not sacrificed (since the linker just sees it as a function call).

C on the other hand is in fact ruined by setjmp exceptions.

0 12 Mar 2016 21:40 u/diodine in v/programming
Comment on: Hate GitHub being taken over by gender politics? Don't worry, you're not alone.

std::mt19937 feelings(time(NULL));

The feelings are always random. lmao

1 21 Feb 2016 17:28 u/diodine in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.