<FromGitter>
<girng> ```code paste, see link``` ⏎ ⏎ There has to be an easier way to get all thedata from my `rpg_characters` table. I don't have to select each one, by one do I? is it possible to use `select *` ? all i want to do is select all the characters and put them in `result` and add in the `max_char_slots` from my `client.user_data` hash/key type [https://gitter.im/crystal-lang/crystal?at=5ac022cfc4d0ae80072191f1]
<FromGitter>
<girng> i just feel like i keep using the Types all over the place, feels like i'm making my code messy :(
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
<crystal-gh>
[crystal] MakeNowJust opened pull request #5893: Format: fix indentation in collection with comment after beginning delimiter (master...fix/crystal-format/indent-in-collection-literal-after-comment) https://git.io/vxKSn
<crystal-gh>
[crystal] MakeNowJust opened pull request #5894: Remove duplicated indefinite articles 'a a' in char.cr doc (master...fix/char-a-a) https://git.io/vxKS4
qard_ has joined #crystal-lang
qard_ has quit [Ping timeout: 240 seconds]
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter>
<bararchy> Seems like core dev team are actively avoiding commenting on that topic
<oprypin>
bararchy, i think that they have several good reasons not to merge it, just in terms of the quality of the code, that would be hard for us to understand
<oprypin>
one thing I remember is needing a custom libgc, so it would make distribution of crystal more complicated
<oprypin>
there's probably more
<Groogy>
Morning! o/
Ven`` has joined #crystal-lang
<FromGitter>
<bararchy> Morning Groogy :)
<Jenz>
Morning fellow crystal lovers
<Groogy>
o/
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<strigonLeader> also I would like ctrl-c to raise an interrupt exception as it does in ruby
<FromGitter>
<strigonLeader> but thats a separate issue
<Groogy>
this is safe right? x, y = -y, x
<Groogy>
think I remember something about that it would work the same as std::swap
<Groogy>
i.e it has an intermediary when swapping around
<FromGitter>
<strigonLeader> also theres generally something a bit bad about having to Fiber.yield to execute your trap handler
<FromGitter>
<strigonLeader> It might be a limitation of single threadedness but I think there might be a way around it with the way signals actually get delivered to applications
<yxhuvud>
groogy: yes, it is safe
<FromGitter>
<bararchy> Anyone knows If I can somehow save structures `Hash(Array(UInt8), Array(Int32))` into a DB or some storage ? ⏎ I know i can do it via messagepack but is there a way using a DB of some kind ?
<FromGitter>
<bararchy> using Redis make sense but then I need `my_type.to_msgpack.to_s` or something
<FromGitter>
<bararchy> which seems wierd
<FromGitter>
<ArtLinkov> @bararchy more specifically, we need Hash(Array, Array(Array(Int32)))
<FromGitter>
<bararchy> yeha :)
That_Guy_Anon has quit [Remote host closed the connection]
Jenz has joined #crystal-lang
<Jenz>
RX14 do you have time to tell me what makes my makefile terrible, and how I can improve it?
<RX14>
The practical thing is that you don't have to run shards each time
<Jenz>
That I can easily fix
<Jenz>
Really never use shards
<RX14>
You can have a target for the lib folder that depends on shards.yml and shards.lock
<RX14>
And then touch the folder to make sure after you run shards
<Jenz>
Ok, thanks! Will do
<RX14>
The rest is just my opinion that a "one size fits all" makefile doesn't exist and that the makefile is bloated
<RX14>
I would ignore posix and I would remove most of the variables
<Jenz>
Ok, that is very reasonable, but i felt that I was just pretty much rewriting the base of every makefile for my crystal projects
<Jenz>
Variables I do just for extensibility
<RX14>
Extensibility is just bloat until you're sure you need it
<Jenz>
Im just a noob enjoying crystal, and makefiles ¯\_(ツ)_/¯
<RX14>
For most projects I wouldn't use make files because shards build does the job
<Jenz>
Yeah lol, I have a huge makefile for a super simple cli
<RX14>
Well if you're learning make files than its a great makefile
<RX14>
But I wouldn't make something so robust if I wasn't learning
<Groogy>
it flips the table and walks away it looks like
<FromGitter>
<Jens0512> Hmm, exits normally
hightower2 has joined #crystal-lang
<Groogy>
Crystal compiler -> (ノ `Д´)ノ ~~~┻━┻)`ν゜)
hightower3 has quit [Ping timeout: 248 seconds]
<FromGitter>
<sdogruyol> using them with external names is OK
<FromGitter>
<sdogruyol> however without them shouldn't be
<crystal-gh>
[crystal] Sija opened pull request #5896: Refactor out variable name (master...refactor-out-as-variable-name) https://git.io/vx6vB
Jenz has quit [Ping timeout: 248 seconds]
<Groogy>
ranges support going reverse right? I.e 64...0 right?
<oprypin>
Groogy, yes but not with that syntax .downto
Groogy has quit [Quit: WeeChat 2.0.1]
Groogy has joined #crystal-lang
<Groogy>
i.e the #each on range will always go upwards?
That_Guy_Anon has joined #crystal-lang
<oprypin>
no
<Groogy>
because doing large_number...smaller_number does seem to create a correct range object
heaven31415 has joined #crystal-lang
<oprypin>
Groogy, wait actually yeah, there are no ranges that have reverse order intrinsically
<heaven31415>
hello
<oprypin>
> the #each on range will always go upwards
<heaven31415>
merry christmas
<oprypin>
yes
<heaven31415>
everybody
<oprypin>
Groogy, when you say "correct" order it doesn't really mean much, all you can use it as is a pair of numbers, not any normal operations, cuz it's like an empty range
return0e has joined #crystal-lang
<Groogy>
yeah found a way to do what I wnated requiring less code anyway
<heaven31415>
if I have created a new branch in my fork and my PR from this branch was merged in origin, what should I do to synchronize my fork with origin? Can I just merge that new branch into my fork master branch?
<oprypin>
heaven31415, I recommend ignoring what github displays
<heaven31415>
im not even reading what githubs says
<Jenz>
Why would should i touch the lib folder after running shards install in the lib target?
<Jenz>
(In a makefile 'lib' target that depends on shard.yml and shard.lock)
<FromGitter>
<bew> @bararchy `s.accept?` ?
<FromGitter>
<bew> If not what's the error?
<FromGitter>
<bararchy> nah, I changed a bunch of stuff, it seems I need other params for bind, as ETHERNET uses mac addr and not IP addr. ⏎ Crystal socket interface isn't really dynemic, you step down to LibC quite fast
<Groogy>
been working specifically on making sure the tiles and the layers are rendered in correct order, that when you click it responds as you think etc.
<heaven31415_>
so it is going to be some sort of tile level editor?
<Groogy>
the tile is only the square on the top, but have hit test vertices you can't see that stretches all the way down to the next tile
<Groogy>
Management game but more perspective on divine powers I guess
<Groogy>
:P
<heaven31415_>
just making sure :P
<Groogy>
It's not the same but guess that would be the closest description. Both usually feature free agents that you have indirect control over
<Groogy>
though there are some god games with direct control as well
<heaven31415_>
and your is going to be?
<Groogy>
indirect
<Groogy>
more Dwarf Fortress meets Crest sort of
<Groogy>
currently porting most stuff from my C++ project and at the same time improving things and utilizing new stuff Crystal makes possible
<Groogy>
right now the game is just a simulation with groups of people gathering resources autonomously, crafting stuff and inventing new stuff to craft
<heaven31415_>
you left C++ for good or just creating this in Crystal as an experiment?
<Groogy>
Hahaha I can't leave C++ for good
<heaven31415_>
I know
<heaven31415_>
you are dev
<Groogy>
Well not only that but they do good things very opposite from each other
<Groogy>
and besides, Crystal still don't support Windows so
<heaven31415_>
Can you elaborate on those `good things` you mentioned?
<heaven31415_>
I really hate c++ standard lib, do you even use it in your work?
<Groogy>
Yeah only when your own standard library is missing a thing
<Groogy>
which is really rare nowdays
<heaven31415_>
so you have your own homebrew std?
<Groogy>
but our own library is compliant with the standard library so you can hook it easily in with anything the standard lbirary provides
<Groogy>
and vice versa
<Groogy>
yepp
<heaven31415_>
that's really nice
<heaven31415_>
and it is easier to use a bit than c++ std?
<Groogy>
But like one thing I do miss is being able to declare ownership, It's not a thing for Crystal or a feature crystal would benefit from
<heaven31415_>
I just love when people tell about "remove-erase" idiom
<Groogy>
but we have various tools for that in our library
<Groogy>
we mix remove and delete
<Groogy>
in some cases delete means remove, and sometimes we have methods called RemoveAndDelete
<heaven31415_>
isn't this sad?
<Groogy>
also if you go really deep into the history of the code, to the old nether parts nobody visits anymore
<Groogy>
we have functions like "GetPosition, GetActualPosition, GetPositionActually"
<Groogy>
and they all do different things
<heaven31415_>
jezus... XD
<heaven31415_>
the first 2 are okay
<heaven31415_>
but that third is really messed up
<heaven31415_>
maybe adding some offset
<heaven31415_>
or something
<Groogy>
Well we also have GetAbsolutePosition
<Groogy>
which is what I thought GetActualPosition gave you
<Groogy>
but it isn't
<Groogy>
code hygiene, it's a thing
<Groogy>
even on small projects
<heaven31415_>
and how well is it documented?
<heaven31415_>
Did you have to look through source code to figure it out or you had enough info in docs?
<Groogy>
no just didn't touch it D:
<Groogy>
code base is 15 years old so
<heaven31415_>
that is healthy
<Groogy>
Actually think there is a file from the previous engine that is as old as some of my coworkers
<heaven31415_>
so it can easily remember the days of no graphics hardware acceleration :P
<Groogy>
oh yeah previous engine had it's own software renderer
<heaven31415_>
can you imagine that in Box2D implementation it is still present there?
<heaven31415_>
I really don't why, when fpu hardware doesn't need software emulation anymore
<FromGitter>
<faustinoaq> @bew About the docker issue, I think crystal has already a pretty usable docker image, I didn't understand well what was his issue 😅
<FromGitter>
<faustinoaq> Seems they are using D-lang because part of their projects is already written in D, so, no problem with that 😉
Groogy has quit [Read error: Connection reset by peer]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #crystal-lang
<oprypin>
RX14, you mentioned casting method args to their type annotation. could that, in combination with more frequent type annotations, solve compile time problems?
<RX14>
Yes that was the idea
<oprypin>
it doesn't even seem hard to do
<RX14>
Exactly
<oprypin>
Number seems like a special case somehow
<RX14>
But ary says it is
<RX14>
And I'd rather trust him
<oprypin>
ok cool so we're screwed
<RX14>
Nah
<RX14>
Its still far easier than the other solutions