Search found 368 matches

by Tub
Sun Apr 29, 2018 5:00 pm UTC
Forum: The Help Desk
Topic: Compressing video and photo or I lose my job
Replies: 7
Views: 980

Re: Compressing video and photo or I lose my job

Most video or audio formats are already compressed. Applying a lossless compression algorithm (like zip or rar) won't do anything, as you've seen.

If you need them to be smaller, you need to re-encode them with a different lossy method, but that's going to degrade quality.
by Tub
Wed Apr 25, 2018 4:06 pm UTC
Forum: Science
Topic: Science-based what-if questions
Replies: 608
Views: 72946

Re: Science-based what-if questions

If such a black hole were to instantly evaporate into radiation, that would be equivalent to 100 earth-sized balls of TNT going off. "Fortunately", such a black hole would actually take 2.7e24 years to evaporate. True if gradual evaporation via hawking radiation is the only relevant effec...
by Tub
Tue Apr 24, 2018 2:09 pm UTC
Forum: Science
Topic: Science-based what-if questions
Replies: 608
Views: 72946

Re: Science-based what-if questions

There are several lower bounds for black hole size. The uncertainty principle says that you cannot confine mass in an arbitrarily small volume, so any black hole's size (schwarzschild radius) cannot be smaller than the planck length (which is tiny), but such a black hole would have a mass of planck ...
by Tub
Mon Apr 23, 2018 6:26 pm UTC
Forum: Science
Topic: Science-based what-if questions
Replies: 608
Views: 72946

Re: Science-based what-if questions

If Gardevoir is capable of conjuring objects inside his crank case, it really wouldnt have to be a black hole to wreck his day. How about just a modest sized iron canonball? How about 1kg of glitter in the driver's compartment? Bigger takes longer, and an earth-radius black hole would require almos...
by Tub
Mon Apr 23, 2018 10:23 am UTC
Forum: Computer Science
Topic: Analysis of the Java RNG
Replies: 4
Views: 797

Re: Analysis of the Java RNG

There's plenty of research about Linear Congruential Generators, if you feel like diving in. They have a few weaknesses, but AFAIK none that would help you here. The state of the RNG has 48 bits, thus only 2^48 of the possible 2^64 different longs can ever be returned by nextLong. According to the d...
by Tub
Wed Apr 18, 2018 8:34 am UTC
Forum: Computer Science
Topic: What to learn to be able to make some money?
Replies: 18
Views: 2357

Re: What to learn to be able to make some money?

WanderingLinguist wrote:[...]

Thank you for your insights, that was helpful.

(My phone is for phone calls, alarm clock, notes and a web browser. I'm totally out of the loop with the app market.)
by Tub
Tue Apr 17, 2018 9:50 am UTC
Forum: Computer Science
Topic: What to learn to be able to make some money?
Replies: 18
Views: 2357

Re: What to learn to be able to make some money?

Speaking for my part of the industry (keep in mind, this is not general advice): Mobile app development is big these days, and there's a shortage of programmers who can go beyond the simple "static" mobile app that just duplicates a web site. If I may pop in for a quick question, what's y...
by Tub
Thu Apr 05, 2018 8:49 am UTC
Forum: Computer Science
Topic: What to learn to be able to make some money?
Replies: 18
Views: 2357

Re: What to learn to be able to make some money?

What Yakk said isn't entirely wrong, but only a small part of all software development is meant to produce software sold to customers. Most software development is meant to solve some internal business need - automating processes, monitoring work results, data mining, totally boring business databas...
by Tub
Wed Apr 04, 2018 12:20 am UTC
Forum: Coding
Topic: An amateur has tried to build a website in raw HTML
Replies: 54
Views: 6094

Re: An amateur has tried to build a website in raw HTML

Warning, strong opinions about jQuery ahead. I did use jQuery a lot back in the day, when it had its uses. But believe it or not, for a couple of years I've been programming without ever thinking "This problem would be easier to solve with jQuery." I haven't had much issues with br...
by Tub
Tue Apr 03, 2018 2:44 pm UTC
Forum: Computer Science
Topic: What to learn to be able to make some money?
Replies: 18
Views: 2357

Re: What to learn to be able to make some money?

The first thing you should learn is to write code and comments in english. Always. If you want feedback from others, then english is the one language that everyone in the tech world understands. You also need to get rid of the Allman brace style. As much as I love that style, there are some unfortun...
by Tub
Tue Apr 03, 2018 1:19 pm UTC
Forum: Coding
Topic: An amateur has tried to build a website in raw HTML
Replies: 54
Views: 6094

Re: An amateur has tried to build a website in raw HTML

I have a suggestion which is not directly "easy to program" because you have to learn some new things first, but: in the long term, you can make programming (in JavaScript) easier for yourself by using some libraries. You could start with jQuery and Lodash . jQuery is largely obsolete (un...
by Tub
Sat Mar 31, 2018 6:35 pm UTC
Forum: Science
Topic: Science-based what-if questions
Replies: 608
Views: 72946

Re: Science-based what-if questions

A dark matter black hole may or may not be a tiny bit darker than a regular black hole :roll: Seriously, if you put heavy stuff within a region smaller than its schwarzschild radius, then you'll get a black hole. Dark matter has mass, so it'll work. From the outside, it won't look any different - al...
by Tub
Tue Mar 27, 2018 1:09 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1722339

Re: Coding: Fleeting Thoughts

There's extensive documentation about the calculation and interpretation of those values. I bet you haven't produced a single UML diagram, barely did any testing, and there's zero documentation, so your 700 loc aren't finished yet. Sloccount is also highly inaccurate in small projects. Writing the f...
by Tub
Fri Mar 23, 2018 9:24 am UTC
Forum: Science
Topic: Quantum Question
Replies: 110
Views: 10155

Re: Quantum Question

Assuming determinism and no cp-violations, time reversal gets you back to exactly the previous state, not to a different random low-entropy state. In a hypothetical classical world, time reversal means turning those particles around by negating all velocities. In a quantum world, time reversal is a ...
by Tub
Thu Mar 22, 2018 1:46 pm UTC
Forum: Science
Topic: Quantum Question
Replies: 110
Views: 10155

Re: Quantum Question

If you understand the state of the universe as the whole wave function, then its temporal evolution is deterministic (see: Schrödinger equation ) and it is time reversible. Randomness only appears when you try to force said wave function into a classical notion of particles with fixed positions and ...
by Tub
Thu Mar 22, 2018 10:34 am UTC
Forum: Science
Topic: Quantum Question
Replies: 110
Views: 10155

Re: Quantum Question

it implies that there are just as many possible states of the universe that, left to their own devices, would tend toward lower entropy, as there are possible states of the universe that tend toward higher entropy. If you pick a random configuration with a given low entropy, then you'll find that b...
by Tub
Fri Mar 09, 2018 8:13 am UTC
Forum: Science
Topic: Science-based what-if questions
Replies: 608
Views: 72946

Re: Science-based what-if questions

You cannot have a single giant particle in this universe. You cannot push multiple matter particles together as close as you like, either. The closest you can compress matter (without converting it into something else) is what you'll find in a neutron star. So for some fun with actual science, I rec...
by Tub
Mon Mar 05, 2018 10:34 pm UTC
Forum: Mathematics
Topic: My take on Godel's incompleteness theorems
Replies: 42
Views: 4870

Re: My take on Godel's incompleteness theorems

Is what is true/truth with mathematicians not necessarily true/truth in the empirical world of non-mathematician mankind? In a mathematical formal system, you start with a set of axioms, and you try to figure out everything that follows from those axioms. An axiom is just a premise, something that ...
by Tub
Wed Feb 28, 2018 2:01 pm UTC
Forum: The Help Desk
Topic: Mac hard disk corruption
Replies: 1
Views: 985

Re: Mac hard disk corruption

Even booting from the corrupt drive will cause further writes to the drive. If that drive contains the only copies of important files, I'd avoid that. See if you can get your time machine working before you touch the corrupt mac again. If the time machine is lost, the first step would be to make a c...
by Tub
Tue Feb 27, 2018 8:11 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1960: "Code Golf"
Replies: 25
Views: 3689

Re: 1960: "Code Golf"

The convention should've been "don't write a language where..." Unfortunately, end-user-programmers don't get to design their own language[...] End users can choose to enable compiler flags that turn accidental assignments into warnings or errors. For scripting languages, the same can be ...
by Tub
Sun Feb 25, 2018 5:53 pm UTC
Forum: Fictional Science
Topic: Magitech society needs a heat engine
Replies: 41
Views: 4153

Re: Magitech society needs a heat engine

Hm. Is a high heat capacity a good thing? I thought a lower heat capacity means less energy is required to generate a particular temperature difference? The carnot efficiency is independent of the working fluid. Lower heat capacity just means that you need a larger volume to transform the same amou...
by Tub
Fri Feb 23, 2018 5:17 pm UTC
Forum: Fictional Science
Topic: Magitech society needs a heat engine
Replies: 41
Views: 4153

Re: Magitech society needs a heat engine

A heat engine requires neither combustion nor vaporization. It requires a hot end, a cold end and a working substance in between. Taking any real-world heat engine and replacing coal fire with a magic spell should be straightforward. Look at engines or power plants developed by humanity when we had ...
by Tub
Wed Feb 21, 2018 10:39 pm UTC
Forum: Fictional Science
Topic: Airlock full of water exposed to vacuum
Replies: 10
Views: 1568

Re: Airlock full of water exposed to vacuum

Haven't seen the movie (not that popular, apparently), but here's the phase diagram of water: https://upload.wikimedia.org/wikipedia/commons/0/08/Phase_diagram_of_water.svg There are plenty of youtube videos of water in a vacuum chamber, and in many of them the water will boil violently for a while,...
by Tub
Tue Feb 20, 2018 12:53 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1957: "2018 CVE List"
Replies: 35
Views: 4356

Re: 1957: "2018 CVE List"

I'm glad the pedants decided to step forward. Now go start working on that list!
by Tub
Tue Feb 20, 2018 8:29 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1957: "2018 CVE List"
Replies: 35
Views: 4356

Re: 1957: "2018 CVE List"

Still, I contend that in analysis of algorithmic complexity, the n is usually the length of the input , so n is already the log of the input value, i.e. the prime itself. On that basis, by your argument, the algorithm for factorising a known prime would be O(n). I usually expect to read O(b) if we'...
by Tub
Mon Feb 19, 2018 2:03 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1957: "2018 CVE List"
Replies: 35
Views: 4356

Re: 1957: "2018 CVE List"

orthogon wrote:You can factorise primes in O(1) if you know they're primes. Non-primes are trickier to factorise.

Well, a prime number n has O(log(n)) bits. If numpy makes a copy somewhere, then the algorithm is O(log(n)) as stated in the comic.
by Tub
Wed Feb 07, 2018 8:05 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1722339

Re: Coding: Fleeting Thoughts

Yeah, that's the idea. a is no longer a local variable, but a a global variable, i.e. property of the global object. Properties can have getters! Getting the global object in a compatible way is tricky, but possible: call a function without a context, then it'll use the global object as 'this'. Exce...
by Tub
Wed Feb 07, 2018 9:36 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1722339

Re: Coding: Fleeting Thoughts

Points to hotaru for this one. When comparing an object to a native value, javascript will first try to "unbox" the object, which is why new Boolean(false) == false and 42 == [42]. Unboxing may also include calling valueOf() or toString(). But you don't need unboxing. You don't need 'a' to...
by Tub
Tue Feb 06, 2018 10:46 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1722339

Re: Coding: Fleeting Thoughts

I'd say that Flumble got it, but there's something wrong with that list. For example: > 2: ["0", false, [1]] b == c doesn't hold, because false == [1] is false. There are other examples involving [1] that appear wrong. The gist however is that type coercion in JavaScript is weird , and Flu...
by Tub
Tue Feb 06, 2018 12:13 pm UTC
Forum: Science
Topic: Expansion in the long... (very) long term
Replies: 9
Views: 1615

Re: Expansion in the long... (very) long term

If space keeps expanding then yes, our "local bubble" will get smaller and smaller until eventually it only contains the milky way, and then eventually only the solar system...but it doesnt stop. If the future of our universe contains a big rip, then it'll be very far in the future, based...
by Tub
Tue Feb 06, 2018 12:12 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1722339

Re: Coding: Fleeting Thoughts

I stumbled over this special case again, so here's a riddle for you. Insert values into this JavaScript snippet to trigger the condition. var a = ...; var b = ...; var c = ...; if (a == b && a == c && b != c) console.log("what?");
by Tub
Mon Feb 05, 2018 4:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1722339

Re: Coding: Fleeting Thoughts

It's one solution, though. I wouldn't define a full Minecraft-like environment as a Dictionary-indexed 'array' with so many cells filled (even if air=null). Unsurprisingly, there's been quite a bit of research on the best in-memory structure for minecraft-like worlds, and they're interesting to rea...
by Tub
Mon Feb 05, 2018 9:18 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1722339

Re: Coding: Fleeting Thoughts

Requiring string manipulation (thus possibly memory allocations), hash calculations and several indirects to get a value will have a performance impact. If your algorithm is lots of accesses and few calculations (like matrix multiplication), that is going to be noticeable. I don't know much about py...
by Tub
Wed Jan 24, 2018 10:47 am UTC
Forum: The Help Desk
Topic: Best Anti-virus Software of Linux
Replies: 10
Views: 2389

Re: Best Anti-virus Software of Linux

[..]the fact that the vast majority of the time, you're safer using an AV scanner than without if you're going to use the internet So far, that's an unproven claim, and it's a claim I keep disagreeing with. But that's not the point I was making. The point I was making is that you're safer using san...
by Tub
Tue Jan 23, 2018 5:24 pm UTC
Forum: The Help Desk
Topic: Keyboard issue
Replies: 5
Views: 1277

Re: Keyboard issue

Does tab still work as tab, or has that suddenly become ctrl? If the keys are switched, I'd just switch them back via software (~/.Xmodmap on linux). You know, take the lazy solution . Did you do a cold reboot (remove power and battery for a minute), then enter the bios directly? Still swapped? Then...
by Tub
Tue Jan 23, 2018 1:16 am UTC
Forum: The Help Desk
Topic: Best Anti-virus Software of Linux
Replies: 10
Views: 2389

Re: Best Anti-virus Software of Linux

Well, nothing's going to stop a PEBCAK with an admin account anyway. Maybe we need to sandbox the user instead of the software? :roll: microsoft's statement about meltdown/AV : During testing, we discovered that some third-party applications have been making unsupported calls into Windows kernel mem...
by Tub
Mon Jan 22, 2018 11:12 pm UTC
Forum: The Help Desk
Topic: Best Anti-virus Software of Linux
Replies: 10
Views: 2389

Re: Best Anti-virus Software of Linux

a good, solid AV tool I wasn't aware such a thing existed. All the major ones had catastrophic bugs at one point or another, where one would've been better off not running an AV tool at all. Remember, just this month, when meltdown patches couldn't be installed while certain AV tools were running? ...
by Tub
Mon Jan 22, 2018 6:58 pm UTC
Forum: The Help Desk
Topic: Best Anti-virus Software of Linux
Replies: 10
Views: 2389

Re: Best Anti-virus Software of Linux

I wasn't aware that "being careful" will in any way protect against malware, unless "being careful" means "doing a complete audit of the delivered binary before installing". Authors sell out and bundle malware, servers get hacked and downloads are replaced, software oft...
by Tub
Fri Jan 19, 2018 12:13 pm UTC
Forum: Computer Science
Topic: Finding a subgraph with given properties.
Replies: 3
Views: 2191

Re: Finding a subgraph with given properties.

Per your description, the smallest subgraph satisfying your requirements is the empty graph. I assume you're starting with either a product or leaf, and you're looking for the smallest subgraph telling you how to build that product with the least amount of processing steps? And if I understand your ...
by Tub
Wed Jan 10, 2018 9:53 pm UTC
Forum: Mathematics
Topic: PI - Invention or Discovery
Replies: 88
Views: 6828

Re: PI - Invention or Discovery

Your nose is a hole in your body for the ingress and egress of air. By definition, it's a vent. If you put your finger in there, you've also in-vented it.

Go to advanced search