XiPingTing

u/XiPingTing


r/AskPhysics•

Globally entropy always increases, but regions within that space where entropy decreases, that's allowed.

Life is able to sustain regions of low local entropy by using energy. There are emergent behaviours from this like evolution and reasoning, with a clear arrow of time.

There are things that we can do to locally decrease entropy within some region. These include implosions and refrigeration.

If some advanced civilisation triggered a galactic scale implosion or cooling event, could they get entropy to decrease sufficiently steadily that life emerged evolved and reasoned in a time-reversed manner?

Put another way, is the 'arrow of time' simply the direction from low entropy to hig

010

r/rust•

If I can build a program from source multiple times and get an identical binary with an identical checksum, then I can publish the source and the binary, with a proof that the binary is the compiled source code (assuming the checksum is collision-resistant). It is a much more reasonable exercise to auditing code than to reverse-engineer a binary, when looking for backdoors and vulnerabilities. It is also convenient to use code without having to compile first and fight with dependency issues.

In C, you can have dependencies that deliberately bake randomness into builds, but typically it is a reasonable exercise to make a build reproducible. Is this this case with Rust? My understanding is no

10528

r/C_Programming•

I have two competing mental models of how io_uring works. Both seem obvious or silly depending on how you look at it so I’m looking for clarification.

Nonblocking: I submit a single poll or epoll_ctl to the SQ and wait for this. I read the CQ and learn that 5 file descriptors ready to read (or write). I then submit 5 reads to the SQ for each of those file descriptors. I then wait on the CQ until each of those reads complete. I then resume execution for each fd, and submit a write for each. I then wait for all those writes to complete, some of which might -EAGAIN/-EWOULBLOCK.

Under sufficiently high load, both the kernel and user-space threads poll continuously and I never make any system c

1313

r/cpp_questions•

io_uring is often used for network IO, but with its ‘polling’ mode, it can remove the need for all sorts of system calls so has quite general applicability.

I was wondering if anyone had come up with an allocator that internally submits mmaps to the SQ and then checks the CQ later to see if the region of memory is ready for use. This might need a slight change in the interface. You could then reuse memory regions with a normal maybe jemalloc style strategy.

Is this a thing?

35

r/ipv6•

I’ve written a web server in C++ running on a Raspberry Pi 1B.

With IPv4 you can configure fail2ban to block IP addresses that spam your site. Obtaining a large number of IPv4 addresses is expensive or even impractical. This protects my site from attackers with low to moderate levels of resources.

With IPv6 the problem still exists but the solution needs to be different. Aggregating /64 subnets could work I guess but this feels like a hack that undoes a lot of IPv6’s benefits.

What is best practice here?

3347

r/HomeNetworking•

I am based in the UK and will be visiting relatives in Portugal in a few weeks. There are new rules in the UK around internet access. I am already paying for a static IPv4 address. I do not currently have a VPN. I am considering the following configuration:

I have a raspberry pi in the UK plugged into my router accessible at this IPv4 address. I will, with permission, plug another raspberry pi into the router in Portugal.

I am then planning to SSH from Portugal to the UK to set up a reverse SSH tunnel. I will use cronjobs to reconnect if there is downtime.

I will then jump SSH through the UK raspberry pi to the reverse tunnelled Portuguese raspberry to set up a SOCKSv5 server on my MacB

14

r/crypto•

A mobile client connects to a proxy server from one IP address and gets a session resumption ticket. The proxy server then forwards the request to another server that actually handles the request. The proxy server’s purpose is scalability and so we want to proxy at the TCP layer rather than encrypting and decrypting the TLS traffic.

The mobile client then connects from a new IP address, e.g. a different 4G node.

Ideally the proxy server would inspect the session resumption ticket so that it could forward the request to the same backing server.

This architecture allows the backing server to store its session resumption keys locally, and therefore atomically delete the ticket after the firs

51

r/civ5•

I am playing Civ 5, Brave New World, on a macbook. It's a Mac M1 running Sequoia 15.5. I have over 200GB disk space left, and I am not running any other RAM intensive programs alongside the game.

The crash report contains:

Thread 3 Crashed:: WinMain (WinID 2)
0   libCvGameCoreDLL_Expansion2_DLL.dylib       0x12eac3896 0x12e6e8000 + 4044950

Is there anything I can do to fix this? Or anything I can do to in game to avoid this occurring? Are there any stability mods I can install?

I'm playing on the Rainforest map as Brazil, level King and trying for a Culture victory if that gives any clues...

74


r/AskPhysics•

In Feynman diagram-based QFT computations, you get self-interactions which blow up and you need to demonstrate that this self-energy can be wrapped up in the particle for a theory with a cutoff energy. My (popsci) understanding of why you can't combine QCD with gravity, is you lose this renormalisability.

In Lattice QCD, you don't have to worry about renormalisation. The lattice grid 'sorts out the infinities for you.'

Does this mean that quantum gravity (SM + GR) 'just works' in Lattice QCD? (Clearly you stll need a bunch of mathematical trickery to make it computationally feasible.)

25

r/AskProgramming•

I'm writing an HTTP/2 web server as a personal project. I am logging every HTTP/2 frame I send and receive from the server perspective. Here are the logs for a large file transfer on a fresh connection:

received: type: SETTINGS,      stream id: 0 settings: id: 3 v: 100, id: 4 v: 10485760, id: 2 v: 0,
sent:     type: SETTINGS,      stream id: 0 settings: id: 3 v: 1,
sent:     type: SETTINGS,      stream id: 0 ACK
received: type: WINDOW UPDATE, stream id: 0 increment: 1048510465
received: type: HEADERS,       stream id: 1 field block fragment size: 39 END_HEADERS END_STREAM
sent:     type: HEADERS,       stream id: 1 field block fragment size: 103 END_HEADERS
strea
10

r/AskPhysics•

For positions with 3 pieces, chess is solved. You populate a database with all positions that are checkmate for 3 pieces. You then take each checkmate position and consider all ways you could undo one move. You then add those to your database as ‘mate in one’ positions. You repeat this adding ‘mate in two’ positions, without overwriting ‘mate in one’ positions in the database. Repeating this you have a lookup table for the number of moves to checkmate for each position.

You can expand this by allowing captures, which means the ‘mate in N+1’ position has 4 pieces.

7 pieces is as far as researchers have got with this and involves terabytes of storage.

You can parallelise this by getting eac

382

r/AskProgramming•

I have two threads which both perform the following concurrently:

locks mutex 1 pushes to a queue unlocks mutex 1 calls try_lock on mutex 2, exiting/returning on failure, otherwise: calls lock on mutex 1 pops and processes all elements from the queue. calls unlock on mutex 1. calls unlock on mutex 2.

If all of these operations happen with some total order the queue will always have both elements processed. But the mutex locks/unlocks are acquire/release ordered, and so the final two mutex unlocks have no inter-thread happens-before relationship. One thread might observe mutex 2 unlocked before mutex 1.

Both threads can therefore exit with data still in the queue. Do I have this right?

35

r/crypto•

I have a 0-RTT handshake as follows:

Client's perspective:

First flight:

The client pings off client hello, then uses the early keys to encrypt early data and end of early data application record. The encrypted records are all 'wrapped' and look like application records.

Second flight:

The client receives server hello and finds out that the pre_shared_key wasn't recognised by the server so it uses the server-supplied diffie hellman keys to generate and encrypt the client handshake finished record, also wrapped.

From the server perspective:

The server receives a client hello message and responds with a server hello not including the preshared key extension. The server then receives s

74

In S1, the MDR work was deliberately and comically pointless. They developed ‘feelings’ about different groups of random numbers which was their way of convincing themselves the work had meaning. Innies were clutching at the only sense of purpose they had access to. For management it was an experiment to see whether their worker bees would rebel or comply when faced with deliberately mundane and futile work activities.

In S2 we learn that 25 work packets needed to be completed before moving onto the next phase of the project. Initially this represented management’s mindless adherence to bureaucracy and process. Despite delays, management were doggedly sticking to their plan not to take Gemm

816