Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

[Release] Recover OSBuddy/RuneScape username/email | NEW CLASS+++

Usage:
Code
var username = OSBuddy.GetUsername();

Source code:
[Image: Syr3DlV.png]
No catching of UnauthorizedAccessException , FileNotFoundException or basic IOException. Also, what legitimate use case does this have?
(Aug 25, 2017 05:22 PM)DeadKube Wrote:  No catching of UnauthorizedAccessException , FileNotFoundException or basic IOException. Also, what legitimate use case does this have?

Please learn to read code kthx
[Image: Syr3DlV.png]
(Aug 25, 2017 06:25 PM)gigajew Wrote:  Please learn to read code kthx

Please learn to take critisism and adjust accordingly. Your code is not properly configured for issues if you think a fileinfo.exists will make all your problems go away. Checking for permissions for example could allow you to notify the user that he needs to run as administrator. Checking if the file even has the required elements for your 'work' to be done is also something you're not doing.

That's like immediatly parsing API data and having your app crash due to the API being down. Just look at the mobile hf app posted by another member that doesn't even properly check if the API returns any data at all.
Code
private static int IndexOfAny(string haystack, char needle, int offset = 0)
{
    var index = haystack.IndexOf(needle);
    for (int i = 0; i < offset; i++)
    {
        index = haystack.IndexOf(needle, index + 1);
    }
    return index;
}

How is this a representation of "Index of any"? You couldn't have chosen a worse name for a function like this (as usual). It's just a simple function that reads a file too... I don't know much about runescape, but what is to stop the user from just opening that file and reading it?

edit: The 'offset' parameter is pretty misleading too if you compare this to any other Index finding method...
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
(Aug 25, 2017 07:02 PM)DeadKube Wrote:  Please learn to take critisism and adjust accordingly. Your code is not properly configured for issues if you think a fileinfo.exists will make all your problems go away. Checking for permissions for example could allow you to notify the user that he needs to run as administrator. Checking if the file even has the required elements for your 'work' to be done is also something you're not doing.

That's like immediatly parsing API data and having your app crash due to the API being down. Just look at the mobile hf app posted by another member that doesn't even properly check if the API returns any data at all.

(Aug 25, 2017 07:07 PM)0xDEAD10CC Wrote:  
Code
private static int IndexOfAny(string haystack, char needle, int offset = 0)
{
    var index = haystack.IndexOf(needle);
    for (int i = 0; i < offset; i++)
    {
        index = haystack.IndexOf(needle, index + 1);
    }
    return index;
}

How is this a representation of "Index of any"? You couldn't have chosen a worse name for a function like this (as usual). It's just a simple function that reads a file too... I don't know much about runescape, but what is to stop the user from just opening that file and reading it?

edit: The 'offset' parameter is pretty misleading too if you compare this to any other Index finding method...
jesus christ you too, just post a "updated" version of his code so he could learn his mistakes, instead of go bashing him like that
@OP: I'll post a "better" version when I get on my PC

“I wish I could say everything in one word. I hate all the things that can happen between the beginning of a sentence and the end.” ~ Leonard Cohen
(Aug 26, 2017 07:44 AM)vaiperboy Wrote:  jesus christ you too, just post a "updated" version of his code so he could learn his mistakes, instead of go bashing him like that
@OP: I'll post a "better" version when I get on my PC

I like how they criticize and i think there's no need code to be posted as they just point out some mistakes of op.
(Aug 26, 2017 08:42 AM).Linear Wrote:  I like how they criticize and i think there's no need code to be posted as they just point out some mistakes of op.

Mostly just the haters, I'm not worried about it
[Image: Syr3DlV.png]
This isn't hate. It's constructive criticism. If you can't handle that, you shouldn't be in this business to begin with. In every aspect of your life people will have something to say about your actions and decisions. You either learn to deal with it and improve yourself (or in this case your code) or you give up. I'd suggest this guy to give up because I'm a cold hearted bastard like that. I'm sure 0xDEAD will have other things to say though. If you want to spoon feed the babies around here, by all means please be my guest.

I harbor no bad feelings for you or anyone else at all. I would not want to wish you or anyone else cancer. If you want real hate though, I can certainly provide that for you.
Why create your own IndexOfAny method?
https://msdn.microsoft.com/en-us/library....100).aspx
(Aug 26, 2017 07:44 AM)vaiperboy Wrote:  jesus christ you too, just post a "updated" version of his code so he could learn his mistakes, instead of go bashing him like that
@OP: I'll post a "better" version when I get on my PC

Waiting for your code then.

(Aug 26, 2017 08:42 AM).Linear Wrote:  I like how they criticize and i think there's no need code to be posted as they just point out some mistakes of op.

There is no need to post code, he's been spamming junk sources like this for a while now demonstrating all the same mistakes as the previous. If he ever listened to some of the advice given in previous threads and cared, his code would have improved. If I was to revise all the poor code I seen on this forum I would have written the bible 10 times over by now.

(Aug 26, 2017 12:27 PM)mapleanton Wrote:  Why create your own IndexOfAny method?
https://msdn.microsoft.com/en-us/library....100).aspx

^ Because this isn't even close to what that method does nor is it contextually understandable without reading the function implementation because it doesn't do any of what most would expect. (* As proven just now by you suggesting that .NET method which would break his code if the substitution was made...)
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
(Aug 26, 2017 12:43 PM)0xDEAD10CC Wrote:  If I was to revise all the poor code I seen on this forum I would have written the bible 10 times over by now.

0XDEAD You're a fucking legend. I'd read your bible every single day.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by lockheadApr 22, 2021 07:10 AM 0 147 Apr 22, 2021 07:10 AM
Last Post: lockhead
[.NET] by AshlanfoxSep 18, 2017 12:44 PM 22 2,391 Sep 18, 2017 12:44 PM
Last Post: Ninja
[C#] by gigajewAug 21, 2017 06:36 PM 8 679 Aug 21, 2017 06:36 PM
Last Post: DeadKube