dslr – Is it possible to resize a large picture by file size and not resolution?

Save (export) it from any graphics/photo app as a JPG or PNG.

I tested a 180 MB 16-bit TIF file. (Saved as an 8-bit TIF this would be only ~23 MB, which is what I imagine your photographer will be supplying.)

It saved to a 6.5 MB JPG, even at 100% quality (same size, no other adjustments). Reducing that to just a ‘high’ quality got it down to 1.3 MB. This would be more than sufficient quality for such as LinkedIn.

As an 8-bit PNG (which is a lossless format), it was 8 MB.

dnd 5e – How do features that specify you become a specific size interact with features that increase your size category?

Rune Knight’s Giant’s Might states:

If you are smaller than Large, you become Large, along with anything you are wearing.

(Note: I am linking to the UA because it is freely available and has the same wording for the feature related to this question.)

The spell Enlarge/Reduce states:

Enlarge. The target’s size doubles in all dimensions, and its weight is multiplied by eight. This growth increases its size by one category – from Medium to Large, for example.

Is it simply a matter of order of operations? Interpretation A:

  1. A Hill Dwarf Rune Knight activates Giant’s Might, causing his size to become Large.
  2. His ally casts Enlarge/Reduce on him, using the Enlarge Option, causing his size to become Huge.

As opposed to inverting the order:

  1. Enlarge/Reduce causing his size to become Large.
  2. Giant’s Might, causing his size to not change.

Or does one feature override the other resulting in Interpretation B, due to Specific Beats General:

  1. Giant’s Might, causing his size to become Large.
  2. Enlarge/Reduce, causing his size to not change, because Giant’s Might forces it to be Large.

Size of top-level domain (TLD) servers? Especially .com?

Sorry if this is a silly question or if I’m asking in the wrong place. But I’ve been learning about DNS, and there’s something that’s bugging me about top-level domain (TLD) servers especially the .com one. If I’m understanding right, the .com TLD server has a record of every .com site in existence? I checked Wikipedia, and it says there’s about 145 million .com sites registered.

Am I understanding correctly that the .com TLD server (really a server cluster) is absolutely massive to store this many records? Or maybe nowadays, though very large, that’s really not unreasonable? I do want to state I understand the TLD server merely points to the authoritative name server so it doesn’t contain the entire DNS record of every .com site. But I’m still struggling to wrap my head around this. I know I could be mistaken but this doesn’t seem right to have so many records stored at one place, so I’m asking if I’m understanding this correctly. Thanks!

c# – Why does CreateProcess ignore STARTUPINFO window size values?

I am trying to use CreateProcess to start Notepad at a specific window size to avoid the flashing that occurs when it appears somewhere for a split second before I can resize it and move it.

CreateProcess starts Notepad but CreateProcess and Notepad both ignore the window dimensions in the STARTUPINFO structure. Notepad appears in the normal place at the normal size where it was last closed.

No combination of dwFlags that I tried worked. Notepad either does not appear at all or ignores my settings and appears in a place and size determined by the operating system.

Why is CreateProcess ignoring the values I set in STARTUPINFO? Am I missing something?

(TestMethod())
  public void CreateProcessTest() {
    const uint NORMAL_PRIORITY_CLASS = 0x0020;
    const uint STARTF_USESHOWWINDOW = 0x0001;

    // create structures needed by CreateProcess
    var pInfo = new Kernel32.PROCESS_INFORMATION();
    var pSec = new Kernel32.SECURITY_ATTRIBUTES();
    var tSec = new Kernel32.SECURITY_ATTRIBUTES();
    pSec.nLength = Marshal.SizeOf(pSec);
    tSec.nLength = Marshal.SizeOf(tSec);

    // set the app and a file to open
    var app = Environment.GetEnvironmentVariable("windir") + @"notepad.exe";
    var arguments = @" C:somefile.txt";

    // the started app window does not use these values
    var sInfo = new Kernel32.STARTUPINFO();
    sInfo.dwX = 800;  // desired x-y position of the window
    sInfo.dwY = 400;
    sInfo.dwXSize = 200; // desired size of the window
    sInfo.dwYSize = 400;

    // no combination of these flags that I tried makes any difference
    // Notepad always appears as normal and ignores the size settings above
    sInfo.dwFlags = STARTF_USESHOWWINDOW;
    sInfo.wShowWindow = (short) Win32.SW_SHOW;

    // create the process
    var result = Kernel32.CreateProcess(app, arguments,
      ref pSec, ref tSec, false, NORMAL_PRIORITY_CLASS,
      IntPtr.Zero, null, ref sInfo, out pInfo);
  }

combinatorics – Size of a set for which only some subset sizes are given

Consider a finite set $X$ and a set of subsets $X_i subset X$ with $bigcup_i X_i = X$.

Assume that only the sizes $|X_i|$ and $|X_i cap X_j|$ are given. Obviously $|X| leq sum_i |X_i|$.

How can one calculate the (minimal) size of $X$? And what is a tighter upper bound?

kvm virtualization – qcow2 image greater than guest disk size

Fedora 33
Kernel 5.11.7
Running kvm

Virtual Disk:

<devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/w10.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>

Disk Space: 40 GB

# ls -lh /var/lib/libvirt/images/w10.qcow2
-rw-------. 1 qemu qemu 78G 17. Apr 12:32 w10.qcow2

# virsh snapshot-list w10
 Name   Erstellungs-Zeit   Status
-----------------------------------

(no snapshots)

Question: Why is the qcow2 image so much greater than the real disk space in the guest?

matrices – Calculating average step size in a grid?

I’d like to calculate what the average step size of a n x m grid is.

Given a grid of n x m, where each (x, y) cell can be a starting and a goal cell, how would one calculate the expected step count required to reach from position (S_x, S_y) to (G_x, G_y)?

One can only move horizontally and vertically in the grid, not diagonally.


For example, for a grid with 3×3, the average step required to reach a random cell from another random cell is: 2


Background: I’d like to tweak the reward of a Deep Reinforcement Learning agent according to how difficult the problem is.

Thanks for any input!

protocol – (How/Why) – Work vs Block Size Limit and Leading Zeros

Tl:dr
How did Satoshi/the community decide an appropriate block-size-limit?
Why does the protocol increase mining difficulty by adding zeros?

I’ve some limited experience with some of the cryptographic concepts underlying bitcoins protocols.
I have two questions.
Given the fact that there is an upper limit on block size, perhaps the easiest way to breach this is to arrive at an some exceedingly large nonce which will become necessary due to other block contents. The question is, how do you set an appropriate limit for arbitrary blocks?
Would you need to know about inverting the hashing-algorithm in order to prove the efficacy of a given limit for an arbitrary ledger/header/nonce set?

Second question is about the relevance of increasing the leading zeros over time. Would it not be equivalent (wrt work done) to set a total number of zeros? That is, would you need to know about inverting the hash algorithm in order to prove that difficulty is increasing by adding leading zeros as opposed to any other “pattern” of any other hex character of the same cardinality?

Please forgive and correct my understanding of the issues in question.

sensor size – Focal length for a specific distance?

I have the following information:

s: Image sensors dimensions: 6.00mm, 4.80mm, 3.60mm (diagonal, horizontal, and vertical)
f: focal length range: 5.1mm - 51mm
f=(s*WD/FOV), where `WD` is the working distance and the `FOV` is the object size. 

I would like to compute the optimal f for a given WD=10m and FOV=1mx1m.

Which sensor dimension should I choose (diagonal, horizontal, or vertical)? Since the results differ quite heavily depending on that.

Thanks

dnd 5e – Do weapons looted from creatures that are larger than Medium in size retain their damage when wielded by Medium-sized PCs?

Technically speaking, yes. The looted weapon will still deal extra damage.

Big monsters typically wield oversized weapons that deal extra dice of damage on a hit.

The “that” is pretty clear – the weapons deal extra damage, not the monster.

However, you should be extremely cautious in making these rules (and weapons) accessible to players. The rules on creature size are in the PHB, but these rules are in the DMG. They’re not meant to be easily accessible to players.

A player who is making a conscious effort to gain advantage on their attacks can do so fairly easily. That makes wielding oversized weapons a pretty nice option for any player who wants to build around it. At the very least, if you’re planning to allow this, consider implementing the suggested rule that it is impossible to use a weapon two sizes too big.