71 karma · joined Jul 17, 2009 (17y ago) · 32 submissions
comment 12y ago · link · parent
comment 12y ago · link · parent
comment 12y ago · link · parent
$ which expr
/bin/expr
$ expr \( -9223372036854775808 \) \* -1
-9223372036854775808
$ expr \( -9223372036854775808 \) / -1
expr: overflow
Looking at the source code: void
assert_times(intmax_t a, intmax_t b, intmax_t r)
{
/*
* if first operand is 0, no overflow is possible,
* else result of division test must match second operand
*/
if (a != 0 && r / a != b)
errx(ERR_EXIT, "overflow");
}
struct val *
op_times(struct val *a, struct val *b)
{
struct val *r;
assert_to_integer(a);
assert_to_integer(b);
r = make_integer(a->u.i * b->u.i);
assert_times(a->u.i, b->u.i, r->u.i);
free_value(a);
free_value(b);
return (r);
}
void
assert_div(intmax_t a, intmax_t b)
{
if (b == 0)
errx(ERR_EXIT, "division by zero");
/* only INTMAX_MIN / -1 causes overflow */
if (a == INTMAX_MIN && b == -1)
errx(ERR_EXIT, "overflow");
}
struct val *
op_div(struct val *a, struct val *b)
{
struct val *r;
assert_to_integer(a);
assert_to_integer(b);
/* assert based on operands only, not on result */
assert_div(a->u.i, b->u.i);
r = make_integer(a->u.i / b->u.i);
free_value(a);
free_value(b);
return (r);
}
Looks like the check for overflow in the multiplication case is broken since the check itself does not account for overflow. I'll try to remember to submit a patch when I get home.comment 12y ago · link · parent
I cannot find a working link for the original interview, but BlabberMouth has the quote you are referring to: http://www.blabbermouth.net/news/metallica-s-lars-ulrich-bre...
comment 12y ago · link · parent
[0] http://en.wikipedia.org/wiki/Kill_%27Em_All#Track_listing
[1] http://en.wikipedia.org/wiki/Ride_the_Lightning#Track_listin...
[2] http://en.wikipedia.org/wiki/Master_of_Puppets#Track_listing
[3] http://en.wikipedia.org/wiki/...And_Justice_for_All_%28album...
comment 12y ago · link · parent
comment 13y ago · link · parent
By default, ports use the system compiler unless it is specifically overridden in the port's Makefile (e.g. USE_GCC=any).
comment 15y ago · link · parent
comment 15y ago · link · parent
http://en.wikipedia.org/wiki/Export_of_cryptography_in_the_U...
comment 16y ago · link · parent
comment 16y ago · link · parent
comment 16y ago · link · parent
http://lists.freebsd.org/pipermail/svn-src-head/2010-January...
comment 16y ago · link · parent
mini[~ 111] uname -a
Darwin mini.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386
mini[~ 112] which fetch
fetch: Command not found.
Unfortunately, it does not. I use fetch all of the time on FreeBSD, so it is a little obnoxious to have to go and install wget from MacPorts.comment 17y ago · link · parent
make search name=name_of_port
to search for a port by name and:
make search key=key_to_search_for
to search by key. You can also use quicksearch instead of search to reduce the verbosity of the results. If you read the ports man page, you will find a bunch of other nifty things you can do with the ports system.
comment 17y ago · link · parent
comment 17y ago · link · parent
However, there are a lot of companies and universities looking into small satellites, since it is much, much cheaper than launching larger satellites with expensive payloads. There is a lot of research in the area and a lot of small sat conferences as well (e.g. http://www.smallsat.org/). If this pans out, it could be the end of the US government's large satellite oligopoly, which currently consists of only a few large companies like Lockheed Martin (disclaimer: that is where I work) and Boeing.