Questions tagged [algorithms]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

QNX 4 Scheduling Algorithms

Can we have one of the experts explain how the QNX 4 adaptive scheduling algorithm works? I am looking for a particular case where we have multiple tasks of the same priority in READY state waiting ...
0
votes
1answer
26 views

Arguments for, and the applicability of, using multiple forms of compression on one or more files?

I was wondering whether there are any scenarios which require file(s) to be compressed multiple times with the same or a different algorithm. As far as i can tell the file size can be reduced further ...
1
vote
2answers
396 views

Transforming if statement in case

I'm currently testing changes in my scripts for performance purposes. Specifically, I want to change if to case statements. However, being new to shell programming I'm getting stuck on this type of ...
0
votes
2answers
138 views

Trying to complete Project Euler #5, passes all syntax checks but doesn't work

trying to complete Project Euler #5. The code I have should logically work, and it passes ShellCheck, but gives no output for some reason. The code is below. Thanks and sorry if this should be in a ...
1
vote
1answer
1k views

OpenSSH accesslog : Logging ciphers, MAC and user agent

How to log the Protocol, KexAlgorithm, Cipher and MAC algorithm negociated by the client and the client's user agent string? What I'm looking for is the OpenSSH equivalent to Apache HTTPD's CustomLog+...
0
votes
3answers
446 views

Can I obtain microsecond granularity when I calculate the number of nanoseconds from Windows Epoch to today?

Using Ubuntu Linux 16.04 and g++, I was wondering if could obtain microsecond or millisecond granularity when I calculate the number of nanoseconds between Unix Epoch or Windows Epoch and an arbitrary ...
3
votes
2answers
135 views

How can I partition a set of words given pairs that must end up together?

I have a space or comma separated table with two columns, each row representing equivalence of the two words. A B B C B D C E F G What I want is a table with each row listing all mutually ...
4
votes
4answers
876 views

Can I use scrypt to hash for LUKS?

Can scrypt be used as the hashing algorithm for LUKS? Can I tune its parameters? How can I do this?
16
votes
5answers
7k views

Is there an algorithm to decide if a symlink loops?

Unix systems usually just error out if they are confronted with a path that contains a symlink loop or just too many symlinks, because they have a limit to the number of symlinks they will traverse in ...
4
votes
4answers
8k views

Grepping over a huge file performance

I have FILE_A which has over 300K lines and FILE_B which has over 30M lines. I created a bash script that greps each line in FILE_A over in FILE_B and writes the result of the grep to a new file. ...
28
votes
1answer
3k views

Why isn't a straightforward 1/5/15 minute moving average used in Linux load calculation?

Until recently I thought the load average (as shown for example in top) was a moving average on the n last values of the number of process in state "runnable" or "running". And n would have been ...
9
votes
3answers
1k views

Why does it makes sense to cache swap?

It sounds quite counter-productive to me to cache pages that are swapped out. If you swap pages in, what is the advantage to first cache them in memory, only to have to than move them to the right ...