|
itt i suddenly realize i dont know poo poo about data structures i feel like a lotta non-array poo poo is good because you can resize it easy but if you stuff it in an array now u cant so???
|
# ? Aug 4, 2016 01:12 |
|
|
# ? May 24, 2024 20:09 |
|
just use a dynamic array
|
# ? Aug 4, 2016 01:15 |
|
or more realistically, use your language's library that internally uses a dynamic array
|
# ? Aug 4, 2016 01:17 |
|
also depending on your workload you may not need to resize often or at all so just copying into a larger array when needed is fine.
|
# ? Aug 4, 2016 01:28 |
|
i started doing things with garbage-nn again i compeltely broke it. oops
|
# ? Aug 4, 2016 01:59 |
|
it shouldn't be too surprising that you can implement basically any data structure with arrays, since your data structure is in memory, and memory is just a big array
|
# ? Aug 4, 2016 02:01 |
|
this is not accurate
|
# ? Aug 4, 2016 02:02 |
|
GameCube posted:re: languages, high schoolers are being taught javascript now. have fun with THAT poo poo with any luck this means that ten years from now, everyone under the age of 30 will flat refuse to use js under any circumstances, because they have bad memories from school (as with java, today)
|
# ? Aug 4, 2016 02:16 |
|
ah great async reads were loving everything up (???)
|
# ? Aug 4, 2016 02:24 |
|
day 49601 of trying to figure out how to make pixel go from UV coordinates of texture to screen coordinates of triangle
|
# ? Aug 4, 2016 04:20 |
|
Luigi Thirty posted:day 49601 of trying to figure out how to make pixel go from UV coordinates of texture to screen coordinates of triangle Do you have barycentric coords for your pixel? Plug the UV's of the triangle's vertices(from the model file) into your Barycentric->Cartesian formula along with your barycentric coords and voila you have your texel*** ***if you want do perspective correction on that it's a bit more work because you need barycentric clip coordinates instead https://github.com/ssloy/tinyrenderer/wiki/Technical-difficulties:-linear-interpolation-with-perspective-deformations Oh, and generally the UV coords are going to be between 0 and 1 so you'll have to multiply by the width/height of your texture image to get the specific location within the specific texture. ErIog fucked around with this message at 04:37 on Aug 4, 2016 |
# ? Aug 4, 2016 04:34 |
|
Notorious b.s.d. posted:with any luck this means that ten years from now, everyone under the age of 30 will flat refuse to use js under any circumstances, because they have bad memories from school i'm glad that c# will escape this punishment because it's good
|
# ? Aug 4, 2016 04:55 |
|
triple sulk posted:i'm glad that c# will escape this punishment because it's good it will escape this punishment only because it will be forgotten
|
# ? Aug 4, 2016 05:16 |
|
ErIog posted:Do you have barycentric coords for your pixel? Plug the UV's of the triangle's vertices(from the model file) into your Barycentric->Cartesian formula along with your barycentric coords and voila you have your texel*** I ripped out the slow barycentric calculations in favor of Chris Hecker's triangle splitting rasterization method but I can get the coordinates again. I don't care about perspective deformation yet, that can come after I can at least project a 256x256 checkerboard onto a flat triangle properly Luigi Thirty fucked around with this message at 05:21 on Aug 4, 2016 |
# ? Aug 4, 2016 05:19 |
|
Luigi Thirty posted:project a 256x256 checkerboard onto a flat triangle properly pick a top-left corner and blit?
|
# ? Aug 4, 2016 05:30 |
|
Notorious b.s.d. posted:it will escape this punishment only because it will be forgotten ~better 2 be forgotten than 2 fade away~
|
# ? Aug 4, 2016 05:41 |
|
LeftistMuslimObama posted:*hugz* we're recovering slashdotters
|
# ? Aug 4, 2016 06:49 |
|
i used to get compliments for my low slashdot user id. pretty cool stuff
|
# ? Aug 4, 2016 06:52 |
|
Luigi Thirty posted:they taught databases in high school for some reason so I learned SQL in 11th grade i feel like i lucked out, my small town high school taught c++ in 10th grade and gave us a linux server to host web pages on. i doubt that lasted long after i left the school library's IT guy found out i was into genetic algorithms and 3d rendering, and he got excited and would print out documentation he wrote and give it to me. he was like Lazlo in Real Genius
|
# ? Aug 4, 2016 07:03 |
|
LeftistMuslimObama posted:*hugz* oh, i am an idiot.
|
# ? Aug 4, 2016 07:35 |
|
so loving future posted:honestly tho.... who didn't learn qbasic first? i learned, well, used the basic in all the different home computers my friends had: c64, spectrum, amstrad, msx my first utility programs/scripts i made for myself were probably made in arexx on an amiga
|
# ? Aug 4, 2016 09:53 |
|
my friends and i used to make crappy text adventure games in qbasic on the computers in the school library. i also remember making animations by manually drawing out pixel maps for the whole screen and getting a couple of frames in there before i'd get bored
|
# ? Aug 4, 2016 11:09 |
|
Mr Dog posted:uh linked lists that are implemented as dynamically allocated non-contiguous memory should be considered incredibly niche optimizing for the computer's cache is one of the most important things in a data structure and linked lists poo poo all over that
|
# ? Aug 4, 2016 13:16 |
|
LeftistMuslimObama posted:ya, using c++ for teaching cs would be a bit like using chuck tingle books as the basis of a creative writing degree it's as terrible as you think it might be
|
# ? Aug 4, 2016 13:18 |
|
Illusive gently caress Man posted:not sure who's the terrible programmer in this situation, me, or every python dev. I don't really 'get' mixin classes or why every python dev uses them for everything and they continually frustrate me when I'm trying to figure out what code actually does. in a deece static typed system, usually abstractions can be easily embedded into the type system to be immediately apparent
|
# ? Aug 4, 2016 13:20 |
|
comedyblissoption posted:dynamic typing is absolutely terrible because for any complicated abstraction, you have to expend a ton of mental energy to reverse engineer what the hell is going on I am going to keep banging this drum but dynamically typed languages do not work very well for big bad production systems, unless you wrote it and want some job security
|
# ? Aug 4, 2016 13:25 |
|
the last 3 places i've worked at were all python shops and i walked away from those 3 years with the hot take that python at scale is basically "imagine if java was easier to get up and running with and then worse in every possible way" i only have the most passing surface-level familiarity with java though, so ymmv. it frustrates me cuz i really like python as a fun lil thing i can use to make side projects and scripts and it's super powerful for creating tiny one-off services quickly (web scrapers, etc) but holy poo poo if you try to "architect" anything with it it really ends up being as verbose and complex as java except without any of the actual good aspects of it i may be using go at my next gig which seems like it kind of sucks for web services, but at least i think it'll be easier to maintain than the python codebases i've worked on
|
# ? Aug 4, 2016 13:29 |
|
dynamic sucks because it kills off language discovery as part of the development process. if I had to look poo poo up in separate api docs instead of wander through namespaces and signatures with an auto completer I would literally never get anywhere
|
# ? Aug 4, 2016 13:32 |
|
just use pycharm
|
# ? Aug 4, 2016 13:36 |
|
GameCube posted:just use pycharm It's good, but not good enough Gets too confused with lots of similarly named methods
|
# ? Aug 4, 2016 13:43 |
|
as a terrible programmer i am thankful for ide auto-completion. i have discovered many useful parts of the java standard library by just scrolling through that little popup box. i end up reading the javadoc anyway of course. but there are a lot of situations where it has given me a more intuitive feel of how different classes and data structures work
|
# ? Aug 4, 2016 13:45 |
|
The organisational structure and social constructs around a code base are more significant indicators of quality than most known technical metrics. [pdf] if you want maintainable code and scalable systems, that's where you gain the most to optimize
|
# ? Aug 4, 2016 13:57 |
|
abraham linksys posted:the last 3 places i've worked at were all python shops and i walked away from those 3 years with the hot take that python at scale is basically "imagine if java was easier to get up and running with and then worse in every possible way" java is easier to use than python in every single way
|
# ? Aug 4, 2016 14:03 |
|
also lol @ using go
|
# ? Aug 4, 2016 14:04 |
|
Do I have a wrong opinion? I just had a fun discussion with a colleague about documentation. I like putting most of it in tooltips and making things pretty discoverable on the user side (good UX, workflow hints). This means the docs live with the code so when the code changes it's quick and easy to update. He wants it all in manual pages that are managed separate from the code and basically say the same things as the tooltips would. This would mean a code change needs tooltip updates + manual update (including updated screenshots). To me this just means that in ~1 week the docs will be out of date. Am I wrong?
|
# ? Aug 4, 2016 14:08 |
|
generate the manuals from the documentation in the code.
|
# ? Aug 4, 2016 14:10 |
|
Shaggar posted:generate the manuals from the documentation in the code. I wish, but that is not possible for this system.
|
# ? Aug 4, 2016 14:17 |
|
Strumpy posted:Do I have a wrong opinion? I just had a fun discussion with a colleague about documentation. I like putting most of it in tooltips and making things pretty discoverable on the user side (good UX, workflow hints). This means the docs live with the code so when the code changes it's quick and easy to update. He wants it all in manual pages that are managed separate from the code and basically say the same things as the tooltips would. This would mean a code change needs tooltip updates + manual update (including updated screenshots). To me this just means that in ~1 week the docs will be out of date. Am I wrong? as a rule of thumb, tooltips are bad. but if it's just hints that might help the user and don't actually contain any essential information, they have some value.
|
# ? Aug 4, 2016 14:20 |
|
HoboMan posted:trees being implemented as arrays is basically the most mindblowing thing i ever learned python has heapq heapsort exists here's http://arxiv.org/pdf/1509.05053.pdf ARRAY LAYOUTS FOR COMPARISON-BASED SEARCHING
|
# ? Aug 4, 2016 14:21 |
|
|
# ? May 24, 2024 20:09 |
|
Mr Dog posted:*puts on fishmech hat* like you've got an immutable tree and you put it to disk and you want to have quick operations you could just store it in a sorted output (sstables), but if you store it in BFS search order, things go much faster. as uh the alternative left/right keys are always next to each other in the array
|
# ? Aug 4, 2016 14:23 |