|
spring is a di container so the idea is to abstract the implementation from the consumer this way if you add or remove or change implementations its a runtime concern instead of compile time. in the case of cxf and a soap service, you could have a local copy of the library that performs those same tasks, or with one line in your spring config you could replace the local implementation bean with a cxf proxy bean. the code that gets the injected bean (whether local implementation or remote proxy) doesn't care. i would say that yes spring is probably over used in many cases, but it has its uses. a more complex example is i have a set of web services that each use one of 6 predefined interfaces. i stuff the list of endpoints and which interface they use into the database and on boot the consumer gets that list and generates CXF proxies for each one using the interface and endpoint address. The code that looks up services for use doesn't care how they got there, it just asks for one that suits its needs and the container obliges. Doing this in spring saves some headache. I could totally write my own singleton collection of services and load it on boot the same way, but im already using spring and cxf so why not take advantage of whats there? theres also voodoo magic like spring-mybatis which is just too good.
|
# ? Mar 10, 2016 21:11 |
|
|
# ? May 26, 2024 19:35 |
|
Bloody posted:the performance is obviously going to be linear in both cases idk how that isn't clear the loop version simply performs a single pass over the input. the filter/foreach version allocates a new array, performs a first pass over the input adding elements to the new array, and then performs a second pass over the new array. except when it doesn't because maybe a smart runtime covered for the inefficiency. i'm not claiming that's a big deal, i'm just saying that i don't see the purpose of using something that might be less efficient when it doesn't have any obvious advantages to make up for the uncertainty?
|
# ? Mar 10, 2016 21:17 |
|
using the functional approach gives you better separation of concerns should you need to extend it sure with this tiny example they're both really simple but I'd way rather see 8 methods chained than a forloop with 8 things happening in the body. and if you separate out the concerns using different forloop-ed functions you no longer get the single pass that the lazy collection gives you.
|
# ? Mar 10, 2016 21:19 |
|
doing side-effecting code lazily is some poo poo though and can cause fun stuff like exceptions escaping a try/catch because the declaration of the lazy collection doesn't trigger them, only whatever code later down the line that actually evaluates the collection
|
# ? Mar 10, 2016 21:20 |
|
gonadic io posted:using the functional approach gives you better separation of concerns should you need to extend it thanks for spelling it out, that makes sense
|
# ? Mar 10, 2016 22:25 |
|
Soricidus posted:the loop version simply performs a single pass over the input. the filter/foreach version allocates a new array, performs a first pass over the input adding elements to the new array, and then performs a second pass over the new array. except when it doesn't because maybe a smart runtime covered for the inefficiency. the "functional" version is better because it communicates intent. a for loop can do a lot of things, a filter only does one thing. you have to read the whole for loop in order to know that it's only doing a filter. in this case its pretty basic but as it gets more complicated the functional approach lets you know whats going on before you even read the lambdas/functions. like if you see a = b.filter(...).map(...) you know the general structure of whats going to happen before you even read the ....
|
# ? Mar 10, 2016 22:32 |
gonadic io posted:yeah but and code:
|
|
# ? Mar 10, 2016 22:34 |
|
verilog is the worst loving language and it loving infuriates me that this loving garbage still exists nevermind that the loving toolchains are nightmare piles of proprietary rear end at every single step of the loving equation, the fundamental languages that feed into them are loving trash you thought uptake on new poo poo in c++ was bad? verilog was deprecated loving sixteen years ago by systemverilog and this loving toolchain doesnt support any of the new bits you wanna have a two-dimensional register? ok thats fine wait you wanna make it an input? gently caress you, flatten it to one dimension then rearrange it on the other side of the boundary a loving high school cs student could write a better loving language than this loving verilog verilog makes me drink
|
# ? Mar 10, 2016 22:34 |
|
im installing haskell and clash and spending the rest of time figuring out whatever the gently caress that pile of mess is because it will be less of a waste of time than working with verilog
|
# ? Mar 10, 2016 22:35 |
|
leper khan posted:big_butts = [butt for butt in butts where butt.is_big()] :catyikes:
|
# ? Mar 10, 2016 22:36 |
|
oh right im at work and every loving pile of poo poo piece of software that connects to the internet inexplicably cannot figure out how to use loving system proxy settings and half the time ships with no way of working with a loving proxy in the first place so of course its immediately rendered useless gently caress this poo poo im out
|
# ? Mar 10, 2016 22:42 |
|
i learned about binary trees today
|
# ? Mar 10, 2016 22:45 |
|
|
# ? Mar 10, 2016 22:58 |
|
Bloody posted:im installing haskell and clash and spending the rest of time figuring out whatever the gently caress that pile of mess is because it will be less of a waste of time than working with verilog lol what kind of masochistic streak are you on that a c++ embedded programmer (right? i forget my yospos.xlsx) has decided to learn verilog and/or haskell? p.s. post here if you have any questions, i really miss the beginner haskell (and also python) that i used to teach as a phd student
|
# ? Mar 10, 2016 23:09 |
|
Bad Sneakers posted:i learned about binary trees today what new kind of tree will you learn tomorrow, i like b trees
|
# ? Mar 10, 2016 23:12 |
|
they're like binary trees but more
|
# ? Mar 10, 2016 23:13 |
|
gonadic io posted:lol what kind of masochistic streak are you on that a c++ embedded programmer (right? i forget my yospos.xlsx) has decided to learn verilog and/or haskell? your yospos.xlsx is close but ive been doing 50/50 verilog bullshit/glorious c# for a year or so now getting really fuckin sick of the verilog bullshit tho
|
# ? Mar 10, 2016 23:31 |
|
Awia posted:they're like binary trees but more fat. b trees are like binary trees, but really loving fat. the ones used for databases, anyhow i like them too
|
# ? Mar 10, 2016 23:43 |
|
YeOldeButchere posted:fat. b trees are like binary trees, but really loving fat. the ones used for databases, anyhow how fat we talking?
|
# ? Mar 10, 2016 23:45 |
|
idk poo poo about data structures, lol
|
# ? Mar 10, 2016 23:46 |
|
you probably dont need to know just put everything in a list/vector/array
|
# ? Mar 10, 2016 23:48 |
|
for some reason it really blew my mind how binary trees can be represented as arrays. I'm also an idiot
|
# ? Mar 10, 2016 23:51 |
|
Awia posted:how fat we talking? 5 branches per node IIRC? e: most commonly 3 it seems hackbunny fucked around with this message at 23:54 on Mar 10, 2016 |
# ? Mar 10, 2016 23:51 |
|
Awia posted:how fat we talking? real fat. like hundreds of values and children for a single node, instead of the anorexic one value per node in a binary tree
|
# ? Mar 10, 2016 23:51 |
|
hackbunny posted:5 branches per node IIRC? YeOldeButchere posted:real fat. like hundreds of values and children for a single node, instead of the anorexic one value per node in a binary tree who do i believe?
|
# ? Mar 10, 2016 23:52 |
|
like i learned enough to pass my data structure & algorithm class, and the forgot it all straight away
|
# ? Mar 10, 2016 23:52 |
|
St Evan Echoes posted:like i learned enough to pass my data structure & algorithm class, and the forgot it all straight away the primary function of data structures is to annoy undergrads
|
# ? Mar 10, 2016 23:53 |
|
Awia posted:what new kind of tree will you learn tomorrow, i like b trees u will love mumps, the only data type other than string is btrees
|
# ? Mar 10, 2016 23:59 |
|
"lists? queues? stacks? naw m8 all we need is a btree"
|
# ? Mar 11, 2016 00:01 |
|
Awia posted:who do i believe? me actually the branch factor for b trees is whatever you want it to be. when you look at the big o it seems like it doesn't matter because operations are still gonna be o(logn) and all that changes is the base of the logarithm and that isn't supposed to matter. but if your b tree is on something like a hard drive (as for a db index) where random seeks are expensive and linear reads are cheap, making the b tree really fat and short means you do fewer seeks to get to a leaf, so that ends up being a lot faster and improves your throughput compared to a tall skinny binary tree that does a bunch more seeks all over the place like a loving idiot
|
# ? Mar 11, 2016 00:03 |
|
Awia posted:"lists? queues? stacks? naw m8 all we need is a btree" just heap sort everything
|
# ? Mar 11, 2016 00:05 |
|
does anyone know a good intro to paring heaps?
|
# ? Mar 11, 2016 00:15 |
|
yeah I never used b-trees irl, just studied them in a databases course
|
# ? Mar 11, 2016 00:20 |
|
Valeyard posted:just heap sort everything lol, in mumps a btree node's children are sorted in ascii collation order by key so there are no sorting algorithms for mumps, you just make the key whatever you want to sort by. you implement stacks, queues, etc as one-level btrees. its like some gilligans island make everything out of coconuts type poo poo.
|
# ? Mar 11, 2016 00:46 |
|
if you had to pick one data structure to use for literally everything btrees are a pretty good choice
|
# ? Mar 11, 2016 01:38 |
|
St Evan Echoes posted:like i learned enough to pass my data structure & algorithm class, and the forgot it all straight away Same and now I've got to learn it all again for an interview in 5 weeks. I'm a dirty embedded bit-diddler and rarely think about data structures and never deal with algorithms. Bloody: PS at least it ain't VHDL
|
# ? Mar 11, 2016 02:55 |
|
Plorkyeran posted:if you had to pick one data structure to use for literally everything btrees are a pretty good choice key word is had to, which was definitely the case with mumps since it was originally created to run on one specific mainframe, but the drawback is that your floor performance for all operations is also O(log n) which blows for things where you could get a constant time lookup with something like a hash table. whenever we need to do some type of duplicate checking, for example, there's clearly some performance we're losing there since even if we store hashes of objects we can still only see if that hash is in the tree in o(log n) time. one cheat we do now is to send that sort of work to the web server that runs our c# frontend since we can use other data structures there. we've done testing and in a typical production deployment the latency from sending the data to another server is usually less than the time saved by crunching a big set of hashes or whatever.
|
# ? Mar 11, 2016 04:38 |
|
meatpotato posted:Same and now I've got to learn it all again for an interview in 5 weeks. I'm a dirty embedded bit-diddler and rarely think about data structures and never deal with algorithms. i am aggressively violating company guidelines by not using vhdl lmao
|
# ? Mar 11, 2016 04:46 |
|
LeftistMuslimObama posted:one cheat we do now is to send that sort of work to the web server that runs our c# frontend since we can use other data structures there. we've done testing and in a typical production deployment the latency from sending the data to another server is usually less than the time saved by crunching a big set of hashes or whatever. yeah this seems sane to me everything you post about mumps and healthcare it in general is amazing
|
# ? Mar 11, 2016 05:20 |
|
|
# ? May 26, 2024 19:35 |
|
YeOldeButchere posted:yeah this seems sane to me i really, truly wish i could share more without violating patents and copyrights and such. the rabbit hole is so much deeper than you know. we dominate the marketplace by being the least bad. it's like how ms word is the best word processor. like, it's rough and there's a lot of pain points but wtf else are you going to use, libre office?
|
# ? Mar 11, 2016 06:06 |