Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/24/23 in all areas

  1. Brian Evans

    Determine the language

    Scoring using the most common words for each language works surprisingly well. Even scoring each line using the 50-100 most common words works most of the time except for very short lines or odd fragments of longer sentences. If the scores are close for different languages a more complex approach can be used for that line. Would work better if you can group lines together in paragraphs or sentences so very short lines would be less of an issue. Even just the 10 most common words works for longer text and a lot of short text English : the be to of and a in that have I French: être avoir je de ne pas le la tu vous German: wie ich seine dass er war für auf sind mit
  2. Stefan Glienke

    String comparison in HashTable

    I am not sure what y'all discussing here but the snippet that Tommi posted is about checking the first character before even calling strncmp (video at around 15:15). It's pretty obvious why that is faster - if the characters don't match you get rid of the function call. The algo does not need to restrict anything - the hashtable contains all keywords and the input is any string that occurs in the source code - if it's a keyword, it gets found, if it's not, then it won't be found, simple as that.
  3. We are looking for Delphi developers working on our existing and new products. Your tasks: development of backend classes based on DDD architecture development based on defined requirements working on risk analysis and test requirements Your profile: senior (Delphi) developer experiences working with current development tools working with teams and alone knowledge with common dmbs knowledge with mORMot advantageous German and/or English Further information can be found in our official job offer: https://www.psyprax.de/wp-content/uploads/2023/Stellenanzeigen/MA_Software-Entwickler_.pdf Feel free to contact me for any questions.
  4. A.M. Hoornweg

    Rounding issue

    If the number of decimal places is not greater than 4, OP might consider using the currency data type. Currencies are exact fixed-point numbers having four decimals after the dot so a value like 1.015 can be stored with perfect precision. Adding, subtracting and comparing currencies always gives an exact result. Internally, they are 64-bit signed integers with an implicit divisor of 10,000. [edit] functions like "power" return a double or extended. Prior to comparing the results of such functions, store them in currencies.
  5. I watched the video in jumps but what I understood: - The guy needs specialized function to check if a word is from a very short set of predefined words - These words are latin - He uses "hash" as int32 = s[0],s[1],s[-2],s[-1] (inputs are ASCII/UTF8 but algo may also work with UTF16 with only 1st and last char used as hash) (hmm, but he'll got array of 2bil of pointers then...) - The hash is assumed to be unique for his set (he just takes wordlist[key] without any sub-arrays of items with the same hash) - And he also checks for 1st char before running full compare
×