|
Blinkz0rz posted:i have a dumb question from my own personal terrible programming background, this is one of the best questions i've seen asked in this thread so kudos.
|
# ? Mar 6, 2015 15:55 |
|
|
# ? May 25, 2024 01:45 |
|
Shaggar posted:there are times to use interfaces (most of the time) and there are times to use abstract classes. this is the single best explanation for interfaces that i've ever seen. it makes complete sense. thanks shaggar
|
# ? Mar 6, 2015 15:59 |
|
guys i am loving lost with haskell im trying to take a list and get the permutations of that list and ive literally no idea where to start code:
but trying to think of a way to construct all the different permuted lists is eluding me, like i need to start swapping poo poo around but i can't think of a way to do it
|
# ? Mar 6, 2015 16:34 |
|
Awia posted:
|
# ? Mar 6, 2015 16:36 |
|
often you'll find yourself deep in the weeds when dealing with a problem and it helps to take a step back and re-evaluate it from a wider angle. In this case the first question to ask yourself would be: Why am I using Haskell?
|
# ? Mar 6, 2015 16:37 |
|
Awia posted:guys i am loving lost with haskell Use recursion
|
# ? Mar 6, 2015 16:39 |
|
Shaggar posted:often you'll find yourself deep in the weeds when dealing with a problem and it helps to take a step back and re-evaluate it from a wider angle. In this case the first question to ask yourself would be: Why am I using Haskell? its for a uni module sadly, ive been enjoying it up until this point where its just lost me using a real language and ide would help yes
|
# ? Mar 6, 2015 16:40 |
|
ooh isn't there a way to do that by using list as a monad :p
|
# ? Mar 6, 2015 16:40 |
|
MALE SHOEGAZE posted:Use recursion fukkin genius!
|
# ? Mar 6, 2015 16:40 |
|
also see list comprehension
|
# ? Mar 6, 2015 16:44 |
|
Flat Daddy posted:ooh isn't there a way to do that by using list as a monad :p theres always a way to do it with monads.
|
# ? Mar 6, 2015 16:46 |
|
Awia posted:guys i am loving lost with haskell i'm assuming that you're trying to work it out yourself rather than just using a library function (it's in Data.List). male shoegaze is right in that you need to use recusion but also list comprehensions: it starts: perm xs = [ x:ys | x <- xs, ys <- ??????? xs] this way each of the l elements of the list is at the front of a permuted list exactly l times.
|
# ? Mar 6, 2015 16:49 |
|
gonadic io posted:i'm assuming that you're trying to work it out yourself rather than just using a library function (it's in Data.List). male shoegaze is right in that you need to use recusion but also list comprehensions: yeah, i found the library function ages ago ok i get ya, thanks for the leg up!
|
# ? Mar 6, 2015 16:56 |
|
also for the people going on about monads:code:
code:
but nobody would bother doing it that way really
|
# ? Mar 6, 2015 17:05 |
|
Flat Daddy posted:ooh isn't there a way to do that by using list as a monad :p and you're thinking of powerSets which has a really obtuse 1-liner which i'll go over why it works if people want me to. powerSets = filterM (const [True, False])
|
# ? Mar 6, 2015 17:25 |
|
Shinku ABOOKEN posted:someone mentioned Kotlin in of these threads i haven't tried it, but how bad could it be in comparison to scala? it's written by the jetbrains people so the ide support is already better. i think i'll be looking for some small tasks to use it for at work to give it a spin.
|
# ? Mar 6, 2015 17:25 |
|
Im working on a thing that requires a free text search of fields related to an entity in my database so im using apache solr. the documentation is kind of flaky but after working on if for a while now I have it indexing all the relevant fields, making those fields searchable in free text, and then also making other fields I specify returned for autocomplete suggestion terms. pretty cool, imo.
|
# ? Mar 6, 2015 17:56 |
|
that was some interesting gochat, thanks! I'm not changing my mind or anything, we use go at work and i want to get slick with it. we're not writing photoshop or anything we just need insane concurrency and, well, our go daemons run between 40 and 200 times faster than our old ones and are v. needs suiting
|
# ? Mar 6, 2015 18:09 |
|
export insane_concurrency=Erlang
|
# ? Mar 6, 2015 18:11 |
|
Shaggar posted:Im working on a thing that requires a free text search of fields related to an entity in my database so im using apache solr. the documentation is kind of flaky but after working on if for a while now I have it indexing all the relevant fields, making those fields searchable in free text, and then also making other fields I specify returned for autocomplete suggestion terms. pretty cool, imo. At what point do you decide to do this vs. just make some sprocs to do a LIKE on all the relevant varchars in your database, and if you have too much data maybe have that sproc run on its own slave server that gets replicated to.
|
# ? Mar 6, 2015 18:21 |
|
That will work up to a point. eventually you just have too much poo poo and it becomes a pain to manage in procs and also your performance will start to suffer. If you're at the point where you're thinking about dedicating a machine to a stored proc for searching, it makes more sense to use an actual search server. In addition to being more efficient at search you also gain a load of features you just don't get with sql, like autocomplete, spell check, fuzzy matching, synonym matching, etc...
|
# ? Mar 6, 2015 18:27 |
|
also if you have messy data that doesn't index well in sql (because your clients are retards who send you bad data) you can clean it up during the solr indexing process. it makes indexing slower, but searches faster and higher quality.
|
# ? Mar 6, 2015 18:29 |
|
gonadic io posted:and you're thinking of powerSets which has a really obtuse 1-liner which i'll go over why it works if people want me to. hit me. idgi
|
# ? Mar 6, 2015 19:03 |
|
fart simpson posted:hit me. idgi inlining (const [True, False]) into the definition of filterM, then converting it into a list comprehension: code:
gonadic io fucked around with this message at 19:21 on Mar 6, 2015 |
# ? Mar 6, 2015 19:16 |
|
rrrrrrrrrrrt posted:i haven't tried it, but how bad could it be in comparison to scala? it's written by the jetbrains people Rofl
|
# ? Mar 6, 2015 19:45 |
|
ok I tried to desugar this completelycode:
|
# ? Mar 6, 2015 20:30 |
|
that is so awful
|
# ? Mar 6, 2015 20:32 |
|
the whole exercise just made me think filterM over lists is completely friggin useless in practice.
|
# ? Mar 6, 2015 20:34 |
|
i have a dumb question wrt qt i'm having an issue with an app almost exactly like this http://stackoverflow.com/questions/17175398/deployed-qt5-application-doesnt-print-or-show-print-dialog but i'm not having any luck in getting the QT_DEBUG_PLUGIN thing to work. does anyone know how to implement that?
|
# ? Mar 6, 2015 20:34 |
|
Shaggar posted:that is so awful oh yeah and what does the byte code for that function in java look like? rrrrrrrrrrrt posted:the whole exercise just made me think filterM over lists is completely friggin useless in practice. agreed i've never ever seen somebody use it except for this
|
# ? Mar 6, 2015 20:42 |
|
Doesn't this work?code:
|
# ? Mar 6, 2015 20:46 |
|
no because it doesn't take an hour to understand duh
|
# ? Mar 6, 2015 20:49 |
|
HappyHippo posted:Doesn't this work? I have no idea what is going on here
|
# ? Mar 6, 2015 20:50 |
|
"hmm yes let me just use Haskell to write code that someone without a math phd could understand" - an extremely terrible programmer
|
# ? Mar 6, 2015 20:51 |
|
Shaggar posted:I have no idea what is going on here this is the most shaggar post ever lol "i don't understand this language that i have never written any code and don't know the syntax of"
|
# ? Mar 6, 2015 20:52 |
|
Shaggar posted:I have no idea what is going on here some sorta tail recursive poo poo or something
|
# ? Mar 6, 2015 20:52 |
|
gonadic io posted:this is the most shaggar post ever lol lol
|
# ? Mar 6, 2015 20:53 |
|
gonadic io posted:this is the most shaggar post ever lol in most languages you can tell what they do cause the syntax is reasonable. Haskells syntax is awful on every level and is completely indefensible
|
# ? Mar 6, 2015 20:54 |
|
no in most languages you spell out everything in retarded baby steps that joe blow idiot can follow because he can't understand anything even remotely declarative.
|
# ? Mar 6, 2015 20:56 |
|
|
# ? May 25, 2024 01:45 |
|
Shaggar posted:I have no idea what is going on here Recursively defines a powerset as the first element of the list added to all powersets of the remainder of the list. so in [1,2,3] it is defined as: : 1 added to all powersets of [2,3] -> 2 added to all powersets of [3] -> powersets of [3] are [3] and [] -> 2 added to [] and [3], yielding [], [2], [3] and [2,3] -> 1 added to [], [3], [2,3], [2] -> [], [1], [2], [3], [2,3], [1,2], [1,3], [1,2,3] code:
MononcQc fucked around with this message at 21:01 on Mar 6, 2015 |
# ? Mar 6, 2015 20:56 |