<FromGitter>
<alexdovzhanyn> hey guys i have a quick question
<FromGitter>
<alexdovzhanyn> ```HTTP::Params.from_hash({"access_token" => @access_token})``` ⏎ is throwing the error: ```undefined method 'from_hash' for HTTP::Params:Class```
<FromGitter>
<alexdovzhanyn> any ideas why?
<FromGitter>
<bew> it has been renamed to `encode`
<FromGitter>
<bew> on the 0.22.0 release (2017-04-20)
<FromGitter>
<alexdovzhanyn> ah! thank you. is there anywhere thats documented? looks like the docs im using are outdated
<FromGitter>
<alexdovzhanyn> ill be using em both extensively in the near future :D
<FromGitter>
<alexdovzhanyn> loving crystal so far. it combines the parts of ruby and elixir that i love
<FromGitter>
<bew> @faustinoaq about the new master docs, is it possible to focus the actual docs when you search for something, select, then hit enter? so that I can then just use page up/down, or the arrows to navigate in the docs (do you see what I mean?)
<FromGitter>
<bew> actually that works when you select a method, not a class name
<FromGitter>
<girng> @bew im using `hostname -i` to get the ip of the VPS. if i do `System.hostname` it returns the name. is there another System.xxx method we can use to get the ip, or using `hostname -i` ok?
<FromGitter>
<girng> can't i just stick the hostname - i into a global namespace to use whenever, instead of continuously calling \`hostname-i\`
<FromGitter>
<bew> huh `hostname -i` gives me my localhost IP
<FromGitter>
<girng> yeah, does it on my local machine too. but on vps it gives the real address
<FromGitter>
<girng> which is good for me
<FromGitter>
<bew> can you ping the vps through this ip (from your computer)?
<FromGitter>
<girng> yeah
<FromGitter>
<bew> weird ^^
<FromGitter>
<bew> where i your vps hosted? (which company)
<FromGitter>
<girng> woothosting.com
<FromGitter>
<girng> on my local machine on windows BASH, hostname -i returns 127.0.1.1 lol
<FromGitter>
<girng> would be nice if it was 127.0.0.1 -.-
ssvb has quit [Ping timeout: 250 seconds]
<FromGitter>
<girng> i wonder if there are any prebuild binaries for redis. why do we need to compile it on a vps, isn't itpackaged in debian?
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Client Quit]
Yxhuvud has joined #crystal-lang
txdv has quit [Ping timeout: 264 seconds]
txdv has joined #crystal-lang
jokke1 has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter>
<bararchy> oprypin thanks for the update, working for me now :)
rohitpaulk has joined #crystal-lang
marius has quit [Quit: baj]
marius has joined #crystal-lang
johndescs_ has joined #crystal-lang
johndescs has quit [Ping timeout: 260 seconds]
johndescs_ is now known as johndescs
rohitpaulk has quit [Ping timeout: 250 seconds]
rohitpaulk has joined #crystal-lang
kosmonaut has quit [Ping timeout: 240 seconds]
kosmonaut has joined #crystal-lang
<FromGitter>
<girng> there any benchmarks tools to test crystal tcp server?
Liothen has quit [Ping timeout: 276 seconds]
Liothen has joined #crystal-lang
Liothen has joined #crystal-lang
<FromGitter>
<aknaton> @girng Like general tools? Or tools written in crystal?
<FromGitter>
<girng> general tools i guess
olbat[m] has quit [*.net *.split]
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter>
<aknaton> @girng You can look at: http://www.kusa.ac.jp/~yukio-m/dbs/goal.html but if you are going to measure performance on your vps you may not have enough control of the environment to do so.
<FromGitter>
<girng> interesting, thanks i'll check it out. im just wanting to seehow many messages per seconds i can get on a relatively cheap VPS with a TCP server. before response times are too great, or starts to block all the fibers
<FromGitter>
<girng> got my game instance servers working/connecting to my master crystal server. really excited
<FromGitter>
<girng> created a nice service file in /etc/systemd/system. game instance server starts up automatically and just waits to connect to master server. all automated. once they connect, we are locked
<FromGitter>
<laginha87> I know it seems like I'm bashing the language but I am a huge fan of the project, the stuff I wrote about comes from a place of love :P
ua has quit [Quit: Leaving]
ua has joined #crystal-lang
<FromGitter>
<aknaton> @laginha87 Nice. Always fun to read blog posts.
fifr[m] has joined #crystal-lang
byteflame has joined #crystal-lang
braidn[m] has joined #crystal-lang
kp666[m] has joined #crystal-lang
Renich has joined #crystal-lang
cptaffe has joined #crystal-lang
kixune[m] has joined #crystal-lang
shAdOwArt has joined #crystal-lang
shAdOwArt has quit [Quit: Page closed]
<FromGitter>
<Qwerp-Derp> I implemented a parser for my library, Hedron!
<FromGitter>
<Qwerp-Derp> oprypin Well everything but the initial library itself is written natively
<FromGitter>
<Qwerp-Derp> As in the program other than the C binding is written natively in Crystal
<FromGitter>
<Qwerp-Derp> Bad choice of words :P
<oprypin>
ok that makes a little more sense
<FromGitter>
<Qwerp-Derp> A little...?
<oprypin>
vladfaust, the code sample does not help understand what you want to do, and makes no sense by itself, so maybe use a textual description
<FromGitter>
<vladfaust> @oprypin it expands to `ParamsTuple = NamedTuple( #<loc:push>begin #<loc:"/home/faust/Projects/prism/temp.cr",7,5>param(#<loc:"/home/faust/Projects/prism/temp.cr",7,11>:id, #<loc:"/home/faust/Projects/prism/temp.cr",7,16>Int32) end#<loc:pop> )`, which is not a valid code
<oprypin>
ok
<FromGitter>
<vladfaust> it doesn't like `begin`
<FromGitter>
<vladfaust> nevermind, noone is able to help me
<alexdovzhanyn>
is there any way to dynamically call an object method
<alexdovzhanyn>
like if i have a class that implements a method "foo"
<alexdovzhanyn>
can i do something like in ruby where you do ClassName.call(:foo) ?
<FromGitter>
<wrq> is that a rails method? I don't see that method for classes in 2.5
<alexdovzhanyn>
sorry, meant to say: ClassName.public_send(:foo)
<alexdovzhanyn>
its a dynamic dispatch
<alexdovzhanyn>
another way of doing it in ruby is ClassName.send(:foo)
<FromGitter>
<wrq> I dont know of a way to accomplish that in Crystal. generally that kind of reflection is discouraged. there's .responds_to and .try for objects, that's generally how I dispatch to an object if I dont know what methods it has for sure
<RX14>
.try isn't dispatch
<RX14>
thats for nil-checking
<alexdovzhanyn>
well, the thing is i know that this object will have this method, i just have another method that takes in a method name as a parameter and im trying to use that method name to dynamically dispatch to ClassName
<RX14>
well you can't do dynamic dispatch in crystal
<RX14>
we don't have send
<RX14>
we don't have eval
<alexdovzhanyn>
gotcha
<RX14>
what's the usecase?
<FromGitter>
<wrq> "discriminate" might've more accurately conveyed what I meant
<FromGitter>
<wrq> my bad
<RX14>
you can use macros, but you might be able to get away with not using macros
<alexdovzhanyn>
is that something that might be implemented in the future/is a desired feature? i can take a stab at implementation if so
<alexdovzhanyn>
one sec ill send a code snippet
<RX14>
no it won't be implemented in the future
<FromGitter>
<wrq> no, I think the lack of reflection is a great feature
<RX14>
crystal is a compiled statically typed language
<RX14>
the feature just isn't really possible
<FromGitter>
<wrq> god I can't even think of how many define_method monstrosities I've wrestled with
<FromGitter>
<wrq> its just gross
<alexdovzhanyn>
this isnt to dynamically define methods
<alexdovzhanyn>
just to dynamically call methods that have already been defined
<RX14>
we should really make URI params integrate better with HTTP::Params
<RX14>
it's ugly how you have to use strings to go between them
<alexdovzhanyn>
ahh great thanks
<alexdovzhanyn>
but for future reference
<alexdovzhanyn>
is there any way to do what im trying in crystal?
<RX14>
yes
<RX14>
actually no
<RX14>
because @method is an instance var
<RX14>
so no there's not
<RX14>
what you'd do in your case would be to consider the fact that there's limited methods you want to call
<RX14>
(put,get,etc)
<alexdovzhanyn>
is it something that would be desirable in the language or is it just a weird edge case thing?
<RX14>
and then just do a case @method
<RX14>
for each string call the method manually in the case block
<RX14>
it'd be ugly, but thats why we have HTTP::Client.exec
<RX14>
alexdovzhanyn, lets just say give me any example and there'll probably be a nice way to write it in crystal that doesn't need anything like send
<RX14>
so no, it's not *possible* in the language
<RX14>
it's abstually impossible to implement send
<RX14>
and so whether it's desirable is moot
<RX14>
I wouldn't want it
<alexdovzhanyn>
fair enough
<alexdovzhanyn>
that makes sense
<alexdovzhanyn>
thanks for the help!
<RX14>
there's a combination of things that replace send
<RX14>
macros, just doing a bit more copy and pasting, and alternatively just designing your code differently
<RX14>
the latter is the most important
<RX14>
thinking in a statically typed language is different to a dynamically typed one
<RX14>
and how you design and structure programs
<RX14>
crystal's closer than most languages but it's definitely not the same
Liothen has quit [Remote host closed the connection]
Liothen has joined #crystal-lang
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
alexdovzhanyn has quit [Ping timeout: 260 seconds]
<FromGitter>
<bararchy> @faustinoaq you can do similar work using SHAInet as it has a convolutional network , but you'll need to translate the results into the triangles :)
<FromGitter>
<faustinoaq> Oh, very nice 👍
<FromGitter>
<faustinoaq> @hugoabonizio Yeah 👍
<FromGitter>
<bararchy> But we defiantly need to bind OpenCV
<dragonkh>
hi - whats a safe and good way to represent money amount to 8 decimal places in Crystal - in Java would use BigDecimal - I see there is BigDecimal in Crystal too
<dragonkh>
but once I make a one how do I get the decimal places I want
<dragonkh>
I think I don't want to use a float to initialize
<FromGitter>
<bararchy> oprypin, do you activly develop something using crSFML? or was it just so that Crystal can have it?
<FromGitter>
<bararchy> Wanna join in with our project? (if you're into 2d rpg games)
<FromGitter>
<bararchy> were going to have 2 artists joining soon
<oprypin>
thanks, but i guess i can't
<oprypin>
well i'm also not into rpg
<FromGitter>
<bararchy> yeha I figured :) just wnated to help If I can
<FromGitter>
<bararchy> I just added "pick up items"
<FromGitter>
<bararchy> next "dialog windows"
<FromGitter>
<j8r> Living from a game is really ambitious - lots of concurence
<FromGitter>
<bararchy> oh, that's not the idea here
<FromGitter>
<bararchy> it's a fun project with friends
<FromGitter>
<bararchy> My wife and another great friend at aswome artists, and @artlinkov is also a good friend, so we joined forces to create a cool game on our spair time
sz0 has joined #crystal-lang
<alexdovzhanyn>
@bararchy looks pretty interesting... whats it about?
<FromGitter>
<bararchy> alexdovzhanyn well, It's going to be a 2d rpg, the setting is post-apocaliptic but not fallout everything is dead style, and more of shadowrun stuff are just changed and wierd style
<alexdovzhanyn>
is it currently runnable?
<FromGitter>
<bararchy> yeha, but theres not much in there right now, we are working on getting a hold of basic stuff like interactions, dialogs etc.. ⏎ you just need ot follow the instrcutions
<FromGitter>
<bararchy> if your'e interesting in joining in we will love to have anyone who is interested working on the game
<FromGitter>
<bararchy> I just added a "pickup item" which is really nice, I need to figure out how to put the text in a window
rohitpaulk has joined #crystal-lang
alexdovzhanyn has quit [Ping timeout: 240 seconds]
alexdovzhanyn has joined #crystal-lang
alexdovzhanyn has quit [Ping timeout: 240 seconds]
<FromGitter>
<hugoabonizio> @bararchy is this game open source? 😄
alexdovzhanyn has joined #crystal-lang
<FromGitter>
<girng> good afternoon!
alexdovzhanyn has quit [Ping timeout: 240 seconds]
<FromGitter>
<girng> @bararchy nice one. i finished item looting and dropping couple months ago
<FromGitter>
<girng> my inventory is 2d matrix based, like diablo. i had to follow a tetris javascript guide on how to implement it. i nevr used 2d matrix array before lol
<FromGitter>
<girng> i finally gotitworking however forcollision, very nice!
alexdovzhanyn has joined #crystal-lang
That_Guy_Anon has quit [Remote host closed the connection]
duane has quit [Ping timeout: 256 seconds]
alexdovzhanyn has quit [Quit: leaving]
txdv has quit [Ping timeout: 256 seconds]
<oprypin>
girng, back to the old keyboard i see
txdv has joined #crystal-lang
tilpner has quit [Ping timeout: 260 seconds]
chamar has quit [Remote host closed the connection]
chamar has joined #crystal-lang
jokke has quit [Ping timeout: 260 seconds]
jokke has joined #crystal-lang
dragonkh has quit [Ping timeout: 260 seconds]
<FromGitter>
<girng> @oprypin yep. i still have mechanical one and that $13 ebay one camelast week. however, the bottom keys are separated a bit to differently and it got annoying. i bought a wrist rest for my mechanical keyboard, but i got screwed over from ebay. the seller had it listed as a long horizontal gel-pad when i bought it, but what really was sent to me was a long horizontal plastic keyboard wrist rest, that has
<FromGitter>
... attachments to it (which don't even fit my mechanical keyboard..) so whatever. done with it all