Salman
Salman
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
I don't know regex yet so I never said it was more performant but it was cleaner so. Ofc regex solutions can be better . It's doing the same thing as the original code .
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
Np πŸ‘
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
Yeah dictionary is great for such use cases
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
c#
private readonly Dictionary<char, char> Replacements = new()
{
{'Δ±', 'i'},
{'ğ', 'g'},
{'ΓΌ', 'u'},
{'ΓΆ', 'o'},
{'ş', 's'},
{'Γ§', 'c'},
....
};
c#
private readonly Dictionary<char, char> Replacements = new()
{
{'Δ±', 'i'},
{'ğ', 'g'},
{'ΓΌ', 'u'},
{'ΓΆ', 'o'},
{'ş', 's'},
{'Γ§', 'c'},
....
};
So you make a dictionary like this and and then iterate through the string and replace the keys with the values like this:
c#
foreach (var kvp in Replacements)
{
text = text.Replace(kvp.Key, kvp.Value);
}
c#
foreach (var kvp in Replacements)
{
text = text.Replace(kvp.Key, kvp.Value);
}
It's a bit cleaner right?
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
You can also use dictionary mapping perhaps in some way regex or what not
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
I'm not on my laptop but if the string Isn't that large as you are saying then I'd do it in a single pass by creating a new string instead of replacing multiple times . You would need a lengthy switch case for that ... That won't be much cleaner but can be faster
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
How large is the string
22 replies
CC#
Created by Alex on 6/28/2024 in #help
βœ… Refresh Token + JWT + Identity
you can start by looking at the existing implementation and then try to make your own one perhaps
6 replies
CC#
Created by Alex on 6/28/2024 in #help
βœ… Refresh Token + JWT + Identity
Extending the Identity User has nothing to do with it
6 replies
CC#
Created by Alex on 6/28/2024 in #help
βœ… Refresh Token + JWT + Identity
Well Identity endpoints provide you the endpoint for token refresh out of the box ...You can use that if it suits your need. Else you can make your own .
6 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
or whatever
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
or cache problem
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
it's buggy sometimes
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
good
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
aight forget that for now, trying restarting the VS and see
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
maybe clean your project or restart VS
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
what error
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
c#
using System;
using Rhythm_Flow.Game;
using OpenTKWindow;

namespace Rhythm_Flow
{
public class Program
{
static void Main(string[] args)
{
using (Game game = new Game())
{
game.Run();
}
}
}
}
c#
using System;
using Rhythm_Flow.Game;
using OpenTKWindow;

namespace Rhythm_Flow
{
public class Program
{
static void Main(string[] args)
{
using (Game game = new Game())
{
game.Run();
}
}
}
}
@DevLop games try this out and see if it works
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
Former should work fine
63 replies
CC#
Created by DevLop games on 6/24/2024 in #help
βœ… Namespace error
try using OpenTKWindow; or using OpenTKWindow.Game;
63 replies