Jump to content

Belzebuth

Member
  • Posts

    247
  • Joined

  • Last visited

Posts posted by Belzebuth

  1. On 8/2/2019 at 4:33 PM, mariushm said:

    What's with the strtoupper calls in the function?

    What's the point of all those alphabet.find() calls ... just calculate those and put them in an array at the start of encoding or decoding and then just reference the array, instead of wasting time with function calls

    How are you dealing with UTF-8 text where you may have bytes outside the latin encoding etc ... here's ム刀 乇メムᄊアレ乇

    edit: you could probably simplify the code a bit by always having the cypher/password padded to 128 or 256 bytes /characters , ex repeat the phrase until you reach this many characters.

    So then you could just use shifts or bitwise and instead of divisions/mod/remainder etc

    The string to encode is set to uppercase to avoid the need of lowercase chars in the alphabet. 

    The .find() function is up to linear in complexity, I don't feel it would be much faster/efficient to calculate those at the beginning, I will do the math.

    I'm not dealing with non-latin chars.

    This vigenere cypher is strictly the algorithm, the point is for it to be decodable by any other vigenere class from any language.

  2. 3 hours ago, Unimportant said:

    It'll come back to bite you, or the one having to maintain your code, in the a**. How easy is it to accidentally misread or make a modification in the wrong place without the braces. Everyone who claims "they won't be making such mistakes" are probably the first to do so. Get all the help you can get!

    Putting everything on a single line also does not allow putting a breakpoint on the conditional expression.

    While I do agree it can introduce user error, if the statement is single line like here, it's pretty straight forward. However, anything that is not single line should use braces. 

    //This is fine for me
    if(condition) statement;
    
    
    //This is prone to user error
    if(condition) 
        statement;
    

     

    3 hours ago, Unimportant said:

    No, you declare variables when you need them, in the scope you need them. That way you don't pollute a wider scope then necessary. The variable only lives as long as it needs to and no longer (which becomes critical for more complex types - RAII - so it should become a habit) and you can immediately initialize it with the proper value rather then a dummy value, which in turn allows more variables then you'd think to be const.

    This is indeed a bad habit for me, keeping declaration in scope where needed is way better for stack optimisation. I will try to force me to do it the right way.

  3. 10 hours ago, Unimportant said:

    Why do you declare all your variables in the beginning of a function asif this was old C ?

    Declare them when you need them, in the scope you need them.

     

    Should throw up a bunch of warnings for signed/unsigned comparisons.

     

    It's also considered good practice to use braces even if there's only a single expression in them:

    
    if (...)
    {
      ++j;
    }

     

    Well to me it wasn't a big deal, the function are pretty clear on their own.

     

    For unsigned/signed comparisons, indeed it throws warnings that could have been avoided with a long long unsigned int declaration. 

     

    For the braces, I've heard both pros and cons... I find it more readable that way.

  4. Hello everyone,

    so today I was in need of a vigenere encode/decode function for a simple application. The issues is that I didn't find any with a fully customizable alphabet. So I wrote one :)

    A Vigenere coding is a very basic algorithm with consist on secret key and an list of characters to encode a piece of text. The idea is to take the first letter of your text and the first letter of your key, find their respective position in the char list, and sum the value. The result modulo the number of entry in your char list, is now the new encoded char. And you continue 'till the end of your text.

     

    Here is the GitHub link : Vigenere-CPP

     

    Let me know what you think about the class, and the Vigenere algorithm ;)

  5. 14 minutes ago, Jack S Holt said:

    -snip-

    If I can give you my personal experience : I began my computer degree with a Dell latitude 7240 that I bought on ebay for 250usd. The best computer I ever used I think (except for the screen and is low resolution).

    Later on I bought a Surface Pro, good laptop, but expensive and battery life is lower than the Dell, but the screen is better... You need to take care of it, unlike the Dell.

     

    My thought, go second hand, Lenovo thinkPad or Dell Latitude 7000 or 5000 series. Easy to find on eBay and very very reliable.

  6. 9 minutes ago, Spylock said:

    Use case: I have a home NAS that only has wired networking ports, no built in wifi.  For reasons I want the NAS to live in a room that I can't put wired network access into. I have an Asus RT-AC68U wifi router I would like to connect the NAS to. 

    Looking for product recommendations. I'm thinking an access point would be overkill. I would like a small wifi to wired network adapter of some kind. 5ghz and AC would be nice but not required. 100mbit is fine but gigabit would be nice also. 

    TP Link Nano router can do the job in client mode. Exist in both 300mbps and 750mbps

  7. 10 minutes ago, FunKaLiTy said:

    Ah I see now where you mean, but when i right click there the top 4 options are greyed out (none of them say format, they just say "New something volume"), my options are to either convert to dynamic disk or convert to GPT-disk, Disconnect or go into Properties.

    can you make a screenshot of the context menu when you right click on disk1 ?

     

  8. 1 minute ago, chnapo said:

    Goodness this is the fastest forum ever! I usually wait DAYS for reply on other forums.

    So if the only thing I want is to have lots of storage, I don't have to care about which CPU do I have? I need to store lots of data, but only for 2-3 computers that will have access to it.

    This kind of request, in a home environment can even be handled by ARM cpu (raspberry, ...), or some older CPU. It all depend on the usage of the data.

  9. 2 minutes ago, chnapo said:

    I wonder what benefit it brings you when you have 48-core dual Xeon server versus celeron or some other weakling, if you only use it for data storage.

    Well server are not used only for storage but even if they are, many request can be resource intensive

    And what is qualified as cold storage are on lower end hardware, because it is meant to be low cost and energy efficient.

  10. 50 minutes ago, ValhallaCCB said:

    @Belzebuth, @LukeSavenije, @rarifiedbovine  So I hate to be a pester on this as I already received so much assistance on this topic. But I am unsure if I understand correctly, would a single 2080TI be able to support the three monitors running at 3440x1440p while gaming? Or should I just try to aim for the dual 1080ti's whenever I find them for a reasonable price. I'm not looking for any crazy off the wall frame rates, I would be really happy with 60 fps on high(ish) settings on games. Once again thanks so much for all the help!  

    Again I'm not a EvE player, but from what I saw, it's not a very demanding game. Plus if you have 3 or more client, you will be playing fullscreen windowed right ? So while using Windows 10, the only client that will be at ''full'' fps will be the one in focus. You really should be good with either a single 1080ti, or 2080ti.

×