Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 14 18:08
    @SethTisue banned @discjock:matrix.org
  • Sep 12 20:37
    @SethTisue banned @manuelzamoratetherbtcusa:matrix.org
  • Sep 06 14:29
    @SethTisue banned @white_hat_hacker:minds.com
  • Sep 06 14:29
    @SethTisue banned @alexchole:matrix.org
  • Aug 31 17:03
    @SethTisue banned @andersonwatts7:matrix.org
  • Jul 19 20:37
    @SethTisue banned @tonyobanon
  • Jan 02 23:58
    @SethTisue banned @fakubishes:nerdsin.space
  • Dec 15 2021 05:01
    som-snytt commented #12516
  • Dec 15 2021 04:38
    SethTisue edited #1312
  • Dec 15 2021 04:38
    SethTisue opened #2273
  • Dec 15 2021 04:31
    jackkoenig opened #12516
  • Dec 15 2021 04:29
    SethTisue edited #1312
  • Dec 15 2021 04:28
    SethTisue edited #1312
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    scala-jenkins milestoned #9831
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    SethTisue opened #9831
  • Dec 15 2021 03:35
    som-snytt commented #11339
  • Dec 15 2021 03:27
    som-snytt labeled #12494
  • Dec 15 2021 03:07
    SethTisue edited #1312
Naftoli Gugenheim
@nafg
The question that I was trying to ask, and kept getting interrupted with irrelevant questions, was what the most idiomatic type would be
Rob Williams
@robwilliams2018_twitter
haha
Ichoran
@Ichoran
case class Slot(time: Int) is my vote.
Naftoli Gugenheim
@nafg
It's really silly in the face of this whole debate about all the business decisions that I spent the last two months debating already
@Ichoran I have no idea what that means.
Rob Williams
@robwilliams2018_twitter
if you are getting the bends from the date rolling over, an 'idiomatic type' is not what you are in need of
Ichoran
@Ichoran
@nafg - Then you need to read and think about what I said previously, because I went over this more than once.
Naftoli Gugenheim
@nafg
@Ichoran I know what you mean but it doesn't add anything
Ichoran
@Ichoran
Good luck! I have to take care of other things.
Then maybe your problem doesn't have anything to do with types.
Naftoli Gugenheim
@nafg
It has to do with choice of java.time types
Not my own modeling
Ichoran
@Ichoran
Anything that isn't just one day is fine.
Naftoli Gugenheim
@nafg
What are you talking about?
Ichoran
@Ichoran
Two DateTimes? Sure. Instant + Duration, fine. Two Durations? Sure. Any of those will give the flexibility you need to spill to a second day from a first.
Naftoli Gugenheim
@nafg
You really don't understand what I'm trying to do
Ichoran
@Ichoran
Some of them need a root time for the day as well (i.e. when is "zero"), some don't.
Naftoli Gugenheim
@nafg
apparently
Ichoran
@Ichoran
Maybe not. Anyway, good luck!
Naftoli Gugenheim
@nafg
Actually LocalDateTime might be a good idea
Rob Williams
@robwilliams2018_twitter
I'm pretty sure I understand it.. but I don't see the problem as being pick a type
Naftoli Gugenheim
@nafg
except there is no date in context
which problem?
Well I guess my question is which type will have the least problems
Ichoran
@Ichoran
Of course there is a date in context because you don't know how many hours the day has otherwise.
So you don't know, for instance, if 2 am even exists.
Martijn Hoekstra
@martijnhoekstra
Cargo handlers at airports have a limited number of truck docks, and they have time slots based on wall time during which those docks are available. They want freight forwarders to make an appointment for those slots. They don't care which truck dock they take, as long as the dock has the right facilities. A system to manage dock availability and reservations sounds a bit like your problem. If it is, I do think I have some idea about such a system.
OlegYch
@OlegYch
i think '@ the type level' is rather vague, https://www.youtube.com/watch?v=gVXt1RG_yN0 but this talk was enlightening for me
Rich
@Rich2
The word "Idriss" popped in to my head around the 1 minute mark.
Seth Tisue
@SethTisue
@pshirshov did you get help with your issue?
OlegYch
@OlegYch
which is pretty much always
OlegYch
@OlegYch
@alexknvl gitter is context-free, mkay https://prnt.sc/igmb1c
Joe Pallas
@jpallas
Sometimes gitter tells you that it is hiding stuff from you, and taunts you by giving you something to click on that never reveals the hidden stuff.
Harrison Houghton
@hrhino
oh, I even thought it was just me.
How's that IRC bridge holding up?
celik sismanturk
@celik0311
im pretty new to scala and have a question about working with lists
Im trying to take a list of lists of characters and converting it into a list of characters inserting a '\n' character between each two lists
the part i get hung up on is the inbetween lists part
Emily Pillmore
@emilypi
@celik0311 use a fold
celik sismanturk
@celik0311
ok good idea trying it now
Emily Pillmore
@emilypi
You can use the prepend operator :+ to add to the end of a list (List(1, 2, 3) :+ 4) == List(1, 2, 3, 4), and combine it with a fold a la
List(List('f', 'o', 'o'),List('b', 'a', 'r'),List('q', 'u', 'x')).foldLeft(Nil:List[Char])((acc, cs) => acc ::: (cs :+ '\n’))

>List(f, o, o,
, b, a, r,
, q, u, x,
)
The only problem will be that the last element will have a newline after. To fix that, you’ll have to use fold in conjunction with a pattern match
I’ll leave that up to you
celik sismanturk
@celik0311
:+1:
i would pattern that the next item isnt Nil correct?
Emily Pillmore
@emilypi
yes. But make sure the function is total. You’ll need 3 cases to do this
Rob Norris
@tpolecat
gitter seems to be freaking out
not that there's anything wrong with that
David Dudson
@DavidDudson

is there a nice way to span from the end of a string???

I cant see it other then implementing it myself. Reversing strings seems innefficient

Ghost
@ghost~54f4b69115522ed4b3dcb16d
@DavidDudson s.lastIndexWhere(!p)is where to split.