Jumping to anchor within modal with a fixed header

Hi all,
I am having a bit of a problem.
I have a script that is for nested modals, that when a link is clicked it jumps straight to an anchor. It works fine.
However when styling, I would like to have a fixed header as the ".content" div scrolls to the anchor.
When ".content" has a height of 80vh it looks fine, but the script doesn't scroll to the anchor.
When ".content" has a height of 80% the script works, but the fixed header doesn't stay fixed and scrolls with the ".content".
How can I…

Jumping to anchor within modal with a fixed header

Compiz: Fixed window placement, which alternative?

At login two windows are automagically opened. For the purpose of fixed location of these, I am trying CompizConfiguration Settings Manager, function Place Windows. The Fixed Windows Placement tab gives me three choices: Windows with fixed position, Windows with fixed placement mode, and Windows with fixed viewport.

What is the difference between these alternatives? I have tried to find an explanation, but miserably failed. Any light on the matter is gratefully received.

See also 1.

Sampling a uniform distribution of fixed size strings containing no forbidden substrings

Given a list of “forbidden” words (substrings), an alphabet, and a desired output string length, how would I efficiently sample output strings containing no forbidden word?

For short output strings with few forbidden words, I would use simple rejection sampling. Pick a string (uniformly) with the specified alphabet and length, return that string if it contains no element of the forbidden list, try again otherwise.

If I use that algorithm for output lengths several times larger than the typical forbidden word, then the probability of rejection will be higher. (Most words are 2 or 3 characters long.)

Assume the requested output length is too long to enumerate and store every possible value. My alphabet size would be 16 to 36 characters, but solutions to large alphabets would be interesting to think about. (In which case I would call these things random sentences, forbidden n-grams, and dictionary words.)

My forbidden word list will have one hundred to one thousand strings. I would like to avoid solutions requiring expensive precomputation or lots of memory.


My first idea was to try to build a random string incrementally, in contrast to the all-or-nothing approach of straightforward rejection sampling. I doubt that my algorithm produces each possible output with equal probability.

The algorithm idea follows:

  1. Initialize a char buffer long enough to fit outlen characters.
  2. Pick a random letter of the alphabet and append it to the buffer.
  3. If the buffer ends with a forbidden word of length k, then remove the last k letters from the char buffer and go to 2.
  4. Otherwise, go to 2 if the buffer has less than outlen characters.
  5. Return the contents of the buffer if it is full.

Step 3 serves to rewind the algorithm, returning the char buffer to a previous legal state.

I understand that clearing the whole buffer in step 3 definitely would produce uniform output just like the straightforward rejection sampling method. However, the average number of rejections before the first valid output is generated will be the same.

I’ve gotten stuck trying to determine if my proposed algorithm is uniform. I have had no luck finding alternative algorithms either. I haven’t yet looked at how this algorithm’s performance would compare to basic rejection sampling.

Using a fixed decimal when filling a currency amount input field

When entering currency amounts into an input field, I’ve seen two methods:

Keyed Decimal: The keypad includes the decimal character and the user enters the decimal along with the numbers. The Chase mobile app uses this approach.

Key  Display  5       $  5  4      $  54  .     $  54.  6    $  54.6  3   $  54.63 

Fixed Decimal: The keypad excludes the decimal character and the numbers fill around a fixed decimal. The PayPal and Square mobile apps both use this approach.

Key  Display  5    $  0.05  4    $  0.54  6    $  5.46  3   $  54.63 

The keyed decimal approach seems more straightforward to me, and it also requires 2 fewer keystrokes when entering non-decimal amounts (e.g. $ 10 only requires typing 1-0, instead of 1-0-0-0). However, users of our payment processing app have accidentally charged amounts like $ 123,456.00 instead of $ 1,234.56 because they were expecting a fixed decimal interaction instead of a keyed decimal interaction.

Is this just a matter of preference, or are there other merits to a fixed decimal approach that I may be overlooking?

set (fixed) tab titles, for different profile

Ubuntu 18.4.

In my gnome-terminal I have defined let’s say 2 profiles: hostA hostB

Profile of hostA execute custom command “ssh hostA.example.com”. Profile of hostB execute custom command “ssh hostB.example.com”.

So, when I click: file -> new tab -> hostA I connect to hostA when I click: file -> new tab -> hostB I connect to hostB

Now, when I open a new tab on profile hostA I would like ‘hostA’ to be the tab title of that terminal tab, when I open a new tab on profile hostB I would like ‘hostB’ to be the tab title of that terminal tab

Is that possible?

Thank you very much.

How to generate short fixed length cryptographic hashs?

I am trying to implement a kind of email verification system with a node.js server with no state.

The strategy

  1. User sends his email to the server
  2. Server generate a 4 digits code based on the email address and sends it to the user via email.
  3. User sends back the received code via email + the email address to the server
  4. Server re-generates the 4 digits code based on the email and compares it with the code sent by the user.

My implementation to generate the 4 digits code

  1. Create a HEX digest using HMAC SHA-256 hash function
  2. Take the first 3 characters of the digest
  3. Convert them to an integer
  4. If length < 4, concatenates one or multiples 0 at the end
const crypto = require('crypto')  const get4DigitsCode = (message) => {   const hash = crypto     .createHmac('sha256', Buffer.from(SECRET_KEY, 'hex'))     .update(message)     .digest('hex')    const first3HexCharacters = hash.slice(0, 3)    const int = parseInt(first3HexCharacters, 16)    let code = int.toString()   code =     Array(4 - code.length)       .fill(0)       .join("") + code    return code } 

After generating codes for 8293 email addresses, I noticed that I had 4758 duplicates. Is it normal to have this amount of duplicates for a code as this sort ? Is my strategy and my implementation secure (ability to guess the code) ?

High Resourced – Fixed Pricing – Half Dollar Hosting – Hostbazzar.com!

Hostbazzar.com provides the great low cost hosting solutions in hosting field….you can host your site in Low Price and with the assurity that rates wont be changed in the future hence Host Bazzar is market's best hosting company..Just as your hottest host company..

You will find an unmatching high quality Reliable and Budget Hosting Solution's with Hostbazzar also features of our services will meet with your requirement and will help you to succeed on the Internet, so try our refund…

High Resourced – Fixed Pricing – Half Dollar Hosting – Hostbazzar.com!

High Resourced – Fixed Pricing – Half Dollar Hosting – Hostbazzar.com!

Hostbazzar.com provides the great low cost hosting solutions in hosting field….you can host your site in Low Price and with the assurity that rates wont be changed in the future hence Host Bazzar is market’s best hosting company..Just as your hottest host company..

You will find an unmatching high quality Reliable and Budget Hosting Solution’s with Hostbazzar also features of our services will meet with your requirement and will help you to succeed on the Internet, so try our refund policy protected Hosting solutions and make hostbazzar.com as your affordable web hosting provider today..

Services included with Featured and prices :

Shared Hosting Types and Plans : 

>> Unlimited cPanel Shared Linux Hosting starting from $0.5/mo 

>> Best Selling SSD Shared Hosting with Max Features starting from $2.90/mo

>> Windows Shared Hosting starting from $2/mo

>> Most Demanded #Application Hosting starting from $0.5/mo

Reseller Hosting Types and Plans :

>> Max CPanel with unlimited features Linux Reseller Hosting plan starting from $4/mo

>> Best #Seller SSD Reseller Hosting plan with max features starting from $6.99/mo

>> Unlimited cPanel Account Reseller Hosting Plans starting from $10.99/mo

>> Windows Reseller Hosting plans starting from $12/mo

More Features :

~ Easy Billing Cycles
~ No Hidden Costs
~ Unlimited Sub Domains 
~ Unlimited MySQL Databases 
~ Unlimited Mail Boxes  
~ Unlimited Parked Domains 
~ Unlimited FTP Accounts 
~ Server Side Includes 
~ HTML Editor 
~ Dream weaver compatible 
~ Secure IMAP & POP3 
~ Override .htaccess Support 
~ Unlimited Auto responders 
~ Unlimited Forwarders 
~ Squirrelmail Webmail 
~ Horde Webmail 
~ Free Migration Service
~ Spamhaus & SpamCop Checks 
~ Catch-All Email Addresses 
~ Ports 26 and 587 Outgoing 
~ ImageMagick, NetPBM, GD 
~ Curl, DomXML, mod_rewrite 
~ Zend Optimizer 
~ ionCube PHP Loader 
~ DDoS Attack Response 
~ Brute Force Detection 
~ Nightly Security Updates 

We appreciate the opportunity and look forward for quick orders.

http://www.hostbazzar.com >> Order Now.

Thank you!