Installation – Alternative modules to the environment (Lua / Lmod) for small Linux infrastructure

I am the new system administrator of a laboratory that contains ~ 20-25 computers running on Linux (Ubuntu 16.04-18.04). The real system for software management is a computer used as a Lua / Lmod module server.
When someone wants to use a program, "load the module" and have access to it. Did you want to know if this is the most appropriate solution for this type of infrastructure? Is there another / better way?

Thanks for the help and suggestions!

An alternative algorithm for sorting a stack using only one additional stack

From "Deciphering the coding interview":

Write a program to sort a stack in ascending order (with the largest items at the top). You can use at most one additional stack to contain items, but you cannot copy the items into any other data structure (such as an array). The battery supports push, pop, is_emptyY peek

So, the classic solution I found online for this (and the one in the book) is something like this:

Something # 1 (Classic)

def sort_stack(primary):
  secondary = ()
  while primary:
    tmp = primary.pop()
    while (secondary and secondary(-1) > tmp):
      primary.append(secondary.pop())
    secondary.append(tmp)
  return secondary

The essence of this is that we will return our secondary / auxiliary battery after ordering by time O (n ^ 2).

However, this is not my initial approach, and I think my approach has some interesting qualities:

Something # 2 (mine)

def sort_stack(primary):
  did_sort = False
  secondary = ()
  while not did_sort:
    # move from primary to secondary, pushing larger elements first when possible
    desc_swap(primary, secondary)
    # move from secondary back to primary, pushing smaller elements first when possible. Set did_sort = True if we're done and can exit.
    did_sort = asc_swap(secondary, primary)
  return primary

def asc_swap(full, empty):
  temp = None
  did_sort = True
  yet_max = None

  while full:
    if not temp:
      temp = full.pop()
    if full:
      if full(-1) < temp:
        insert = full.pop()
        if insert < yet_max:
          did_sort = False
        yet_max = insert
        empty.append(insert)
      else:
        empty.append(temp)
        temp = None
  if temp:
    empty.append(temp)
  return did_sort


def desc_swap(full, empty):
  temp = None
  while full:
    if not temp:
      temp = full.pop()
    if full:
      if full(-1) > temp:
        empty.append(full.pop())
      else:
        empty.append(temp)
        temp = None
  if temp:
    empty.append(temp)

Now, obviously, it is not so clean or elegant, but it could be with some auxiliary functions that dynamically choose our comparator and choose which element to push, etc.

Basically what he is doing is this:

# Start with stack in wrong order (worst case)
primary:   4 3 2 1
secondary:  

# Swap to secondary, pushing larger elements first (1 is held in temp until the end because it is smaller than the following elements)
primary:    
secondary: 2 3 4 1

# Swap back to primary, pushing smaller elements first
primary:   1 3 2 4
secondary:  

# back to secondary 
primary:   
secondary: 4 3 2 1

# Back to primary, finished
primary:   1 2 3 4
secondary:

This strategy has a best / worst case compromise solution.
Something # 1 really does worst when the battery is already sorted and better when the battery is ordered in the wrong order, and something # 2 does the opposite.

Questions

  • What are your thoughts? I think it's an interesting way to order that I haven't seen before.
  • Is there a name for this type of classification? I couldn't find something similar, but I'm sure they are out there and I would love to describe / recognize it better. Thank you!

Live view: Does any manufacturer's EVF camera (or alternative firmware) implement a multicolored focus peak or a histogram position?

It would be logical and useful to use fake colors (perhaps layered on a black and white EVF screen) to indicate how strong a maximum contrast is. Alternatively, it could be a more accurate way to show, for example, zones of the zone system in the chosen exposure (not just zone 9/10, as does the common characteristic of "zebra").

Has any manufacturer implemented such a feature yet? Could it be implemented realistically, for example, in Magic Lantern?

Suggestion on writing practices of programming code C and alternative to the K&R book

This is a program exercise from The C Programming Language by Kernighan and Ritchie (Chapter 5).
To my previous question here

A user suggested sending me my code here, saying that there is a whole
A lot of bad coding practice in this snippet. From most harmful
the practice here originates in K&R, you might want to consider a better
source to learn C.

What are the cases of bad coding practice in this program? How can you improve or write more compactly?
Yes Kernighan and Ritchie C programming language It is not a good way to start learning. C programming suggests a good alternative reading.

//Exercise 5-10. Write the program expr, which evaluates a reverse Polish
//expression from the command line, where each operator or operand is a
//separate argument. For example, expr 2 3 4 + *
//evaluates 2 x C+4).

//For multiplication character '*' is not working

#include
#include
#include
#include

#define MAXLINE 1000
#define NUMBER 0

int sign = 1;
char s(MAXLINE);

void calc (int type);

int main(int argc, char *argv())
{   
    if (argc < 4)
        printf("Usage: ./ op1 op2 operatorn");
    else 
    {
        int i, d;
        int c;

        while (--argc > 0 && (c = **++argv) != 'n')
        {   
            i = 0;
            printf("nargc = %dtc = %c:%d", argc, c, c);
            if (c == '+' || c == '-' || c == '*' || c == '/' || c == '=' || c == 'n')
            {
                printf("nNon-Digit: %c : ", c);
                if ((c == '+' || c == '-') && isdigit(d = *++(argv(0))))
                {   
                    printf("tSign");
                    sign = (c == '-') ? -1 : 1;
                    c = d;
                    goto DOWN1;
                }
                else
                {   
                    printf("Operator");
                    printf("nRead Operator: %cn", c);
                    calc(c);
                    goto DOWN2; //To avoid re-executing calc(Number) which
                                //is outside any loop in main when operator
                                //is read and operation is performed.
                }   
            }

DOWN1:      while (isdigit(c = *argv(0)))
            {
                s(i++) = c;
                c = *++(argv(0));

                if (**argv == '.')
                {
                    s(i++) =  **argv;
                    while (isdigit(*++(argv(0))))
                        s(i++) = **argv;
                }
                s(i) = '';
                printf("ns() = %s", s);
            }
            calc(NUMBER);   //Outside while to get single push of s()
                            //after reading the complete number
    DOWN2:  ;
        }   
    }
    return 0;
}

void push (double f);
double pop(void);

void calc (int type)
{
    double op2, res;
    switch(type)
    {
        case NUMBER:
            push(sign*atof(s));
            sign = 1;
            break;
        case '+':
            push(pop() + pop());
            break;
        case '-':
            op2 = pop();
            push(pop() - op2);
            break;
        case '*':
            push(pop() * pop());
            break;
        case '/':
            op2 = pop();
            push(pop() / op2);
            break;
        case '=':
            res = pop();
            push(res);
            printf("ttt||Result = %lg||n", res);
            break;
        case 'n':
            break;
        default:
            printf("nError: Invalid Operator!n");
            break;
    }
}

#define STACKSIZE 1000
double val(STACKSIZE);
int sp = 0;

void push(double f)
{
    if (sp >= STACKSIZE)
        printf("nError: Stack Overflow!n");
    else
        val(sp++) = f, printf("nNum %lg Pushed to Stackn", f);
}

double pop(void)
{
    if (sp != 0)
    {
        double ret = val(--sp);
        printf("nNum %lg Popped from the Stackn", ret);
        return ret;

    }
    else
    {
        printf("nError: Stack Empty!n");
        return 0.0;
    }
}

I am looking for an alternative to Digital Ocean!

Hi, can you give me better alternatives than Digital Ocean when it comes to VPS with a similar price? Basically, I host a small website that I use as storage for images / videos / data, as well as to stream a movie / anime from the site to a lot of people in my community.

In Digital Ocean, my plan is the $ 10 monthly plan for 2 GB of ram, 1 vCPU, 50 GB of SSD space, 2 TB of bandwidth.

I would appreciate it if the provider you recommend offers data centers in the EU.

Thank you.

Alternative to `llvm-objcopy` sent with macOS?

I have used llvm-objdump in macOS Mojave to work with binary files.

However, I can't find your counterpart llvm-objcopy anywhere in the system.

Does that mean Apple has installed an alternative? If so, what is it called?

How should I design my table or what is the alternative?

I want to have a table where I don't want to show repeated data. Each column must be treated differently. Should I use different tables or what is the best way to show them? Example:

|-----------------------------|
|Column1 | Column 2 | Column3 |
|--------|----------|---------|
|dolphin | Rakesh   | social  |
|cat     | Dan brown|         |
|        | Ella     |         |
|        | Ella     |         |
|        | Ella     |         |
|        | Ella     |         |

For singles column I can have repeated data. In the table above, She repeats herself if she had different values ​​of column 1 and column 3, it doesn't look good. for example:

|-----------------------------|
|Column1 | Column 2 | Column3 |
|--------|----------|---------|
|dolphin | Ella     | social  |
|cat     | Ella     | social  |
|dolphin | Ella     | Introve |
|        | Ella     |         |
|        | Ella     |         |
|        | Ella     |         |

How can I show it in a table? If I have data like this:
enter the description of the image here

Alternative to paypal

I have a site where users earn money by publishing ads in the advertisements of their personal site.
From time to time they need to withdraw money from the overall balance of the site.
Paypal seems like a pretty wrong choice to manage this type of site:

– Rates for customers to deposit money
– Rates to send (withdraw) money to customers
– The Send Money page only covers purchases and personal payments (the withdrawal operation to customers is not a purchase, but is it not a personal payment either?).

There is more …

Alternative to paypal

Alternative to the YouTube application where we can play random videos of our subscribed channels

I know there is an automatic playback function, but it shows the following video that is similar to the video you are watching and the automatic playback at some point also plays videos that we had already seen.

Any alternative to Platinum server management?

I am running Cpanel / WHM and using Platinum Server Management because they have been around for a long time, people have nothing really bad to say … | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1779203&goto=newpost