@JohnRennie Yeah. Is cyclotron radiation going to be the main power draw?
I was thinking about what factors would prevent using an electron beam for energy storage - there's gotta be some high power loss factor, otherwise an electron gun and a magnet
would make a battery with unheard of energy density
@Giskard42 the electrons in the beam will repel each other so your beam will diverge and drift apart. You'd need some active focussing of the beam and that would take power. For a large electron density the focussing would be very difficult if not impossible.
@Abcd that's not a technical term, but that is what I meant by implicitly differentiating when "taking infinitesimals", yes. The proper mathematical treatment of this is via differential forms
@BernardoMeurer Well, I have a mac which means there is a POSIX core down there. I can test most POSIX related things but the OS uses more modern facility for some things.
what is the topology of the thermodynamical space, though
Is it $\Bbb R^3$
Is it that contact manifold thing from thermogeometrodynamics
Anonymous
6:39 PM
@JohnRennie I was using srand(time(0)) as a seed whenever I needed to generate random number. However, the problem is that it returns the time in seconds. I need a new random number within a certain range (0.0-100.0) every time a certain loop executes (which I presume to be several times a second). srand(time(0)) just doesn't have good enough resolution for my purpose. Any trick to get past this?
@BernardoMeurer Need some C help. Any idea how to seed srand() with nanoseconds or at least microseconds? In my program I'm getting some very similar values in consecutive iterations but iterations which are further apart have different values. I called srand() just once in the program as JR suggest but even then it doesn't seem to work very well.
static bool HAS_URANDOM = true; // Global
unsigned int random_uint() {
unsigned int r_uint;
FILE *f = fopen("/dev/urandom", "r");
if (f == NULL) {
if (HAS_URANDOM) {
printf("---- Failed loading random generator device /dev/urandom. Defaulting to rand().\n");
srand((unsigned int) time(NULL));
HAS_URANDOM = false;
}
r_uint = (unsigned int) rand();
} else {
fread(&r_uint, sizeof(r_uint), 1, f);
fclose(f);
@Blue That
And if you want a range
// Inclusive range
// stackoverflow.com/a/17554531/2080712
unsigned int generate_int(unsigned int lower, unsigned int upper) {
unsigned int r_uint;
const unsigned int range = 1 + (upper - lower);
const unsigned int buckets = UINT_MAX / range;
const unsigned int limit = buckets * range;
if (range >= UINT_MAX) {
fprintf(stderr, "Range too big!\n");
exit(EXIT_FAILURE);
}
/* Create equal size buckets all in a row, then fire randomly towards
* the buckets until you land in one of them. All buckets are equally
I am trying to use the windows version of dd to copy a RHEL iso to a USB stick. However, I wanted to zero out the drive first to ensure there is no filesystem on it before writing it out. Is there an equivalent of /dev/zero in windows that I can use as the infile?