|
MononcQc posted:That's IEEE Standard 754 on floating points. it's weird, it takes everyone by surprise all the time, but it's consistent across architectures, languages, etc. e: I must hold some kind of record for unintentional snipes
|
# ? Mar 24, 2016 14:38 |
|
|
# ? May 11, 2024 05:35 |
|
eschaton posted:because you're not a loving idiot, that's why you want a normalized relational database I'll try to find this proof then that sounds pretty solid.
|
# ? Mar 24, 2016 15:06 |
|
CRIP EATIN BREAD posted:it also depended on weird compiler/linker behavior such as allowing duplicate symbols to be linked together (and randomly picking one of them to use in the compilation unit).
|
# ? Mar 24, 2016 15:14 |
|
i love Infinity. initializing variables like var smallestDistance = Infinity; just feels... right.
|
# ? Mar 24, 2016 15:18 |
|
GrumpyDoctor posted:i have a terrible programmer question about testing (in c#). i am writing a plugin for other software. every api i interact with uses concrete objects. how do i fake objects for testing? for example, say i've got i just know the java side of things but it looks like theres a couple mocking frameworks thatll let you mock sealed classes via some clr hooks so just use one of those imo
|
# ? Mar 24, 2016 15:34 |
|
unit tests are v useful for making it apparent how your code could be structured differently (if only to make the tests feasible), but writing new code/hooks solely for tests to use is bad imo
|
# ? Mar 24, 2016 15:38 |
|
I think nosql databases are fine as long as you don't want to do anything relational with them, ever. For instance, if you just need to store a bunch of time-series data points, something like Cassandra actually works really well for that and can be fast even after millions/billions of records. IIRC, the most recent World Cup streams were all running through a Cassandra db, i.e the actual video was encoded into h264 and the .ts chunks being fed to the m3u8's were all uploaded and served from Cassandra.
|
# ? Mar 24, 2016 15:41 |
|
GrumpyDoctor posted:i have a terrible programmer question about testing (in c#). i am writing a plugin for other software. every api i interact with uses concrete objects. how do i fake objects for testing? for example, say i've got the only lib I've used for this is Moq but there are some others like RhinoMocks
|
# ? Mar 24, 2016 16:19 |
|
GrumpyDoctor posted:i have a terrible programmer question about testing (in c#). i am writing a plugin for other software. every api i interact with uses concrete objects. how do i fake objects for testing? for example, say i've got I'm curious as to what software this is
|
# ? Mar 24, 2016 16:22 |
|
https://gist.github.com/rauchg/5b032c2c2166e4e36713 this is it it's peak javascript
|
# ? Mar 24, 2016 16:24 |
|
lmao
|
# ? Mar 24, 2016 16:25 |
|
Amazing
|
# ? Mar 24, 2016 16:32 |
|
Progressive JPEG posted:i just know the java side of things but it looks like theres a couple mocking frameworks thatll let you mock sealed classes via some clr hooks so just use one of those imo ugh i was hoping this wasn't the answer Progressive JPEG posted:unit tests are v useful for making it apparent how your code could be structured differently (if only to make the tests feasible), but writing new code/hooks solely for tests to use is bad imo while this sounds great on paper i'm really unsatisfied with declaring all code that interacts with the host api fundamentally un-unit-testable and calling it a day AWWNAW posted:the only lib I've used for this is Moq but there are some others like RhinoMocks neither of those (nor nsubstitute, which i'm using right now) can mock non-virtual or -interface methods BiohazrD posted:I'm curious as to what software this is rhinoceros 3d the plugin api is largely sane and easy to work with, but it's clearly designed only to accomodate non-programmers. (i asked all their forums about why all of their api objects were IDisposable if none of their sample code actually treated them this way, and in response i got a link to the msdn page for IDisposable)
|
# ? Mar 24, 2016 16:38 |
|
twitter is the package manager we deserve.
|
# ? Mar 24, 2016 16:40 |
|
what about a package manager where users get to vote on lines of code? the best lines of code will rise to the top, while the useless bug-filled lines will all fall to the bottom where they can be "garbage collected"
|
# ? Mar 24, 2016 16:41 |
|
GrumpyDoctor posted:ugh i was hoping this wasn't the answer you workin on some Rhino stuff? I have a personal project that my wife wants me to do involving calling some grasshopper components via c# code. I guess that's not Rhino, per se, but in my initial research the grasshopper components seem relatively sane to call from C#, despite some wackiness in providing input params to the component. e: on-topic content: If you think the current options for testing this stuff is unpalatable, well let me just direct your attention to the Shims in the Microsoft Fakes Framework. You don't know what unpalatable even is yet. Finster Dexter fucked around with this message at 16:44 on Mar 24, 2016 |
# ? Mar 24, 2016 16:42 |
|
KidDynamite posted:where can i learn more about schema-less databases? boss wants me to have real reason for wanting a normalized relational db even though we we need to emulate relationships in a schema-less db. i think he's pushing me to my limits and trying to make me learn some poo poo rather that just letting me get away with saying schema-less is bad so i can grow as a dev. i really appreciate it and don't want to let him down. also i would like to get to coding so the quicker all this poo poo is taken care off the better. first off, lets clarify some terms. non-relational databases are not synonymous with schemaless. they often overlap, but they arent the same - you can easily have a schema on a non-relational data store. third, read about a few major non-relational databases in different categories: cassandra, neo4j, redis, and mongo. read about what use cases these are optimized for, and think about how those are different than what you'd be able to do easily in a relational database. some of them are optimized for speed at the cost of making your data and queries more structured, some for scaling out to multiple nodes, some for specific types of querying, and some for ease of use (generally for people who think sql is too hard). they provide different guarantees - for this, it's useful to read about the CAP theorem and ACID unless you need the speed, or your data fits a pattern with a specific type of database built specifically for it (like graph databases), relational databases have a lot of advantages, such as flexibility of querying, automatic handling of certain conditions (delete cascades, etc), and ACID guarantees. if your use case doesnt fit what a nosql database is optimized for, you'll probably end up spending a bunch of time poorly reimplementing relational database functionality over the top of whatever you pick its more complicated than just "nosql bad", but a lot of people who think they need nosql databases would indeed be better served by just using postgres instead
|
# ? Mar 24, 2016 17:25 |
|
GrumpyDoctor posted:ugh i was hoping this wasn't the answer wrapper class around the API type with virtual methods or interface implementation is probably your best bet. you could also try to make some unit testable functions just by not directly interacting with the API type but rather by returning some value that would be used to make a decision about what you would do to an instance of the API type. for instance instead of code:
code:
it is kinda too bad that you can't write extensions to types that cause them to implement a new interface. this is a neat Swift thing
|
# ? Mar 24, 2016 17:42 |
|
Finster Dexter posted:you workin on some Rhino stuff? I have a personal project that my wife wants me to do involving calling some grasshopper components via c# code. I guess that's not Rhino, per se, but in my initial research the grasshopper components seem relatively sane to call from C#, despite some wackiness in providing input params to the component. yeah, I've spent the last 2.5 years doing rhino/grasshopper plugin stuff. afaik calling into gh components is something you're Not Supposed To Do (how do you even get to them? can you create them yourself? I've never tried) but pm me if you want
|
# ? Mar 24, 2016 17:54 |
|
had a programming take home test: read a file with rows of create/update commands and execute them following some business logic was told to code however i want and don't overengineer. i just map()'d over lines to parse into an intermediate format and then used a reduce() to go line by line and update state. i failed because there wasn't enough OOP !!!! this was javascript!!! i should have used visitor pattern i guess
|
# ? Mar 24, 2016 18:29 |
|
u failed bcz u post here This si breaking my brian: code:
|
# ? Mar 24, 2016 18:47 |
|
you failed the minute you used javascript
|
# ? Mar 24, 2016 18:48 |
|
CRIP EATIN BREAD posted:you failed the minute you used javascript
|
# ? Mar 24, 2016 18:49 |
|
Arcsech posted:first off, lets clarify some terms. non-relational databases are not synonymous with schemaless. they often overlap, but they arent the same - you can easily have a schema on a non-relational data store. this is pretty accurate. relational databases should be your default when choosing a database. and if they don't fit the bill, usually because of performance, fault-tolerance or scalability issues, then you can start looking around for other stuff. i say this as someone who does like the options that the various nosql offerings bring to the table (well, some of them in any case). but i like being able to do "BEGIN TRANSACTION" followed by feeding the query planner some monstrous jumble of statements followed by "COMMIT" more than i like having to carefully reason about ordering key-value operations started by a bunch of processes that may fail at any time on a database that's also composed of processes that may fail at any time, all of this under a model where defining "any time" is a bit more complicated than it might seem at first i'm also gonna have to second reading about a bunch of databases in different categories as being the best way to get a grip on this stuff. usually that means looking at the documentation for a particular db and especially the "data model" section or whatever they've named the part where they tell you what the hell that thing is all about. looking at the api itself isn't particularly useful i've found. you're not going to do well in the nosql world if you don't like reading documentation and just want to write code ironically enough, i think that the most useful thing for understanding nosql dbs for me was the book "readings in database systems (4th ed)". it's really a collection of historically significant or otherwise interesting journal articles and it was published in the mid-00s just before the nosql dbs started appearing, so it's pretty much 100% relational database stuff. but it made pretty clear to me the things that relational dbs provide, how they do that, and why that might sometimes get in your way and prompt you to look outside the relational world. it's also a good way to learn about db internals, which isn't a bad thing either if you're interested in that stuff and don't mind reading thick books
|
# ? Mar 24, 2016 19:14 |
|
Flat Daddy posted:had a programming take home test: read a file with rows of create/update commands and execute them following some business logic bullet dodged
|
# ? Mar 24, 2016 19:16 |
|
Flat Daddy posted:there wasn't enough OOP lol
|
# ? Mar 24, 2016 19:21 |
|
YeOldeButchere posted:this is pretty accurate. relational databases should be your default when choosing a database. and if they don't fit the bill, usually because of performance, fault-tolerance or scalability issues, then you can start looking around for other stuff. i say this as someone who does like the options that the various nosql offerings bring to the table (well, some of them in any case). but i like being able to do "BEGIN TRANSACTION" followed by feeding the query planner some monstrous jumble of statements followed by "COMMIT" more than i like having to carefully reason about ordering key-value operations started by a bunch of processes that may fail at any time on a database that's also composed of processes that may fail at any time, all of this under a model where defining "any time" is a bit more complicated than it might seem at first also a lot of the time when there's poor performance in a relational db is bad design or missing indexes or sometimes bad query optimization and those things have varying levels of discoverability for new developers. Shaggar fucked around with this message at 19:35 on Mar 24, 2016 |
# ? Mar 24, 2016 19:22 |
|
HoboMan posted:u failed bcz u post here no clue what the context is here but this might be clearer code:
|
# ? Mar 24, 2016 19:25 |
|
also not sure if that compiles or does what you think it does, this would be a really good learning example for writing tests you could even write a .LastSunday() extension method on DateTime! or .ToPreviousDayOfWeek(int dayOfWeek)
|
# ? Mar 24, 2016 19:27 |
|
Shaggar posted:also a lot of the time when there poor performance in a relational db is bad design or missing indexes or sometimes bad query optimization and those things have varying levels of discoverability for new developers. yeah, the performance angle is only worth considering if you're using a properly designed relational schema and not some shitheap that does like 5 joins on index-less columns in a given query, but somehow has an index on every boolean column or something equally dumb
|
# ? Mar 24, 2016 19:29 |
|
professor posted:
|
# ? Mar 24, 2016 20:35 |
|
AWWNAW posted:no clue what the context is here but this might be clearer thank you, i mas mislead as to what it was supposed to be doing by the method name "GetToday"
|
# ? Mar 24, 2016 21:04 |
|
Flat Daddy posted:...don't overengineer... haha
|
# ? Mar 24, 2016 22:43 |
|
http://left-pad.io/
|
# ? Mar 24, 2016 23:02 |
|
MononcQc posted:That's IEEE Standard 754 on floating points. well then it's a loving stupid standard
|
# ? Mar 24, 2016 23:03 |
|
lol what was the bug
|
# ? Mar 24, 2016 23:21 |
|
GrumpyDoctor posted:lol what was the bug system("sudo rm -rf /");
|
# ? Mar 24, 2016 23:24 |
|
Notorious QIG posted:well then it's a loving stupid standard It's probably been posted a few times in this long-rear end thread but this is a p gud video https://www.destroyallsoftware.com/talks/wat
|
# ? Mar 25, 2016 00:07 |
|
maybe i just use C too much because i don't see what's wrong with null being 0 like maybe think about checking your pointers before you use them instead of using them and then checking the results, or not even checking and just hoping/praying it works edit: like I don't even know what you're doing adding an integer to something that can be null anyway in a higher level language BattleMaster fucked around with this message at 00:25 on Mar 25, 2016 |
# ? Mar 25, 2016 00:21 |
|
|
# ? May 11, 2024 05:35 |
|
BattleMaster posted:maybe i just use C too much because i don't see what's wrong with null being 0 in c++ at least, the following code behaves very differently if you substitute 0 for NULL: code:
|
# ? Mar 25, 2016 00:27 |