|
fritz posted:Those that belong to the emperor That looks like Cyc PS: your tags are leaking.
|
# ? May 7, 2015 17:31 |
|
|
# ? Jun 8, 2024 09:07 |
|
Zopotantor posted:That looks like Cyc It's actually from Jorge Luis Borges, though apparently it's not too far off reality. One Australian Aboriginal language divides all objects as follows.
darthbob88 fucked around with this message at 18:17 on May 7, 2015 |
# ? May 7, 2015 17:55 |
darthbob88 posted:It's actually from Jorge Luis Borges, though apparently it's not too far off reality. One Australian Aboriginal language divides all objects as follows. This is amazing.
|
|
# ? May 7, 2015 18:42 |
|
darthbob88 posted:It's actually from Jorge Luis Borges, though apparently it's not too far off reality. One Australian Aboriginal language divides all objects as follows. Sorry, but this is just the usual colonialist fetishization of foreign cultures. You could do exactly the same thing with der, die, and das in German, and it would look exactly as arbitrary, but the Germans are white and European so nobody thinks their language reveals amazing things about their ~unique way of seeing the world~.
|
# ? May 7, 2015 19:01 |
|
darthbob88 posted:It's actually from Jorge Luis Borges, though apparently it's not too far off reality. One Australian Aboriginal language divides all objects as follows. http://en.wikipedia.org/wiki/List_of_Chinese_classifiers#Nominal_classifiers
|
# ? May 7, 2015 19:09 |
|
Soricidus posted:Sorry, but this is just the usual colonialist fetishization of foreign cultures. You could do exactly the same thing with der, die, and das in German, and it would look exactly as arbitrary, but the Germans are white and European so nobody thinks their language reveals amazing things about their ~unique way of seeing the world~. I'm pretty sure Twain did that, and really you can do that with any language that recognizes grammatical gender or noun class in general. The Diyrbal taxonomy is just especially foreign, and also one that I remembered seeing and marveling at. ETA: Or for other odd taxonomies, APG3 says that teak is more closely related to oregano than ebony. darthbob88 fucked around with this message at 20:38 on May 7, 2015 |
# ? May 7, 2015 19:16 |
Soricidus posted:Sorry, but this is just the usual colonialist fetishization of foreign cultures. You could do exactly the same thing with der, die, and das in German, and it would look exactly as arbitrary, but the Germans are white and European so nobody thinks their language reveals amazing things about their ~unique way of seeing the world~. Welp I'd better stay ignorant of other cultures. Might find something ~interesting~ if I'm not careful!
|
|
# ? May 7, 2015 19:20 |
|
Some encouraging versioning practices from a header in a test library we're using:quote:/* (quoted to not break tables)
|
# ? May 7, 2015 20:37 |
|
Now show me the horrible code that autogenerated that poo poo.
|
# ? May 7, 2015 20:57 |
|
It's the version control identifier from RCS or similar, see the $Id...$.
|
# ? May 7, 2015 21:07 |
|
It's not continued fraction versioning?
|
# ? May 7, 2015 22:16 |
|
darthbob88 posted:hairy mary grub Looks like I found a name for my new close-to-the-metal OS implemented in Javascript and MongoDB, coming soon to Github
|
# ? May 8, 2015 15:12 |
|
Subjunctive posted:It's the version control identifier from RCS or similar, see the $Id...$. Want to see the version history tree of that.
|
# ? May 8, 2015 15:25 |
|
Today I learned that gcc allows pointer arithmetic on void* by default.
|
# ? May 8, 2015 16:40 |
|
omeg posted:Today I learned that gcc allows pointer arithmetic on void* by default. With what stride - char?
|
# ? May 8, 2015 16:47 |
|
Blotto Skorzany posted:With what stride - char? Yeah.
|
# ? May 8, 2015 16:49 |
|
php:<? function testOnLiveDb() { pg_query($this->database, "create temp table address_test (a Address)"); pg_query($this->database, "insert into address_test values ({$this->address->to_sql_row()})"); list($inserted_address_row) = GetSqlFields($this->database, "SELECT a FROM address_test LIMIT 1"); $created_address = Address::from_sql_row($inserted_address_row); $this->assertEquals("street1", $created_address->street1); $this->assertEquals("street2", $created_address->street2); $this->assertEquals("Test City", $created_address->city); $this->assertEquals("CA", $created_address->state); $this->assertEquals("12345", $created_address->zip); $this->assertEquals("US", $created_address->country); $this->assertEquals("cmp", $created_address->company); $this->assertEquals("nm", $created_address->name); $this->assertEquals("ph", $created_address->phone); } ?>
|
# ? May 8, 2015 19:19 |
|
At least the function name is self documenting!
|
# ? May 8, 2015 19:22 |
|
ratbert90 posted:
Until it turns out it's just a hard coded mock, and the 'innocuousTestingFunction' is the one that works on a live database.
|
# ? May 8, 2015 19:25 |
|
php:<? abstract class Super { static function build($params) { if ($params['something']) return new Sub(); } } class Sub extends Super { function doSomeStuff() { // do some stuff } } ?> WHY IS IT EXTENDED? WHY DO THE TESTS CALL THE DATABASE WHEN THESE CLASSES DEAL WITH XML ONLY? WY IS GLOBAL $DATABASE EVERYWHERE? WHYWHYWHYWHYWHY Edit: ok, going for a walk. I thought I had seen bad - no. I just opened a subdirectory that will give me nightmares for months. IT BEGINS fucked around with this message at 21:12 on May 8, 2015 |
# ? May 8, 2015 19:27 |
|
omeg posted:Today I learned that gcc allows pointer arithmetic on void* by default. Why wouldn't/shouldn't it?
|
# ? May 8, 2015 19:30 |
|
seveeer
|
# ? May 8, 2015 19:30 |
|
Cocoa Crispies posted:Why wouldn't/shouldn't it? It seems like a weird thing to give meaning to. Given that pointer arithmetic "knows about" the size of objects and there's no way to define the size of "void", what would it naturally mean? Anyway, more concretely, the top answer to this Stack Overflow post gives some detailed reasoning as to why it shouldn't work. How accurate it is I'm not really fit to judge, but that site is reasonably stocked with pedants so I assume it would have been voted down if it were dodgy in any way.
|
# ? May 8, 2015 19:43 |
|
Cocoa Crispies posted:Why wouldn't/shouldn't it? because void is an incomplete type and has no size
|
# ? May 8, 2015 19:47 |
|
Cocoa Crispies posted:Why wouldn't/shouldn't it? It's illegal and there are no semantics for it that really make sense, making it a great footgun; also, since char* is allowed to alias anything (and has clear semantics) there are no circumstances where doing arithmetic on void* would add any capability that isn't already there.
|
# ? May 8, 2015 19:47 |
|
It's very simple to implement in the compiler and saves you one or two casts somewhere in C code. That's probably the real reason.
|
# ? May 8, 2015 20:02 |
OpenGL relies on void pointers for uploading data (and information on how to format it) to the GPU. When relevant you can specify strides, offsets and what type of data you're giving it. I don't know how common it is at large, but there's at least that one very big thing it's necessary for.
|
|
# ? May 8, 2015 20:13 |
|
Actually that reminds me of a horror at work. We have an event-driven system written in C that uses function pointers quite a lot. The type of an event callback pointer is a void returning function with one void pointer parameter. However in actual use the pointer is always to one specific well-defined type. The very first thing in every handler is a cast to that type from void*. Good luck if you pass anything else in there. You won't get a warning. Now this is merely stupid. The real horror is that somehow it wound up being cargo-culted into many other functions which aren't event handlers, which are never pointed to, and even take other parameters in addition to the void-pointer-which-actually-means-this-other-type one. The originating reason for all of this: the person who originally defined the types couldn't figure out how to define the function pointer type because the struct it points to contains the function pointer type. It's self-referential. C and its bad old declaration order requirements once again conspire with bad programmers to create a rat's nest. Honestly it's fascinating reading through the code and discovering things like this. It's code archeology!
|
# ? May 8, 2015 20:21 |
|
Joda posted:OpenGL relies on void pointers for uploading data (and information on how to format it) to the GPU. When relevant you can specify strides, offsets and what type of data you're giving it. I don't know how common it is at large, but there's at least that one very big thing it's necessary for. Not at all, you just use char *.
|
# ? May 8, 2015 20:56 |
I always cast to void*, didn't know you could cast to char*. I don't really see how it matters when you always tell it how the data is formatted anyway? Or maybe I have been the horror all along.
Joda fucked around with this message at 21:02 on May 8, 2015 |
|
# ? May 8, 2015 20:59 |
|
IT BEGINS posted:
The parent class actually just makes one of its children? That's not a typo?
|
# ? May 8, 2015 21:00 |
|
Munkeymon posted:The parent class actually just makes one of its children? That's not a typo? Not a typo. The parent class is just a Factory that constructs its children via a static method. IT BEGINS fucked around with this message at 21:12 on May 8, 2015 |
# ? May 8, 2015 21:08 |
|
QuarkJets posted:because void is an incomplete type and has no size But the pointer to the void might.
|
# ? May 8, 2015 21:40 |
|
I don't mind void * arithmetic ad a shorthand for doing things 1 byte at a time, but it would be better if there was some type of genetic byte * you could cast to. I think it's weird to cast random structs and such to chars for math. It's kinda inscrutable when you don't already know what's up with those casts.
|
# ? May 8, 2015 21:54 |
|
LeftistMuslimObama posted:I don't mind void * arithmetic ad a shorthand for doing things 1 byte at a time, but it would be better if there was some type of genetic byte * you could cast to. I think it's weird to cast random structs and such to chars for math. It's kinda inscrutable when you don't already know what's up with those casts. Also I feel like if someone needs a recursively-typed callback in a struct they should be able to figure out they need to forward declare the struct, and doing so has trivial syntax.
|
# ? May 8, 2015 22:01 |
|
It's less weird when you know that historically a byte was defined as the space it takes to store a single character, rather than either meaning "8 bits" or "the smallest addressable unit of memory" like it tends to nowadays.
|
# ? May 8, 2015 23:00 |
|
LeftistMuslimObama posted:I don't mind void * arithmetic ad a shorthand for doing things 1 byte at a time, but it would be better if there was some type of genetic byte * you could cast to. I think it's weird to cast random structs and such to chars for math. It's kinda inscrutable when you don't already know what's up with those casts. What problems would you likely run into with a simple typedef?
|
# ? May 8, 2015 23:39 |
|
Jeb Bush 2012 posted:It's less weird when you know that historically a byte was defined as the space it takes to store a single character, rather than either meaning "8 bits" or "the smallest addressable unit of memory" like it tends to nowadays. How does this hypothesis explain having 8 bit bytes but 7 bit characters?
|
# ? May 8, 2015 23:39 |
|
fritz posted:How does this hypothesis explain having 8 bit bytes but 7 bit characters? Rounding up to a power of two.
|
# ? May 8, 2015 23:47 |
|
|
# ? Jun 8, 2024 09:07 |
|
Spatial posted:The originating reason for all of this: the person who originally defined the types couldn't figure out how to define the function pointer type because the struct it points to contains the function pointer type. It's self-referential. C and its bad old declaration order requirements once again conspire with bad programmers to create a rat's nest. Which is silly, because you write it in exactly the same way you would write any other self-reference within a struct definition: with "struct foo" instead of whatever typedef you're about to introduce. (Or you just typedef a forward declaration before defining the struct.) Anybody who has written a tree in C should be completely comfortable with this.
|
# ? May 9, 2015 00:31 |