<FromGitter>
<girng> I was thinking about getting a raspPI, new ones cna have up 4gb ram
<rkeene>
rvprasad, So link it on the same system you compiled it on ?
<rkeene>
Also, this bug report doesn't really rely on being cross-compiled as far as I can tell
alex`` has quit [Ping timeout: 244 seconds]
alex`` has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter>
<girng> is it dangerous to allow messages to be sent through telnet without escape them on the server?
<FromGitter>
<girng> if you a private messaging another user
<FromGitter>
<tenebrousedge> why are you using telnet?
<FromGitter>
<girng> i'm building a crystal chat server 5000, it works best on telnet
<FromGitter>
<tenebrousedge> telnet is better than xmpp?
<FromGitter>
<girng> no idea, lol
<FromGitter>
<girng> for example, my server can use crystal's `.colorize(:green)` and it'll show up in green text on the client
<FromGitter>
<girng> and i allow users to send messages toe ach other, or in a chat room.. so i'm sure they could send ansci escape sequence codes
<FromGitter>
<girng> i wonder if there is a method or way to filter out that in my private_message method. filter all possible naughty input that could cause harm on another user's telnet client
<FromGitter>
<girng> or, if they are using a console to connect, or whatever. doesn't technically have to be through telnet
<FromGitter>
<absolutejam_gitlab> I'm using `fork = Process.fork` then a `while` loop in the foreground to iterate over the stdout/stderr
<FromGitter>
<absolutejam_gitlab> I can see when it terminates with `fork.terminated?` but I dunno how to get the status code. I can get it within the block though
<FromGitter>
<absolutejam_gitlab> this is super frustrating, haha. I want to run a command asynchronously but also be able to poll for the exit code
<FromGitter>
<absolutejam_gitlab> If I do `Process.new`, it creates a new process but doesn't return the process. If I then do `wait`, my foreground is blocked.
DTZUZO has quit [Ping timeout: 248 seconds]
<FromGitter>
<asterite> I think you need to use spawn. Then when the process finishes you send something over a channel. On the other side you receive from that channel.
<FromGitter>
<absolutejam_gitlab> I was going to look at that, but I thought it might not release the event loop
<FromGitter>
<absolutejam_gitlab> I think I have it now htough
<FromGitter>
<absolutejam_gitlab> `process = Process.new(...)` then `while Process.exists? process.pid`
<FromGitter>
<absolutejam_gitlab> Not sure about exit code though
<FromGitter>
<absolutejam_gitlab> Once I get it figured I might add a forums post or issue about it, to see if it perhaps needs cleaning up as a higher level API
<FromGitter>
<absolutejam_gitlab> or maybe just a shard
<FromGitter>
<absolutejam_gitlab> any clever ways of tailing this `IO::Memory` besides `to_a` and diffing?
<FromGitter>
<absolutejam_gitlab> at the minute (for testing), I'm just `put`ting it over and over
<absolutejam1>
looks like I can play with `pos`
<FromGitter>
<absolutejam_gitlab> Sweet, tracking the `pos`, I can tail the stderr and stdout, and it even works when the process I'm calling updates its progress
alex`` has joined #crystal-lang
sagax has quit [Ping timeout: 258 seconds]
alex``` has joined #crystal-lang
alex`` has quit [Ping timeout: 248 seconds]
<FromGitter>
<absolutejam_gitlab> how can I stop an include, erm, including?
<FromGitter>
<absolutejam_gitlab> But seriously, there's no `except` like Elixir.
<FromGitter>
<absolutejam_gitlab> If I `include Foo` it also includes `Foo::Bar`
<FromGitter>
<absolutejam_gitlab> Which makes sense
<FromGitter>
<absolutejam_gitlab> but I would like to control it a ittle
<FromGitter>
<j8r> Following the end of an IO is fairly simple, you can copy-paste the code too
<FromGitter>
<absolutejam_gitlab> thanks
<FromGitter>
<absolutejam_gitlab> yeah, wasn't too hard
<FromGitter>
<absolutejam_gitlab> `Process` was harder as it looks there are some higher level APIs ready to use, but they all seemed like 80% of what I wanted
<ht_>
Probably a questions that has been asked before, but how can I include a license message on top of each file without it showing up in the generated documentation?
<ht_>
The documentation about the documentation generation does not seem to tell
absolutejam4 has joined #crystal-lang
absolutejam4 has quit [Ping timeout: 245 seconds]
<absolutejam1>
there's a `:nodoc:`
<absolutejam1>
but I think that's only for functions
<absolutejam1>
is the license getting merged with the module docs?
<ht_>
It is, yes
<ht_>
:w
alex``` has quit [Ping timeout: 246 seconds]
<ht_>
But I do see that it is not copied in the definition of the classes
<ht_>
So that is good
<ht_>
Maybe I can mark the section as "license", then it does not look so out-of-place
<ht_>
But I also seem unable to create markdown sections. Using `## title` or `== title` does not work?
<FromGitter>
<meltheadorable> Can you not just put a blank line between the license declaration and the start of the module documentation block?
<ht_>
I'll try
<ht_>
That works!
<ht_>
Thanks meltheadorable
<FromGitter>
<j8r> @absolutejam_gitlab yes the `Process` API isn't very user-friendly :/
ua has quit [Read error: Connection reset by peer]
ua has joined #crystal-lang
<FromGitter>
<asterite> strange, we designed it to be user-friendly
<absolutejam1>
it's pretty much there. I mean, I managed to make it work
<absolutejam1>
I don't want to sound like I'm complaining; there are just some rough edges and inconsistencies
<FromGitter>
<asterite> it's fine. It's just that I'd like to see a condensed summary of problems people have. There's https://forum.crystal-lang.org/t/improve-process-api/579 but it seems the main complaint is not knowing whether it's blocking or async. The answer is `Process.new` creates a process. `Process.run` runs a process (which means it must finish). Then you can do `Process.new ... wait` to create a process and wait for it.
<FromGitter>
... Plus it's documented. Then to capture output you pass an `IO::Memory` to the `output` argument. Always a like of code: `Process.run(..., output: my_output)`.
<FromGitter>
<asterite> What I mean is, I'd like to see a concrete proposal (working code) that it objectively better
<FromGitter>
<absolutejam_gitlab> My gripes were the fact that some return a process, some return a process.status and there didn't seem to be an obvious way to create an async process then get a callback or check if it's alive/finished
<FromGitter>
<absolutejam_gitlab> I'll see if I can throw something together
<FromGitter>
<asterite> what are you using `stdout_progress` for?
<FromGitter>
<asterite> also, it seems you want to redirect the process' output and error to stdout and stderr?
<FromGitter>
<asterite> If that's the case then you can just do `Process.run("docker-compose #{args}", shell: true, output: :inherit, error: :inerit)`
<absolutejam1>
to keep track of how much of the stdout/stderr log I have printed
<absolutejam1>
I also wanted to save it though
<absolutejam1>
In case I need to regex over the output
<absolutejam1>
as docker-compose uses stderr for informational messages, so I can't just rely on it for showing errors
<absolutejam1>
but that's a different gripe for a different project...
<FromGitter>
<asterite> I think that's something hard to do and there's no generic process API that can give you progress over output... or well, if we do that then it won't be a generic process API (it seems like a pretty specific use case)
<absolutejam1>
That's fair enough
<absolutejam1>
It wasn't the tailing stderr/stdout specifically
<absolutejam1>
I understand that you give the means as you can pass those in as args
absolutejam4 has joined #crystal-lang
<absolutejam1>
My issues were just the fact that all `new`, `fork`, `run` all differ just enough to make them feel insconsistent. Maybe just some docs to clear some things up, such as redirecting stdout form a forked process won't work
<absolutejam1>
which makes total sense when you think of it
<absolutejam1>
Maybe they should all return a Process and that has a `status` (Process::Status) property, instead of some returning a status, others a process
absolutejam4 has quit [Ping timeout: 258 seconds]
dingenskirchen has quit [Read error: Connection reset by peer]
dingenskirchen has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<girng> @watzon coolest thing is
<FromGitter>
<asterite> I don't think you need fork because Process.new already forks
<FromGitter>
<asterite> but you would need to use spawn
<FromGitter>
<girng> ```code paste, see link``` β β You can literally do socket.read_line, inside of another socket.read_line, so you can capture that input, then decide if you want to continue execution of that method, or return. I'm going to use this for my captcha system when users do /register nick password. [https://gitter.im/crystal-lang/crystal?at=5d35b9ff808425671ccabbfd]
<FromGitter>
<girng> Once they run the register command, they can only continue execution of that command if their answer is correct. Very neat.
<FromGitter>
<girng> This basically gives off the feeling that the developer/user is inside another method "interacting with it", while in telnet. Adds a bit of UX
<absolutejam1>
make sure that it's nothing sensitive
<absolutejam1>
over telnet
absolutejam4 has joined #crystal-lang
absolutejam4 has quit [Ping timeout: 258 seconds]
sagax has joined #crystal-lang
duane has joined #crystal-lang
<FromGitter>
<asterite> maybe Process needs a few more convenience methods for common use cases
<FromGitter>
<girng> @absolutejam_gitlab just passwords π
<rkeene>
Passwords have been illegal since 2004
<FromGitter>
<girng> LOL
<rkeene>
Hmm ?
<FromGitter>
<girng> were you serious or just joking lol
<FromGitter>
<tenebrousedge> so angular momentum is quantized, but linear momentum isn't, but is there actually any such thing as linear momentum?
<rkeene>
President George W. Bush issued Homeland Security Presidential Directive 12 in August of 2004, which made passwords illegal
<FromGitter>
<girng> wait what really
<FromGitter>
<girng> @tenebrousedge sounds like quantum physics shenanigans i h ave no idea sorry
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<meltheadorable> @absolutejam_gitlab this is the other thing I would have thought to try, using `of` syntax: `{} of Symbol => ({} of Symbol => String)` but it also does not work
laaron has quit [Remote host closed the connection]
<FromGitter>
<Blacksmoke16> for nested stuff easiest to do what @absolutejam_gitlab did
<FromGitter>
<Blacksmoke16> can also make it an alias then do `MyAlias.new`
<FromGitter>
<girng> i like aliases
absolutejam4 has joined #crystal-lang
absolutejam4 has quit [Ping timeout: 244 seconds]
<FromGitter>
<rishavs> Any chance that there is someone from Microsoft here in the chat? :D
alex``` has joined #crystal-lang
<FromGitter>
<mwlang> Why? Are about to bash 'em harshly? π
<jokke>
hey yall. I've been working on this little shard for the last few days. If it looks useful to you, try it out and give me feedback! It relies heavily on macros so it's good to test out all corner cases. I tried writing quite extensive specs but you never know. https://gitlab.com/repomaa/mass_assignable
sorcus has quit [Ping timeout: 250 seconds]
<FromGitter>
<rishavs> @mwlang lol no. I work at MS and I am trying to set up a group of MS folks who like Crystal.
<FromGitter>
<rishavs> So far my group channels have been empty and I have no idea how should I reach out to folks
<FromGitter>
<Blacksmoke16> *company wide email*
<FromGitter>
<rishavs> too scared to send that!
<FromGitter>
<rishavs> > .>
<FromGitter>
<Blacksmoke16> make sure Mr Gates gets it too π
absolutejam4 has joined #crystal-lang
<FromGitter>
<tenebrousedge> @rishavs maybe a work group isn't the best way to go. maybe start a group on meetup.com, or do a presentation at a tech meetup/conference
<FromGitter>
<rishavs> I want it to be MS specific. If we get some members, I want to evangelize Crystal from within
<FromGitter>
<tenebrousedge> why MS specific?
<FromGitter>
<rishavs> I work at MS. :)
<FromGitter>
<tenebrousedge> so?
<FromGitter>
<rishavs> well, the plan is to evangelize Crystal in MS. In the hope of attracting some great engineering folks
<FromGitter>
<rishavs> We have groups evangelizing other languages like Rust
<FromGitter>
<tenebrousedge> evangelizing Crystal is one problem that you can solve, that other people might be able to help you with. Navigating MS office politics is another problem that we don't have insight into
<FromGitter>
<rishavs> Oh I know that ! Don;t need help navigating MS politics. :D β I was just asking if there's anyone from MS here
<FromGitter>
<rishavs> I havent been able to find any crystal users using internal office channels
<FromGitter>
<tenebrousedge> well good luck
<FromGitter>
<rishavs> My actual nefarious plan is to rope in someone super good for the Windows Thanks :)
absolutejam4 has quit [Ping timeout: 245 seconds]
<FromGitter>
<peterschols> Hi, I'm currently using Atom for Crystal development and looking into switching to VS Code. VS Code looks good, but I can't seem to find a way to let VS Code highlight opening tags when I'm on the closing line, or vice versa. For example, when I select `end` it would be great to have the corresponding `def method_name` or `if condition`highlighted, as is the case in Atom. β Anyone got this to work in VS
<FromGitter>
<girng> although, if it's possible to do it without messing with the plugin, maybe vscode community can help as well.
<FromGitter>
<watzon> It would be a nice thing to have in the plugin
<FromGitter>
<watzon> Another nice thing to have would be what they do with the Flutter plugin, adding a faux comment after each end block that says what class, module, or method the end block is ending
<FromGitter>
<girng> I use socket.read_bytes for my gameserver, but for this little telnet chat server project, i'm using socket.read_line cause it works the best with it
sorcus has joined #crystal-lang
sorcus has quit [Ping timeout: 252 seconds]
duane has quit [Ping timeout: 244 seconds]
<FromGitter>
<girng> f it, if anyone wants to dos a $5/yr vps go for it
lucasb has joined #crystal-lang
ht_ has quit [Quit: ht_]
<FromGitter>
<meltheadorable> sending all the data cleartext over the wire seems like a bigger problem than whatever youβre trying to prevent with the captcha in terms of security, seems like weird priorities
<FromGitter>
<girng> how else do you send data over the wire to work with telnet without it being "cleartext"?
<FromGitter>
<tenebrousedge> telnet is not a secure protocol, so the secure way of using it would be to not use it
<FromGitter>
<meltheadorable> p. much that
<FromGitter>
<watzon> @girng end to end encryption
<FromGitter>
<girng> SSH?
<FromGitter>
<tenebrousedge> I mean, I would just write an XMPP server
<FromGitter>
<j8r> @asterite I was proposing to only keep the async version, then using `&.wait` to block it. β Another thing is `output, error = Process.new` for easy output/error, inspired by Go and Python
<FromGitter>
<j8r> `Process.sync` and `Process.async` is also a good idea
<FromGitter>
<watzon> I like the idea of `output, error = Process.new`
<FromGitter>
<tenebrousedge> it makes a lot of sense, but golang was mentioned so I am π¦
<FromGitter>
<watzon> I found myself wishing recently that IO had an event listener of sorts
<FromGitter>
<watzon> So that you could perform an action when new data was written to the IO
<FromGitter>
<watzon> Rather than having to loop
<FromGitter>
<tenebrousedge> π
<FromGitter>
<meltheadorable> i would not implement XMPP because it feels ancient & I think contemporary apps need a higher functionality baseline, rather than hoping clients and servers will actually support the right collection of extensions, but that also rules out telnet
<FromGitter>
<watzon> I agree. Anything with XML would be off the table for me
<FromGitter>
<tenebrousedge> what's the alternative?
alex``` has quit [Ping timeout: 244 seconds]
absolutejam4 has quit [Ping timeout: 246 seconds]
absolutejam4 has joined #crystal-lang
absolutejam4 has quit [Ping timeout: 245 seconds]
<FromGitter>
<tenebrousedge> anyone?
<FromGitter>
<watzon> Matrix?
<FromGitter>
<tenebrousedge> kk
<FromGitter>
<bajro17> if I type crystal lang on yt and click to sort be upload date last video is before 3 months :(