20

'…' instead of a 'r'

Comments
  • 2
    @juli14159 My two cents: @sarapnst is downloading it at work so it's ready to be extracted or even used at home.
  • 0
    Cuz it looks better that tar.gz 😝
  • 1
    I am sure r is shorter than ...
  • 1
    @CozyPlanes That's the point of the post.
  • 2
    If somehow it is not obvious for someone - algorithm checks if file name is longer than X chars, if so - cut it there and add "...", but always place extension because it is important.
    If you would like to prevent such nonsense, there should be if len>X+3 instead.
  • 1
    @blem14 a single char is not worth 3 dots, not a well written algorithm will do that
  • 1
    @--force It's been a WHILE since I haven't checked devRant, but it could be Windows 10 WiFi connectivity issue!!
  • 1
    @sarapnst you seem not understand what I wrote. I explained THIS alghoritm for those who wonder why it replacer 'r' with '...', pointed out that it is nonsens and presented more suitable equation which will replace 3 chars at the end if length of text is greater than limit (X) but considering those 3 letters. In fact I see now that I kinda messed that up, but my point was, that only if you replace 4+ chars with 3 dot that would make sense, cause there would be always X amount of characters.
    Example
    >>> X = 10
    >>> text = 'abcdefgh.ij' # len == 11
    >>> shorten(text) # len == 10
    'abcd....ij'

    However you can see on screen that is in fact single char representing dots (0x2026).
  • 1
    @blem14 Oh! Yeah I just hadn't read the last part, yep, Google, rewrite your algorithm as @blem14 said :))
Add Comment