<FromGitter>
<lukeholder> just playing with some ideas
<FromGitter>
<HCLarsen> Nice idea. It is a bit drab at the moment. I just hope that with the 1.0 release, the API pages will have links for previous releases, the way that Rails and Ruby do.
<FromGitter>
<imonmyown> @lukeholder I like how it looks :)
<FromGitter>
<lukeholder> @imonmyown the current site's design?
<FromGitter>
<bararchy> @lukeholder What do you think about the Gray\Black scheme they use now for the site?
alex`` has joined #crystal-lang
flaviodesousa has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
mark_66 has joined #crystal-lang
<FromGitter>
<lukeholder> @bararchy I like the logo, the reflective property. Definitely think the color scheme does not reflect the *fun* aspects of Crystal.
<FromGitter>
<lukeholder> Anyone here in the core team that could give blessing to a ongoing project for a redesign?
<FromGitter>
<bararchy> @mgarciaisaia ?
<FromGitter>
<lukeholder> I think it would really benefit Crystal. I would be happy to lead or be a part of a Crystal Visual Identity Team
<FromGitter>
<lukeholder> Just like Ruby, Crystal appeals to those software developers who appreciate a clean, fun, uncluttered syntax.
<FromGitter>
<lukeholder> The design should reflect that.
fiete has quit [Quit: WeeChat 1.9.1]
<FromGitter>
<imonmyown> I think the current design is not selling at all (unfortunately)
<FromGitter>
<imonmyown> And I don't mean marketing
<FromGitter>
<lukeholder> I agree @imonmyown - There are some good marketing messages, but the design lacks organizing and a 'uplifting' experience.
fiete has joined #crystal-lang
<FromGitter>
<imonmyown> @lukeholder I'm glad you helped others see that
<FromGitter>
<lukeholder> Early days, but hoping when some Crystal core leaders wake up and have look at the discussion above, they will agree.
<FromGitter>
<lukeholder> and we can get the ball rolling.
<FromGitter>
<bararchy> @lukeholder It's not the core-devs you need to talk with, it's the comunity manager and maybe @sdogruyol
<FromGitter>
<lukeholder> core leaders, not so much the devs, you are right. But having everyone express what's important to them, and all getting on the same page would be good.
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37 has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0]
<foxxx0>
so, i have a method with a return type restriction like this: Hash(Int32, Hash(Symbol, {Int64,Int64,Int64}))
<foxxx0>
inside that function, i initialize an object with that same type: particles = {} of Int32 => Hash(Symbol, {Int64,Int64,Int64})
<foxxx0>
and later return that "particles" object
<foxxx0>
yet somehow the compiler complains: type must be Hash(Int32, Hash(Symbol, Tuple(Int64, Int64, Int64))), not Array(Hash(Symbol, Tuple(Int64, Int64, Int64)))
<FromGitter>
<bararchy> Can't help wihtout seeing a code sample, but I would argue that there is something that changes the var on the way? or "might" change it? and it effect the type
<FromGitter>
<bew> use `input.each_with_index`, and remove the assignement to `particles`, as it overwrite the previous values
<foxxx0>
aah
<foxxx0>
right
<foxxx0>
hm, it seems my regexp modularisation is not working
<foxxx0>
it seems to be expanded correctly though... pp(PARTICLE): PARTICLE # => /(?<p>[-]*d+,[-]*d+,[-]*d+).*?(?<v>[-]*d+,[-]*d+,[-]*d+).*?(?<a>[-]*d+,[-]*d+,[-]*d+)/
<foxxx0>
ah
<foxxx0>
my VECTOR needs to be a true Regex as well, not just a string
<Papierkorb>
What kind of Enumerable(T) is Hash? (What's the T for Hash)
<foxxx0>
{K, V}
<Papierkorb>
Yes, in your case, what is K, V?
<foxxx0>
Int32, {Int32, Int32, Int32}
<Papierkorb>
Yes. Enumerable#count, what type does it use? T, K or V?
<foxxx0>
mh
<foxxx0>
thanks
<Papierkorb>
What solution are you thinking of?
<foxxx0>
Hash.values.count()
<Papierkorb>
Possible, but slow, as Hash#values creates an array, which you only #count on and then discard. You can use Hash#count in the yielding version
<Papierkorb>
It yields the key and the value, just ignore the key and compare the value
<foxxx0>
with &block?
<FromGitter>
<bararchy> Someone know about a CLI http client that support JS?
<foxxx0>
what I'm trying to do is some kind of !uniq, i.e. give me all K,V pairs whose values are NOT unique
<Papierkorb>
For #uniq! you could check how Array does it, and then adapt it
<foxxx0>
careful
<foxxx0>
not uniq!
<foxxx0>
i mean !uniq
<Papierkorb>
mh?
<foxxx0>
i.e. give me all K,V pairs whose values are NOT unique
<foxxx0>
i want to explicitly find duplicates
<Papierkorb>
you mean something like #not_uniq or #duplicates or #common_values
<foxxx0>
yes
<Papierkorb>
Well, you can still skim Array#uniq and just reverse the decision to keep/not keep
<Papierkorb>
Or actually, Enumerable#uniq, Arrays uniq may be special
<foxxx0>
there is no such thing as enumerable#uniq
<foxxx0>
i can only find array#uniq
<Papierkorb>
huh
ziprandom has joined #crystal-lang
<Papierkorb>
that could be added
<Papierkorb>
In Ruby, I would've used #group_by and then further #select and #map from there. In Crystal you can do the same, but I think I'd copy&modify #group_by to do all of those without building big immediate arrays
alex has joined #crystal-lang
alex has quit [Killed (adams.freenode.net (Nickname regained by services))]
Guest19292 has joined #crystal-lang
<FromGitter>
<yxhuvud> papierkorb: look above, and you see my solution to the same exercise as he is trying to solve :)
Guest19292 is now known as alex``
<Papierkorb>
The Tuple(..) could be an alias, but it looks like a vector, so I'd actually turn it into a struct (maybe through `record`)
ziprandom has quit [Remote host closed the connection]
<Papierkorb>
yxhuvud, also instead of `File.read(ARGV..)` you can use the global `ARGF` IO
<FromGitter>
<bararchy> Papierkorb do you plan on adding QTWeb ?
<Papierkorb>
QtWeb?
<FromGitter>
<bararchy> RX14 NICE !!! this is indeed a great day for crystal, at least we can now boost we "compile on windows"
<RX14>
please don't hype it up
<RX14>
until it's useful
<FromGitter>
<bararchy> Papierkorb QtWebKit
<RX14>
you'll just annoy people who are looking for something useful not just progress
<Papierkorb>
bararchy, I mean you could
<FromGitter>
<imonmyown> @RX14 that is indeed something anyway
<FromGitter>
<bararchy> RX14 i'm just happy it's moving on
<FromGitter>
<sdogruyol> @RX14 there's nothing wrong with hyping it up
<Papierkorb>
wasn't QtWebKit outdated and QtWebEngine only for QML stuff?
<Papierkorb>
Maybe they fixed this by now though
<RX14>
@sdogruyol yes there is, if you mislead people by doing it
<RX14>
hyping up "windows support is on it's way, here's concrete proof" is fine
<Papierkorb>
A bad experience now reflects into the future, both for the person using it and the person advocating *against* Crystal because of it
<FromGitter>
<sdogruyol> no
<RX14>
hyping up "crystal has windows support" with no caveats is absolutely not
<FromGitter>
<bararchy> "We added basic windows compilation support, hello world is working"
<FromGitter>
<sdogruyol> no one is saying that
<FromGitter>
<sdogruyol> @bararchy is just expressing his excitement..
<RX14>
yes but I can imagine people saying that
<RX14>
I see loads of people who blindly advocate crystal with sometimes misleading information
<RX14>
ok, one or two people
<RX14>
not loads thats hyperbole
<FromGitter>
<bararchy> XD
<FromGitter>
<sdogruyol> well, isn't that always a possibility with every feature? We can't force control everyone and stop them saying that
<RX14>
no but I can ask them to
<RX14>
which I just did
<FromGitter>
<bararchy> RX14 don't worry, we wont go to RUST forums saying you suck, we own
<RX14>
lol
<FromGitter>
<sdogruyol> lol
<FromGitter>
<sdogruyol> thanks for the effort @RX14
<FromGitter>
<sdogruyol> now I'M actually booting into my windows partition
<FromGitter>
<bararchy> Papierkorb anyway, isn't it part of the standard QT framework? I really need it as an engine to render JS for me
<FromGitter>
<sdogruyol> BRB :D
<Papierkorb>
bararchy, it's not part of the core modules, but it's part of the highest maintenance tier iirc
<FromGitter>
<bararchy> @sdogruyol taking the bullet for us all, *tip hat*
<RX14>
@sdogruyol i presule you have your old compiled gc.lib and pcre.lib from testing out @txe's branch
<RX14>
presume*
<RX14>
you'll need them
afraeim has joined #crystal-lang
<FromGitter>
<bararchy> RX14, would it be possible to add those files somehow that they can be staticlly linked when targeting windows?
<RX14>
what do you mean?
<RX14>
they are statically linked
<FromGitter>
<bararchy> I mean in the repo
<FromGitter>
<bararchy> or a script
<RX14>
i'll make a script to build them
<FromGitter>
<bararchy> ^ this
<FromGitter>
<bararchy> thanks :)
<FromGitter>
<bararchy> Papierkorb "highest maintenance tier" ? as in it costs to use? or just very complicated to use?
<Papierkorb>
Qt puts its modules in maintenance tiers. Nothing to do with cost (everything is free that you can directly DL), but how guaranteed to work it is
* FromGitter
* imonmyown feels like a holiday
<FromGitter>
<yxhuvud> foxxx0: I too had multiple particles with the same acceration, and my solution handles that.
<FromGitter>
<bararchy> Papierkorb so high means it's well maintained?
<Papierkorb>
it should almost always work, yes
<FromGitter>
<bararchy> cool
<FromGitter>
<bararchy> and will it be a "big deal" to add to current QT bindings?
<Papierkorb>
You should be fine by adding the necessary library to the configuration, and then adding the classes and enums you need
<Papierkorb>
Then regenerate and repeat until it doesn't complain about missing stuff
<RX14>
crystal docs doesn't work on the standard library because of the platform-specifics
<RX14>
you need to use make docs as @bew said
<foxxx0>
@bew thanks!
<foxxx0>
worked just fine
<FromGitter>
<bew> yw ;)
<foxxx0>
now i have it portable locally for the long train ride tomorrow :>
<crystal-gh>
[crystal] c910335 opened pull request #5419: fix array#sample with random (master...fix-array-sample-with-random) https://git.io/vbMdt
<FromGitter>
<lajunta> anyone knows that how to change field type before saving to database? because field type is always string , I want to change it to Int32.
flaviodesousa has quit [Ping timeout: 256 seconds]
<FromGitter>
<Fryguy> my guess is your are accessing an Array with `[]` instead of `[]?`
<FromGitter>
<Fryguy> but without the source/context it's hard to know for sure
<greenbigfrog>
nah. Just learned/realized that `crystal run` doesn't passthrough ARGV...
<FromGitter>
<Fryguy> if does, but you have to tack on an extra `--`
<FromGitter>
<Fryguy> crystal run foo.cr -- --arg1 --arg2
<greenbigfrog>
ah. ok. good to know
<FromGitter>
<Fryguy> otherwise the args get sent to the compiler itself and not your app
<FromGitter>
<Fryguy> you don't need the extra `--` if you crystal build first, then run the compiled executable
<greenbigfrog>
gonna PR it into crystal-by-example... that's what pops up quite far up on searches and where I found how ARGV works at all in crystal...
<greenbigfrog>
I'm getting `Error: execution of command failed with code: 1: `cc "${@}" -o '/root/discordtipbot/test' -rdynamic -lpcre -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`` when just simply having the following line in the file being built: `puts ARGV[0]`
<FromGitter>
<bew> what is the full error?
<greenbigfrog>
that's all
<FromGitter>
<bew> well, I don't see the error here, can you make a pastebin or sth?
<FromGitter>
<bew> there should be sth after the line with `cc`
<FromGitter>
<greenbigfrog> It's only that one line
<FromGitter>
<bew> hmm maybe the cache files are broken, you can locate your cache directory by doing `crystal env`, the line `CRYSTAL_CACHE_DIR` (for me its in `/home/lesell_b/.cache/crystal`). You can reset the cache by either removing this directory or removing its content
<FromGitter>
<sdogruyol> how about having a cache clear command for crystal command?
<FromGitter>
<sdogruyol> would that be helpful to anyone :P
<FromGitter>
<bew> there an issue about it iirc
<FromGitter>
<bew> not sure
<FromGitter>
<sdogruyol> oh, really?
<FromGitter>
<sdogruyol> haven't seen the issue
<FromGitter>
<bew> I remembered a discussion about it
<RX14>
we should really just fix the cache to always be consistent
<FromGitter>
<imonmyown> to me detecting corrupted cache doesn't appear simple at all
<FromGitter>
<imonmyown> or rather cache inconsistencies
<RX14>
solving them is simple:
<RX14>
only cache what compiles
<RX14>
the cache can only ever get corrupted when you kill the compiler while it's compiling
<RX14>
so the solution is just to compile to .new.o
<RX14>
then rename it to .o as soon as the module has actually beenc ompiled
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14>
since renaming is an atomic operation the cache will always be consistent
claudiuinberlin has joined #crystal-lang
<FromGitter>
<imonmyown> I should admit that I'm *a little* dense to implement that
claudiuinberlin has quit [Client Quit]
<RX14>
it's renaming 1 output file and adding a move call lol
<FromGitter>
<imonmyown> To me the trigger conditions are hard to get down to code
<FromGitter>
<imonmyown> sorry for being so dumb :)
<FromGitter>
<bew> don't be sorry @imonmyown it happens to everyone once, with time you'll get it ;)
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh>
[crystal] MakeNowJust opened pull request #5420: Parser: make an error on unbalanced end brace '}' in macro body (master...fix/crystal-parser/error-unbalanced-end-brace-in-macro) https://git.io/vbDlx
<FromGitter>
<imonmyown> @bew, thanks I appreciate your support :)
mark_66 has quit [Remote host closed the connection]
claudiuinberlin has joined #crystal-lang
<FromGitter>
<fridgerator> crystal should create its own cryptocurrency, written in crystal, to support the development of crystal
<RX14>
lol
<FromGitter>
<fridgerator> ;)
<oprypin>
as long as Manas runs the exchange from real currency (one way only, of course)
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
hightower2 has joined #crystal-lang
<Papierkorb>
I just noticed that because T{ x, y } == T.new << x << y you can write code like this: `self.layout = Qt::VBoxLayout{ @title, @stuff, @random_buttons }`- neat
<oprypin>
holy crab
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
<RX14>
yeah there's some interesting unused syntax crystal has
<RX14>
Type{} is used for sets but there's Type{} for hashes too
<RX14>
which is how i've always said hashes should be created
<RX14>
not {} of K => V, Hash(K, V) {} or just Hash(K, V).new
<oprypin>
definitely
<FromGitter>
<vectorselector> hello, world! I'm suddenly (as in literally in a span of 1 minute to the next with no code change, just a stop and start of "crystal run src/myapp.cr") ⏎ seeing weird errors compiling. ⏎ ⏎ First it will complain about a require for mongo- particularly it's gridfs module, complaining that IO is a class not a module, and when the require for that module gets commented out, the next error compiling
<FromGitter>
<vectorselector> i have ⏎ require "secure_random" ⏎ and it's part of the crystal library and literally was working fine but then suddenly stopped working today. I'm curious if some path got messed up and how require knows where the crystal library stuff is.
<Papierkorb>
vectorselector, sounds like you upgraded from crystal 0.23.1 to 0.24.x
<Papierkorb>
Quite a few (more than usual iirc) breaking changes that actually do break existing code, like there
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb>
vectorselector, Either port the code over to the new version (makes sense on the long-run), but if you just want it to work now, stick to 0.23.1 until you have time to port
<Papierkorb>
Or until the shard maintainers did it
<FromGitter>
<vectorselector> !ah ha, thank you. ⏎ it makes sense. ⏎ do docs generally get updated at the same time as version releases?
<oprypin>
vectorselector, yes but lately the process has been sloppy
<Papierkorb>
The online docs will be updated for the 'real release' of 0.24.1, the 0.24.0 is actually a pre-release (That scheme will be fixed for 0.25.x)
<greenbigfrog>
anyone got an idea why I'm getting connection refused all the time?
p0p0pr37 has quit [Read error: Connection reset by peer]
<FromGitter>
<straight-shoota> greenbigfrog, are you using mac os?
<greenbigfrog>
debian
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
p0p0pr37 has quit [Changing host]
<FromGitter>
<vectorselector> @Papierkorb thanks for the info, I was able to downgrade via my package manager pacman, I wonder if it's possible to always obtain specific crystal source/binaries/packages such that we can always run an old app on it's given crystal version? (besides package-manager whims...)
<oprypin>
pretty much "no"
<oprypin>
if you're very lucky, the packages will specify the crystal version and dependencies exact version
<FromGitter>
<ezrast> @greenbigfrog are you sure Postgres is listening on 127.0.0.1? IIRC postgres uses UNIX domain sockets by default but I may be misremembering.
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 248 seconds]
<greenbigfrog>
ezrast: good point... might be the case, even if it's localhost
vivus has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
vivus has left #crystal-lang ["Leaving"]
<FromGitter>
<edwardloveall> I was trying to print out `ENV.inspect` with PrettyPrint, but all it seems to do is print out an escaped version
<FromGitter>
<edwardloveall> am I using PrettyPrint wrong?
<FromGitter>
<faustinoaq> Wow, I din't know about `/usr/share/doc/crystal/api/index.html`, maybe we can add a link for that, maybe inside `man crystal`?