Paper folder – Check that addresses have been received and changed

I use a cold card with Electrum and Electrum personal server. As far as I know, we use hardware wallets because we don't trust our laptops.

So far, however, I have only been able to check the return address on the ColdCard screen. I use a cold card with Electrum and Electrum personal server. As far as I know, we use hardware wallets because we don't trust our laptops.

However, I was only able to check the send addresses on the cold card screen when I signed transactions, and I could check my personal receive addresses using the address explorer function: https://blog.coinkite.com/address-explorer /

What remains is the review of my change addresses.

I want to do this manually on my laptop using a virtual machine (I imagine it would have to be fairly specialized malware to prevent this from happening).

Does anyone have resources to manually derive native Segwit addresses from xpubs that they can point to?

Thank you very much,

Obtain a clear image for 7.62 mm hole paper 50 meters away

I assume that you only want to count the holes on a paper target and want to know their approximate position.

7 mm at 50 meters is 0.008 degrees.

Next we have to make some assumptions about the camera. I will use my equipment, a Canon 7D, APS-C (1.6 crop sensor), about 5000 pixels on the long side.

I would like the holes to be about 10 pixels wide. This is a guess of how important it is that the holes are in the camera frame.

10 pixels / 5000 pixels = 1/500 of the frame

0.008 degrees * 500 = 4 degrees field of view

You can do this with a 400mm lens. These are fairly common and a decent lens costs $ 1,000 to $ 2,000. See this calculator.

Note that your field of view is 2.8 x 1.8 meters. This is probably bigger than your goal. If the target is to fill the camera frame, the calculation is different.

Edit: test pattern. 3.5 mm hole at 25 meters. I can't just do 50 meters.

Canon 7D, 100-400 f5.6 M1 zoom at 400 mm, f8, remote flash.

Enter image description here

Zoomed to see actual pixels:

Enter image description here

Object Oriented – Ruby OOP wants feedback on a game that was completed with rock, paper, or scissors

I have just completed my first Ruby-oop project. Pretty simple, but still a bit time consuming as I'm still learning the language.

I would like feedback and opportunities on how to improve this and improve code flow, or could have done something else to save time or the "right way".

Thank you all in advance!

My code below

class Player
    attr_accessor :name

    def initialize(name)
        @name = name
    end

end

class Game

    def player_vs_AI?
        puts "Hello User..."
        puts "Will you be playing against another person or the computer?"
        puts "Choose 1 for another person or choose 2 for the computer"
        @answer = gets.chomp.to_s

    end


    def greeting

        names = ('Bob', 'Joseph', 'Catherine', 'Paul', 'Tom', 'Baker')
        puts "Hi, please enter your name player 1: "
        name1 = gets.chomp
        @player1 = Player.new(name1)

        if @answer == '1'
            puts "Hi, please enter your name player 2: "
            name2 = gets.chomp
            @player2 = Player.new(name2)
        elsif @answer == '2'
            name2 = names.sample
            @player2 = Player.new(name2)
            puts "Player 2 will be named #{@player2.name}"
        end
        sleep(0.5)
        puts "Welcome to Rock-Paper-Scissor"
        sleep(0.5)
        puts "Welcome #{@player1.name} and #{@player2.name}nn"
        sleep(0.5)

    end 

    def instruct
        puts "The rules of the game are simplen"
        puts "Simply choose Rock(R), Paper(P) or Scissor(S) each turnn "
        puts "Paper beats Rock, Scissor beats paper and Rock beats Scissorn"
        puts "Ready....?"
        sleep(1.0)
    end

    def choice
        choices = ('r', 'p', 's')

        puts "#{@player1.name}, please choose your choice of weapon: R(rock), P(paper), S(Scissor)"
        @choice_1=gets.chomp
        @choice_1.downcase!

        while !(@choice_1 == 'r' || @choice_1 == 'p' || @choice_1 == 's') do
            puts "#{@player1.name} That is not a valid choice, please choose from r, p, or s"
            @choice_1=gets.chomp
            @choice_1.downcase!
        end

        if @answer == '1'
            puts "#{@player2.name}, please choose your choice of weapon: R(rock), P(paper), S(Scissor)"
            @choice_2=gets.chomp
            @choice_2.downcase!

            while !(@choice_2 == 'r' || @choice_2 == 'p' || @choice_2 == 's') do
                puts "#{@player2.name} That is not a valid choice, please choose from r, p, or s"
                @choice_2=gets.chomp
                @choice_2.downcase!
            end
        elsif @answer == '2'
            @choice_2 == choices.sample
        end         
    end

    def logic
        puts "Lets see who wins...will it be #{@player1.name} or will it be #{@player2.name}n"
        sleep(2.0)
        if @choice_1 == @choice_2
            puts "Opps, both players picked the same weapon, It is a TIE!!!"
            puts "Lets go back and choose again..."
            sleep(3.0)
            choice
        end
        if @choice_1 == 'r' && @choice_2 == 'p'
            puts "#{@player2.name} win!!! Paper covers Rock"
        elsif @choice_1 == 'p' && @choice_2 == 'r'
            puts "#{@player1.name} you Win!!! Paper covers Rock"
        elsif @choice_1 == 'p' && @choice_2 == 's'
            puts "#{@player2.name} you win!!! Scissor cuts Paper "
        elsif @choice_2 == 's' && @choice_1 == 'p'
            puts "#{@player1.name} you win!!! Scissor cuts Paper"
        elsif @choice_1  == 'r' && @choice_2 == 's'
            puts "#{@player1.name} you win!!! Rock beats Scissor"
        else @choice_2 == 'r' && @choice_1 == 's'
            puts "#{@player2.name} you win!!!! Rock beats Scissor"
        end
    end

    def play_again?
        sleep(0.5)
        puts "n"
        puts "Would you like to play again?(yes/no)  "
        input = gets.chomp
        if input == 'yes'
            start
        elsif input == 'no'
            puts "Thank #{@player1.name} and #{@player2.name} for playing!"
        end
    end

end

def start
    game = Game.new
    game.player_vs_AI?
    game.greeting
    game.instruct
    game.choice
    game.logic
    game.play_again?
end 
start
```

Clear image for a paper with a total length of 7.62 mm at a distance of 50 m

I assume that you only want to count the holes on a paper target and want to know their approximate position.

7 mm at 50 meters is 0.008 degrees.

Next we have to make some assumptions about the camera. I will use my equipment, a Canon 7D, APS-C (1.6 crop sensor), about 5000 pixels on the long side.

I would like the holes to be about 10 pixels wide. This is a guess of how important it is that the holes are in the camera frame.

10 pixels / 5000 pixels = 1/500 of the frame

0.008 degrees * 500 = 4 degrees field of view

You can do this with a 400mm lens. These are fairly common and a decent lens costs $ 1,000 to $ 2,000. https://www.pointsinfocus.com/tools/depth-of-field-and-equivalent-lens-calculator/#{%22c%22:({%22f%22:9,%22av%22:%228% 22,% 22fl% 22: 400,% 22d% 22: 50000,% 22cm% 22:% 220% 22},% 22m% 22: 1}

Note that your field of view is 2.8 x 1.8 meters. This is probably bigger than your goal. If the target is to fill the camera frame, the calculation is different.

Edit: test pattern. 3.5 mm hole at 25 meters. I can't just do 50 meters.

Canon 7D, 100-400 f5.6 M1 zoom at 400 mm, f8, remote flash.

Enter image description here

Zoomed to see actual pixels:

Enter image description here

design – How can trash cans be designed so that users do not throw toilet paper into these trash cans?

There is an office building with regular water flush toilets. There is a trash can next to each toilet seat so that users who have trash do not flush it into the toilet as the connected toilet and sewage pipes can become blocked.

Then there is toilet paper that is carefully selected so that it dissolves quickly when it gets into the water, so it can be safely rinsed into a toilet and does not clog it. This has been tested and is fine. The building owner agrees and the municipal utilities have also been contacted and it is okay with this agreement that their wastewater treatment plants deal with faultless toilet paper.

Then there are signs with the inscription Guys, it's okay to flush toilet paper in the toilet. Please throw all other waste in the trash can (in a language other than English, so no chance of having an exact quote).

And of course there are users. Some then flush the paper into the toilet and others throw it in the trash can. Trash bins fill up pretty quickly. This requires that the person who cleans the toilet floor also empties the trash can several times a day and moves the dirty paper along with other garbage. This is extra work and extra garbage, and a person spinning dirty toilet paper around the office every day.

Removing the trash can is out of the question since users will definitely throw the trash in the toilet. What is needed is to keep the trash can and prevent users from throwing toilet paper into the trash can.

Is it possible to redesign the trash can to fix the problem?

Game Theory – Payout with a Mixed Nash Equilibrium Rock Paper Scissors

I have the following game theory exercise. Let's consider a rock paper scissors game with the usual rules in which the loser pays the winner $ 1. In addition, Player1 gets α-dollars every time he chooses Rock, for free for Player2 (but he knows about this extra win from Player1). Use α≥0 to calculate the payout of player1 in a mixed Nash equilibrium in the following cases:

Can you help me solve that?

javascript – How do I use custom fonts in reactive paper?

const fontConfig = {
  default: {
    regular: {
      fontFamily: "sans-serif",
      fontWeight: "normal"
    },
    medium: {
      fontFamily: "sans-serif-medium",
      fontWeight: "normal"
    },
    light: {
      fontFamily: "sans-serif-light",
      fontWeight: "normal"
    },
    thin: {
      fontFamily: "sans-serif-thin",
      fontWeight: "bold"
    }
  }
};

const theme = {
  ...DarkTheme,
  fonts: configureFonts(fontConfig),
  dark: true
};

export default function App() {
  return (
    
      
    
  );
}

Chemicals – DIY inkjet transparency film or photo paper

Normal paper is cheap, but photo paper costs a LOT! Likewise, transparency film used for old projectors is usually made only from ethyl acetate and is very cheap. With transparencies for inkjet printers, however, a special coating is applied to this film to support absorption, just like with photo paper. Here, too, the price rises very much with this coating. Apparently this special coating makes the paper considerably more expensive. It is also difficult to find a good DIY guide to making and applying this coating online.

Apparently this coating can be known as a "receptor layer". This site classifies them into two types: "Particle" and "Polymer".

In general, it is said that a layer can be made from one of the following materials:

  • Particles: silica, alumina
  • Polymer: cellulose, gellatin, polyvinyl alcohol

It would be cool if you could turn one of these materials into an ink. Then you can start with normal printer paper and print a full color sheet with one of these inks. They would take out photo paper / transparency film. And you would save a lot of money!

But it would also be cool if you could make photo paper out of normal paper.

Does anyone know of mixtures of these chemicals that could improve the ink absorption of transparencies or normal printer paper?

This post on exchanging photo stacks describes some solutions, but not how they are made: How can I make my own coatings for handmade paper for inkjet printing?

Probability – Tail-bound regime for binomial distribution in Fan Chung's concentration paper

Fan Chung's Essay & # 39; Concentration and Martingale Inequalities: A Survey & # 39; gives the following inequality:

uhun

My question is whether regime inequality applies $ lambda $ His $ o ( sqrt n) $ (say $ lambda $ as small as $ n ^ {1/5} $)?

No specific regime appears in the newspaper, but I wanted to confirm it.

If not, what regime does it have?

I am interested in binomial distribution.

Game – Rock, Paper, Scissors in C ++

It's a good start! Here are some things that can help you to improve your program.

Do not abuse it using namespace std

Putt using namespace std The beginning of any program is a bad habit that you should avoid. Know when to use it and when not (as when writing include headers). In this particular case, I think it's perfectly appropriate, since it's a single short program, not a header. Some people seem to think that it should not be used under any circumstances, but I believe that it can be used as long as it is done responsibly and with full knowledge of the consequences.

Use instead of

The difference between the two forms is that the former defines things within them std:: Namespace versus in the global namespace. Language lawyers enjoy it, but for everyday use I would recommend its use , For details, see this SO question.

Use for Sanding rather than while Loops where convenient

Your gameloop Routine can be somewhat simplified with a for Loop rather than one while Loop. Here is the current code:

void gameLoop() {
    auto quit = false;
    while(!quit) {
        // other stuff
        quit = shouldGameExit();
    }
}

I would recommend to write it as for Loop to do several things. First, it changes the scope of quit Variable only within the loop. Second, it becomes clear how the initial condition is set:

void gameLoop() {
    for (auto quit = false; !quit; quit = shouldGameExit()) {
        // other stuff
    }
}

Do not use std::endl if you do not really need it

The difference between std::endl and 'n' is that 'n' only outputs a newline character while std::endl actually flushes the stream. This can be time consuming in a program with many I / O operations and is rarely needed. It's best too just use std::endl if you have a good reason to empty the stream, and it's not needed very often for simple programs like this one. Avoid the habit of using std::endl when 'n' will pay off in the future if you write more complex programs with more I / O and performance needs to be maximized.

Check the return values ​​and handle errors

The code is calling getline However, never checks for error return values. If getline If there is a problem, it sets that failbit, In C ++, this is easy to verify because the operator is cluttered. That means you could do this:

getline(cin, input)
if (cin) {  // if getline was OK
    ///
}

Think about the user

In general, it is not uncommon for users to enter incorrect inputs. That's why I think I would not throw an exception to with getUserChoice, Instead of abruptly aborting the user from the program, a friendlier option is to allow the user to correct the entry. Here's one way to rewrite this function:

Choice getUserChoice() {
    Choice userchoice;
    for (auto valid{false}; !valid; ) {
        cout << "Rock, paper or scissors? n";
        string input;
        getline(cin, input);
        if (cin) {
            if(input == "rock" || input == "ROCK" || input == "1" || input == "r" || input == "R") {
                valid = true;
                userchoice = rock;

            } else if(input == "paper" || input == "PAPER" || input == "2" || input == "p" || input == "P") {
                valid = true;
                userchoice = paper;
            } else if(input == "scissors" || input == "SCISSORS" || input == "3" || input == "s" || input == "S") {
                valid = true;
                userchoice = scissors;
            } else {
                cout << "Sorry, I didn't understand "" << input << ""n";
            }
        }
    }
    return userchoice;
}

Note that you could code a return instead of userchoice and valid Variables, but I prefer a simpler program flow without having to search for it return Statements. You can decide for yourself which taste you prefer.

Make sure that all paths return a value

The decideOutcomeOfGame Routine returns the result of the game. It is probably that all combinations are listed, but I would prefer to make sure that the function returns something each time. That's how I would write it.

Outcome decideOutcomeOfGame(Choice userChoice, Choice botChoice) {
    if (userChoice == botChoice) {
        return draw;
    } else if ((userChoice == rock && botChoice == paper)
              || (userChoice == paper && botChoice == scissors)
              || (userChoice == scissors && botChoice == rock)) {
        return bot;
    }
    return user;
}

Consider using a better random number generator

You are currently using

auto randomNumber = rand() % 3 + 1;

Usually I recommend using C ++ 11 std::uniform_int_distribution to replace the old style rand() but since you're using C ++ 17, you could use that std::sample, This reduces the getBotChoice() Function:

Choice getBotChoice() {
    constexpr static std::array choices{ rock, paper, scissors };
    static auto rnd{std::mt19937{std::random_device{}()}};
    std::vector botChoice;
    std::sample(std::begin(choices), std::end(choices), std::back_inserter(botChoice), 1, rnd);
    return botChoice.front();
}

There is now no need for the throw because the code never generates an invalid return value.

Use std::string_view where practical

The global variables are not variable strings outcomeMap and choiceMap would be better expressed as std::array from std::string_view, In other words, instead:

string outcomeMap(3) = {"You win!", "Bot wins!", "It was a draw!"};

Write this:

constexpr array outcomeMap{"You win!", "Bot wins!", "It was a draw!"};

Consider encapsulation in a namespace

It does not seem that these functions are useful without each other. Since they are so closely related (and also related to the data), I would recommend summarizing everything in one namespace,

Understand return 0 in main

When a C or C ++ program reaches the end of main The compiler automatically generates code for the return of 0, so no input is required return 0; expressly at the end of main, I recommend leaving it out to reduce the clutter and let the compiler generate code. others prefer to write it explicitly. It's up to you which style you prefer, but whatever you know about this compiler behavior.

Simplify your code

The code currently contains this construct:

if(input == "no" || input == "NO" || input == "n" || input == "N" || input == "0") {
        return false;
    } else {
        return true;
    }

As @Deduplicator correctly notes in a comment, it is better to just return the value of the expression that already exists bool:

return input == "no" || input == "NO" || input == "n" || input == "N" || input == "0";