## Search found 469 matches

Mon Jul 01, 2019 11:38 am UTC
Forum: Computer Science
Topic: paper and pencil cyrptography
Replies: 3
Views: 1021

### Re: paper and pencil cyrptography

You can easily do pubkey cryptography with a pen, paper and a couple of dice. Just look into existing schemes like RSA or elliptic curves. It just takes forever. For example, RSA recommends at least 2048-bit keys. If you have a reasonably short message (about a tweet full), encryption or decryption ...
Mon Jun 24, 2019 9:06 am UTC
Forum: Coding
Topic: Puzzle: Find integer not present in an array
Replies: 9
Views: 1523

### Re: Puzzle: Find integer not present in an array

We have an algorithm with O(n) runtime and O(n) memory, and we have several with O(n log(n)) runtime and O(1) memory. Here's one with O(n) runtime and O(1) additional memory. The idea is to re-organize the array such that each number x < n is at index x, with numbers >= n occupying an arbitrary posi...
Sun Jun 23, 2019 2:51 pm UTC
Forum: Coding
Topic: Puzzle: Find integer not present in an array
Replies: 9
Views: 1523

### Re: Puzzle: Find integer not present in an array

It's in linear time because it always does 32 iterations over the array If you're going to pretend that log(n) is a constant, why don't you go all the way? Your algorithm is bound to run in (2^32 * 32 * constant) steps, which is O(1) :roll: You don't need a bitmask over 2^32 numbers. If your array ...
Sun Jun 23, 2019 12:51 pm UTC
Forum: Coding
Topic: Puzzle: Find integer not present in an array
Replies: 9
Views: 1523

### Re: Puzzle: Find integer not present in an array

You don't need a bitmask over 2^32 numbers. If your array contains n numbers, then you just need a bitmask over n+1 numbers. After crossing out all the wrong numbers, at least one is guaranteed to remain. I'm wondering though: if you're allowed to modify the array, is it possible with less than O(n)...
Tue Jun 04, 2019 9:50 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Going to resolve this real quick. Quoting mdn on instanceof : The instanceof operator tests whether the prototype property of a constructor appears anywhere in the prototype chain of an object. For A instanceof A, you need A to * be a constructor (a function) and an instance * as a constructor, have...
Wed May 29, 2019 7:29 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Oh. I missed that rather trivial solution, too. It's true, this will also work for all of Function's parents, which is just the one you mentioned.

But no, it can be solved without reusing an existing constructor. I don't think defineProperty will help much.
Wed May 29, 2019 10:45 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

I just realized that javascript's Function class has a unique property. All constructors are functions, so they inherit from Function. This includes the Function constructor: >> Function instanceof Function true A small challenge is thus: create a new variable A (with A !== Function) such that >> A ...
Tue May 28, 2019 9:07 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

const /*or let or var*/ variable = someFunctionOf(variable) This works does not explode with var. Anything declared with var has a scope of the whole function, being initialized to undefined before its first assignment. It doesn't work with const or let because of their restricted scope and tempora...
Sat May 18, 2019 10:00 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

It's also fast. Counting the time between starting the game and watching the last object pop in, the wasm implementation appears to be ~20-50% faster. Success. I wasn't happy with this. A bit of benchmarking later, the mesh generation code has been improved by another +120% on top of the previous i...
Thu May 09, 2019 8:14 pm UTC
Forum: Science
Topic: Science fleeting thoughts
Replies: 381
Views: 59079

### Re: Science fleeting thoughts

You were the one that brought up the book. Don't expect a recommendation from me. Anyone who claims that time doesn't exist is demonstrably wrong. Anyone who claims that time is "just an illusion" is misunderstanding the nature of scientific theories as descriptions of our universe. Anyone...
Thu May 09, 2019 4:39 pm UTC
Forum: Science
Topic: Science fleeting thoughts
Replies: 381
Views: 59079

### Re: Science fleeting thoughts

My point is that the entirety of the state of Conway's Game of Life is the position of the cells, and an evolution function which does not include time in the description, but only tells you the next position. Considering that time is discrete here, your evolution function implicitly works on a tim...
Thu May 09, 2019 3:29 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

TIL that google will happily store and monetize all of your location data, but considers it a privacy problem when someone else does.

Xeio wrote:I can't decide if this is beautiful or horrifying:

It can be used for good or evil. I wonder, which is it?
Thu May 09, 2019 9:38 am UTC
Forum: Science
Topic: Science fleeting thoughts
Replies: 381
Views: 59079

### Re: Science fleeting thoughts

We can describe things in terms of time, but that doesn't necessarily mean that time actually exists. For example, it may be that everything in the universe can be described in terms of different fundamental dimensions and that dimensions like mass and time can be expressed in terms of units like s...
Wed May 08, 2019 10:19 pm UTC
Forum: Science
Topic: Science fleeting thoughts
Replies: 381
Views: 59079

### Re: Science fleeting thoughts

Is it a dimension, though? By any common mathematical definition, time is a dimension. If you want to uniquely identify an event within the universe (or a game of conway), you need 3 (or 2) spatial coordinates and one time coordinate. You can't go backwards, and forwards doesn't exist until the cha...
Tue May 07, 2019 11:39 am UTC
Forum: Science
Topic: Is it possible to escape from a black hole using another black hole?
Replies: 56
Views: 5911

### Re: Is it possible to escape from a black hole using another black hole?

I think the event horizons of Kerr black holes are oblate spheroids, or something similar, and the minor radius is smaller than the Schwarzschild radius. This should in principle allow two Kerr black holes that are rotating extremely quickly to pass by each other without their event horizons overla...
Sat May 04, 2019 9:00 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Update: I ended up solving the mutability problem by using std::Cell. Cells cheat the whole lifetime issue by disallowing getting a reference to the things inside. You can just copy values in, or copy the current value out. With those semantics, it's safe for them to allow changing the value inside ...
Fri May 03, 2019 10:00 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Would it make sense to map over the collection producing a collection of Option<Mesh> objects (Some if a mesh is generated) and then zip the two collections? Or can the (re)generation of one mesh depend on the (re)generation of another mesh during the same iteration? Yeah, I can push all the change...
Fri May 03, 2019 2:00 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Instead of writing wasm in a language I know (c++), I decided to learn rust first. It seems interesting, and rust-wasm is hip these days. Rust has come a long way since the last time I looked at it, and I'm impressed by its current design. Rust 2018 looks worth using. Except for the borrow checker. ...
Thu May 02, 2019 9:17 am UTC
Forum: Science
Topic: Is it possible to escape from a black hole using another black hole?
Replies: 56
Views: 5911

### Re: Is it possible to escape from a black hole using another black hole?

You have massless ice? I'm sure that's going to have excellent culinary applications. Can you make it tasty while keeping it at 0 calories? I'm not sure if I'm misunderstanding your question, or if you stopped reading halfway through my last post. Gravity wins. Your feeble contenders will be destroy...
Thu May 02, 2019 8:00 am UTC
Forum: Science
Topic: Is it possible to escape from a black hole using another black hole?
Replies: 56
Views: 5911

### Re: Is it possible to escape from a black hole using another black hole?

Or the probe could just be microscopic. Not much tidal force across a one micron robot. In these thought experiments, the best kind of probe is always a photon. Ok so what would happen if a black hole made of ice collided with a black hole made of lava (regular black hole)? The temperature of a bla...
Mon Apr 29, 2019 4:48 pm UTC
Forum: Science
Topic: Is it possible to escape from a black hole using another black hole?
Replies: 56
Views: 5911

### Re: Is it possible to escape from a black hole using another black hole?

But suppose I am in a spaceship in orbit about a stellar mass black hole a few Schwarzschild radii from its center. Now suppose the black hole is falling into a supermassive black hole. Surely I should not see anything strange happen to the black hole as we cross the event horizon of the supermassi...
Mon Apr 29, 2019 10:27 am UTC
Forum: Science
Topic: Is it possible to escape from a black hole using another black hole?
Replies: 56
Views: 5911

### Re: Is it possible to escape from a black hole using another black hole?

Is it possible to have a stellar mass black hole inside a supermassive black hole, such that some objects are outside both, some are inside both, and some are inside the supermassive black hole but outside the stellar mass black hole? Obviously they will merge eventually, but before they do . . . A...
Sun Apr 28, 2019 10:24 pm UTC
Forum: Science
Topic: Is it possible to escape from a black hole using another black hole?
Replies: 56
Views: 5911

### Re: Is it possible to escape from a black hole using another black hole?

You carelessly dropped your probe past an event horizon. No amount of acceleration can allow it to escape. Your first idea is thus to try accelerating it, via a nearby gravitational source. Why exactly is that supposed to help? Looking at simulations of black hole mergers , it appears as if the area...
Mon Apr 22, 2019 10:30 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Batching improves throughput, but also increases per-job latency. If the latency is greater than one frame, then I need to take care not to submit a job twice. As jobs are defined by (object-id, object-generation), I need - wait for it! - another multi-key Map (or Set). For now, I've ignored that pr...
Sun Apr 21, 2019 7:31 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Before going WebAssembly, I wanted to try boosting performance with WebWorkers. tl;dr: - doing the task in the main thread: 2-3 ms - doing the task in a worker: 20-100ms welp. This is a webgl game. The task is to prepare an object for rendering, and I have >1000 of these objects. They are prioritize...
Tue Apr 16, 2019 9:24 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Ah, so they don't just have different equality semantics, they're also immutable. That's certainly a lot more powerful.
Tue Apr 16, 2019 4:46 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

Thanks for the insight. I'm having trouble coming up with consumers (besides Set and WeakMap). Surely there's some user code that'd be prettier with these types, but you can always implement your own comparison function. I can't find anything besides Map/Set were you have to rely on behind-the-scene...
Fri Apr 12, 2019 7:15 pm UTC
Topic: 2136: "Election Commentary"
Replies: 13
Views: 3810

### Re: 2136: "Election Commentary"

To be fair, the american election system actually is an unnecessarily convoluted way to add up votes.
Thu Apr 11, 2019 2:43 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003289

### Re: Coding: Fleeting Thoughts

I really wish javascript's Map class had the ability to accept multiple keys. With the good old object-as-maps, you'd just concatenate all your keys; they had to be strings anyway. let m = {}; m[x + '|' + y] = 42. Somewhat expensive if you want to implement huge multi-dimensional arrays, but fine fo...
Thu Apr 11, 2019 9:37 am UTC
Forum: Science
Topic: Event Horizon Telescope image
Replies: 24
Views: 3066

### Re: Event Horizon Telescope image

Some members of the EHT team did a reddit AMA yesterday, where they answered many common questions (including yours) in great detail.
Sun Apr 07, 2019 7:58 am UTC
Forum: Hardware
Topic: Smartwatch without a smartphone?
Replies: 3
Views: 5952

### Re: Smartwatch without a smartphone?

Despite the lack of responses, I can't leave the thread hanging like this. After realizing that the battery lifetimes between a smart watch and my old casio differ by three orders of magnitude, I just ordered a casio again. If I have to recharge the watch every couple of days, then the maintenance o...
Sat Mar 30, 2019 9:14 am UTC
Forum: Science
Topic: Miscellaneous Science Questions
Replies: 2958
Views: 720991

### Re: Miscellaneous Science Questions

Although, does that ambiguity exist since it holds for the components (0.999...,0.999...)=(1,1)=(1,0.999...)=(0.999...,1) too? Go ahead and interleave these pairs. If interleaving is a bijection, all four of them must yield the same number. There is only a countably infinite amount of numbers with ...
Fri Mar 29, 2019 10:30 pm UTC
Forum: Science
Topic: Miscellaneous Science Questions
Replies: 2958
Views: 720991

### Re: Miscellaneous Science Questions

Hang on.. the discrete iterations of space-filling curves may be bijective, but the limits aren't. Space-filling curves are necessarily self-intersecting. You can use them to prove that | R² | <= | R |, and it's easy to prove that | R | <= | R² |, but that's just an existence proof. It's not constru...
Fri Mar 29, 2019 7:35 pm UTC
Forum: Hardware
Topic: Smartwatch without a smartphone?
Replies: 3
Views: 5952

### Smartwatch without a smartphone?

Hello, In 2006 I bought a casio watch. Today, I dropped it. Now it's dead. Looking at casio's innovative product lineup, I could just.. buy the same model again. But maybe I should try to be a bit more modern? I really just need a quick 5 minute timer (I like tea), the current date and time, and an ...
Thu Mar 28, 2019 8:31 pm UTC
Forum: The Help Desk
Topic: EFI boot from card reader
Replies: 1
Views: 1098

### Re: EFI boot from card reader

Someone is asking for trouble. 1) you need a bootloader on an EFI partition 2) you need the firmware ("bios") of your computer to recognize that partition 3) you need an initramfs that can mount the root partition. For the first problem, you can either re-use the existing EFI partition fro...
Tue Mar 26, 2019 2:58 pm UTC
Forum: Science
Topic: Verifying physics at home
Replies: 15
Views: 2792

### Re: Verifying physics at home

Yeah, I almost mentioned that for the atomic clocks. We all know that the illuminati mandate all commercially available atomic clocks to carry GPS sensors and fake a clock drift according to altitude and velocity. Right? It's not as bad in the case of a spectrometer. You have a black box on your des...
Tue Mar 26, 2019 11:54 am UTC
Forum: Science
Topic: Verifying physics at home
Replies: 15
Views: 2792

### Re: Verifying physics at home

Thanks for your ideas. Props to Heimhenge for actually doing the experiment! The insights into modern telescopes from DavidSh and LaserGuy are much appreciated; they're a lot more capable than I thought. re: spectroscopes. I know a couple of chemists, and their equipment is quite expensive. I also w...
Mon Mar 25, 2019 11:55 am UTC
Forum: Science
Topic: Verifying physics at home
Replies: 15
Views: 2792

### Verifying physics at home

Let's say you're a die-hard skeptic, and you doubt every experiment that you haven't done yourself. So you set out to re-produce all major experiments at home. I'm wondering, how much of modern physics can be reproduced at home, and on what budget? I'll skip over newtonian physics because a) a lot o...
Fri Mar 22, 2019 9:21 am UTC
Forum: Mathematics
Topic: Most useful isomorphisms you know?
Replies: 6
Views: 2124

### Re: Most useful isomorphisms you know?

This may be too trivial for your taste, but having isomorphisms between any (discrete, finite) piece of information and a binary representation is pretty useful if you like having general-purpose computers.
Mon Mar 11, 2019 9:25 pm UTC
Forum: Science
Topic: Extracting energy from a black hole via gravitational blueshift
Replies: 20
Views: 3659

### Re: Extracting energy from a black hole via gravitational blueshift

The Ferris wheel was in response to ijun's "climbing out of the gravity well" wording. It's not a perfect analogy, but it shows that if you take a system that's stable due to inertia and use it to lift stuff against gravitation (i.e. do work), you will affect the system. If the analogy doe...