Hashfunction for unique character distributions

The original problem is given a large input file, with n input lines of random string, find the number of pairs-> meaning same number and type of characters, in the file. Constraint on type of characters is: any legal ascii(0-127) char besides 10 and 13. I am trying to implement a hashCode function for a wrapper class over a sized 128 int array that is ideally quick and results in minimal collisions.

Hence, my approach is to process each line into a int counting array of size 128 encoding the ascii set distributions into a wrapper class, then to store this array as a key in a hashtable/hashmap ( or possibly eventually to make my own hashtable implementation with linear probe to store it in). with value as the number of matching character distributions, from which I can calculate the number of pairs additively via Handshake Lemma to accumulate as I read through lines of text.

Hence to do this, I need some advice on selecting a appropriate fast hashing function that minimises collisions, and perhaps more importantly for my own understanding, the proof or a link to the proof. Initial number of total lines is given, so if there is a formula to calculate the required size, from that, it can be done. What I have done, arbitrarily using this as my hash function so far:

public int hashCode(){         int hash = 0;         for (int i = 0; i<128;i++){             hash+= b[i]*(i+1);         }         return (hash*this.size)%capacity;     } 

Capacity meaning the size of the hashtable itself. In math terms n = Size of String, m = size of hashtable: $ \sum^{128}_{i=0}(x[i]*(i+1))*n \mod m$

The requirements for this hash function are: given a constant sized 128 int array in which each value in the index is bounded maximally by length of the string how can I come up with a unique hash.

or alternatively: given a string of size x with unique character distributions, how can I calculate the hash value, such that another string with same character distribution has the same hash value.

Ideally it will be a fast compute hash function


$0 WordPress Hosting – Raisinghost.com!

Well the subject itself elaborates everything [Image: clear.png] Isn’t it? Yes..happy to introduce our no investment and no cost free wordpress hosting with the purpose to deliver the hosting service for the everything who is new or avoiding paid hosting with the fear of loosing money if no business. Its the perfect platform for the new beginners who can try their skill and can improve their knowledge on the linux cpanel based free wordpress hosting.

This hosting will send you welcome email as soon as you done with the sign up and validation and offers you the cpanel as control panel which will be having all decent features like single script installer, email accounts, databases, ftp accounts, email send/receive facility and much. So try and improve your knowledge:

Order Now : https://raisinghost.com/free-shared-hosting.php

Our Other Services :

*$2 Unlimited Hosting
*$2 SSD Hosting
*$4 Unlimited Reseller Hosting
*$4 SSD Reseller Hosting

Our Features :

– Instant Activation
– Money Back Policy
– Live Chat Support
– On Demand Back Restoration
– Easy Billing Cycles And Upgrades
– No Contracts and Hidden Costs
– No Advanced Cancellation Required
– Higher Allocated RAM
– CloudLinux Platoform

Raisinghost.com – perfect,reliable,affordable,secured,budged,#free wordpress hosting provider

Thank you.

How one can find I am using virtual box Virtual Machine linux through Anydesk remote application?

I recently created a virtualbox virtual machine of Ubuntu 18.04 and installed Anydesk remote desktop app in it. An IT guy accessed my computers desktop via Anydesk app, but he is actually inside the Ubuntu Virtual Machine on Virtualbox. I don’t even mentioned anything about Virtualbox, but after asking me my laptop model and brand, in less than one minute he asked me “Are you using Virtualbox VM?”. I startled, he even mentioned which virtualization software I am using( virtual box) even there is VMWARE, Parallel, Nutanix and manymore. My host machine is Linux Mint. Can anyone explain how our IT guy managed to know that I am running Ubuntu 18.04 inside virtualbox as a Virtual Machine.

Why does MergeSort have O(n) space complexity if it splits the array log(n) times?

I know this is a common algorithm with plenty of analysis, but when I searched for an answer the only one I found was “Merge Sorting has O(n) auxiliary space because it copies the array into L and R”.

I don’t understand this because as it is called recursively, before performing any operations, the entire array is still split log(n) times. When following the binary tree diagram representing the recursion, we see (if n=16) it splits into 2×8, 4×4, 8×2, 16×1.

Since all of these splits occur prior to any merging, why is the auxiliary space O(n) and not O(nlog(n))?

John the Ripper doesn’t crack passwords when I use wordlists

Title says it all, I can’t tell if John is just crashing or “gives up” on cracking the hash. First I start off by creating an md5 hash out of a word I KNOW is on the rockyou.txt wordlist:

echo -n 'password' | md5sum > testhash 

After removing the hyphen at the end of the test hash file:


Now I attempt to crack the md5 hash using the following John the Ripper command:

john --format=raw-md5 --wordlist= /usr/share/wordlists/rockyou.txt testhash 

I get the output:

Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8*3]) No password hashes left to crack (see FAQ) 

Then I run:

john --show testhash 

Which outputs:

0 password hashes cracked, 2 left 

Sorry if I’m doing something terribly wrong, but I’m at a loss here. I’m assuming it’s something wrong with how my installation of John on Kali Linux is handling the wordlist. Thank you in advance!

How can I have a sidekick/squire?

In Mutants & Masterminds, you can purchase a sidekick as a feat.

I’m rolling up a knight, and I want a squire, using a similar game mechanic.

Is there anything like this in D&D, other than the Leadership feat? I don’t want a small gang of cohorts, but only one follower.

Or would this just be a ‘the GM rolls them up as an NPC and you wing it’ kind of thing?