jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.1 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
harisamin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Sadin has joined #crystal-lang
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
willlll has quit [Client Quit]
bcardiff has joined #crystal-lang
Cidan is now known as zz_Cidan
datanoise has quit [Ping timeout: 272 seconds]
CraigBuchek has quit [Quit: Leaving.]
waterlink1 has joined #crystal-lang
waterlink has quit [Ping timeout: 256 seconds]
DerisiveLogic has quit [Ping timeout: 256 seconds]
datanoise has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
Sadin has quit [Ping timeout: 276 seconds]
jeromegn has joined #crystal-lang
shama has quit [Remote host closed the connection]
ponga has joined #crystal-lang
kulelu88 has left #crystal-lang ["Leaving"]
zz_Cidan is now known as Cidan
ponga has quit [Quit: Leaving...]
willlll has joined #crystal-lang
<Dreamer3> i thought of throwing together REPL the other day
<Dreamer3> probably not an easy thing to do though
willlll has quit [Quit: willlll]
<strcmp1> repls are the envy of compiled languages :p
willlll has joined #crystal-lang
endou_ has joined #crystal-lang
Guest24033 has joined #crystal-lang
orliesaurus has quit [*.net *.split]
endou has quit [*.net *.split]
notfowl- has quit [Excess Flood]
notfowl has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
unshadow_ has quit [Ping timeout: 252 seconds]
DerisiveLogic has quit [Read error: Connection reset by peer]
DerisiveLogic has joined #crystal-lang
JBat has joined #crystal-lang
notfowl has quit [Excess Flood]
notfowl has joined #crystal-lang
notfowl has quit [Excess Flood]
notfowl has joined #crystal-lang
Ven has joined #crystal-lang
BlaXpirit has joined #crystal-lang
unshadow has joined #crystal-lang
datanoise has quit [Ping timeout: 272 seconds]
unshadow_ has joined #crystal-lang
<unshadow_> >> a = []
<DeBot> unshadow_: Syntax error in eval:3: for empty arrays use '[] of ElementType'
<unshadow_> what does that means ?
Ven has quit [Ping timeout: 276 seconds]
<BlaXpirit> unshadow_, arrays have a type associated with them
<BlaXpirit> when you write [5] it knows it's an array of int
<BlaXpirit> but what is [] ?
<unshadow_> an empty array
<unshadow_> that I can populate later on
<BlaXpirit> there is no such thing
<BlaXpirit> as "just" an array
<BlaXpirit> why am i bothering
<BlaXpirit> it's in the doc
<unshadow_> Looking now
<unshadow_> thanks for bothering
<unshadow_> >> a = Array(Int32).new
<DeBot> unshadow_: []
<unshadow_> >> a = Array(Int32).new || << 100*'a'
<DeBot> unshadow_: Syntax error in eval:3: unexpected token: <<
<unshadow_> >> a = Array(Int32).new; a << 100*'a'
<DeBot> unshadow_: Error in line 3: no overload matches 'Int32#*' with types Char
willlll has quit [Quit: willlll]
<unshadow_> >> a = Array(Int32).new; a << 100*1
<DeBot> unshadow_: [100]
<unshadow_> >> a = [] of Int32
<DeBot> unshadow_: []
<unshadow_> ok got it :)
<unshadow_> >> a = Array(Char).new; a << 10*'a'
<DeBot> unshadow_: Error in line 3: no overload matches 'Int32#*' with types Char
<unshadow_> >> a = Array(Char).new; a << 'a'
<DeBot> unshadow_: ['a']
<notfowl> >> [] of Char
<DeBot> notfowl: []
<unshadow_> >> a = [['a'], ['b']]
<DeBot> unshadow_: [['a'], ['b']]
<unshadow_> >> a = [['a'], ['b']]; a[1]
<DeBot> unshadow_: ['b']
Ven has joined #crystal-lang
<unshadow_> >> a = [['a'], ['b']]; a.include?('b')
<DeBot> unshadow_: Error in line 3: undefined method 'include?' for Array(Array(Char)) (did you mean 'includes?'?)
<unshadow_> >> a = [['a'], ['b']]; a.includes?('b')
<DeBot> unshadow_: false
<unshadow_> >> a = [['a'], ['b']]; a.includes?(['b'])
<DeBot> unshadow_: true
datanoise has joined #crystal-lang
<unshadow_> Is there a way to tell crystal to use multiple cores in comipling ? (like make -j option) ?
datanoise has quit [Ping timeout: 272 seconds]
notfowl has quit [Excess Flood]
notfowl has joined #crystal-lang
Guest24033 is now known as orliesaurus
Cidan is now known as zz_Cidan
<jhass> unshadow_: mh, maybe really write PMs to the bot ;)
<unshadow_> haha yeha ... sorry :(
havenwood has quit [Ping timeout: 246 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<unshadow_> jhass, I think i broke the bot...
<unshadow_> >> puts "hi"
DeBot has quit [Ping timeout: 272 seconds]
DeBot has joined #crystal-lang
<jhass> weird, something crashed the socket
<unshadow_> I think I found a bug, I'll try to recreate for a sec
<unshadow_> Socket crashed again right ?
<unshadow_> >> puts "hi"
<unshadow_> yeha ..
<unshadow_> It comes from crystal compiler, it handles big array appends very poorly it seems
leafybasil has quit [Remote host closed the connection]
<unshadow_> Yeha, I can see you answered the bug I opend about it, I'll stop sending large arrays to the bot, sorry
DeBot has quit [Ping timeout: 272 seconds]
<jhass> meh, it's my fault for not limiting the memory I guess
DerisiveLogic has quit [Remote host closed the connection]
DeBot has joined #crystal-lang
<jhass> unshadow_: try one more time
<jhass> >> "hi"
<DeBot> jhass: "hi"
DerisiveLogic has joined #crystal-lang
datanoise has joined #crystal-lang
<unshadow_> >> puts "hi"
<DeBot> unshadow_: hi
<unshadow_> you want me to try the prablomatic command ?
_whitelogger has joined #crystal-lang
<jhass> yes
kgadek has joined #crystal-lang
<unshadow_> >> puts "hi"
<unshadow_> crashed again ?
Liothen has quit [Ping timeout: 240 seconds]
datanoise has quit [Ping timeout: 258 seconds]
_whitelogger has quit [Excess Flood]
_whitelogger has joined #crystal-lang
unshadow has quit [Ping timeout: 256 seconds]
DeBot has quit [Ping timeout: 272 seconds]
unshadow has joined #crystal-lang
Ven has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 276 seconds]
Netfeed has joined #crystal-lang
Netfeed has quit [Changing host]
<jhass> mh, yeah
DeBot has joined #crystal-lang
<unshadow_> jhass, are you running it inside a container ?
<jhass> sure
<jhass> looks like the amount of output is what's causing trouble
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<unshadow_> maybe filter for *.times and see that it's not above 100 or 1000
<jhass> nah, that would be cosmetic
leafybasil has joined #crystal-lang
<jhass> >> "a"*100000
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
<jhass> >> "hi"
<DeBot> jhass: "hi"
<jhass> >> "a"*100000
<DeBot> jhass: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ...
<jhass> looks like it doesn't trigger playpens timeout :/
<DeBot> jhass: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ...
<unshadow_> a = 'a'; b = [] of Char; 100000.times do {b << a} end; c = [] of Array; 100000.times do {c << b} end; puts c
<jhass> yeah, the a's came because I killed the process
<unshadow_> Oh
Ven has joined #crystal-lang
<jhass> haha, happens on 32bit only
<jhass> interesting how the 32bit only bugs start to increase nowadays
<unshadow_> are you upgrading to 64 ?
<jhass> the VM? no
<unshadow_> no one ever checks 32 bit anymore hahah
waterlink has joined #crystal-lang
<unshadow_> jhass, I think i can baypass the systems security and write a file
<jhass> writing a file is not a security issue
<jhass> come back if you can write a file outside /tmp and /home/ ;)
<unshadow_> intresting :) I'll try now
waterlink1 has quit [Ping timeout: 265 seconds]
<jhass> but even then, you didn't write anything to the host
bcardiff has joined #crystal-lang
datanoise has joined #crystal-lang
<unshadow_> I'm getting this error: "in /usr/lib/crystal/event/event.cr:66: field 'tv_sec' of struct LibC::TimeVal has type Int32, not Int64"
ddfreyne has quit [Quit: leaving]
ddfreyne has joined #crystal-lang
<ddfreyne> buffer -1
<jhass> unshadow_: yeah, sleep is broken on 32bit atm
<unshadow_> Also "file" ? in /usr/lib/crystal/file.cr:24: undefined method 'length' for Char
<ddfreyne> Oops.
datanoise has quit [Ping timeout: 265 seconds]
<jhass> >> File.open("foo", 'w')
<DeBot> jhass: in /usr/lib/crystal/file.cr:24: undefined method 'length' for Char
<jhass> >> File.open("foo", "w")
<DeBot> jhass: #<File:0x9F1CFC8 @fd=6, @event=nil, @readers=nil, @writers=nil, @closed=false, @path="foo">
<jhass> PRs welcome
ddfreyne has quit [Remote host closed the connection]
ddfreyne has joined #crystal-lang
<unshadow_> >>%x(touch /tmp/bar.test); file = Dir.glob("/tmp/*")[1]; %x(echo "#!/bin/bash\r\ntouch /var/log/test.log\r\n" >> #{file}); system("/bin/bash file"); a = Dir.glob("/var/log/*"); p a
<DeBot> unshadow_: /usr/bin/file: /usr/bin/file: cannot execute binary file
<unshadow_> >>%x(touch /tmp/bar.test); file = Dir.glob("/tmp/*")[0]; %x(echo "#!/bin/bash\r\ntouch /var/log/test.log\r\n" >> #{file}); system("/bin/bash file"); a = Dir.glob("/var/log/*"); p a
<DeBot> unshadow_: /usr/bin/file: /usr/bin/file: cannot execute binary file
HakanD has joined #crystal-lang
<jhass> >> File.write("/var/log/test.log", "1")
<DeBot> jhass: Errno: Error opening file '/var/log/test.log' with mode 'w': Read-only file system
<jhass> that's all you try to do, in a convoluted way ;)
<unshadow_> wait wait, I'll figure something hahah
<unshadow_> maybe ....
<jhass> >> system("df -T /home/crystal")
<DeBot> jhass: Filesystem Type 1K-blocks Used Available Use% Mounted on
<jhass> >> `df -T /home/crystal`.lines.last
<DeBot> jhass: "none tmpfs 1034064 692 1033372 1% /home/crystal"
<jhass> just fyi ;)
<unshadow_> >> a = system("df -T /home/crystal"); p a
<DeBot> unshadow_: Filesystem Type 1K-blocks Used Available Use% Mounted on
<unshadow_> >> a = %x(df -T /home/crystal); p a
<DeBot> unshadow_: "Filesystem Type 1K-blocks Used Available Use% Mounted on\nnone tmpfs 1034064 668 1033396 1% /home/crystal\n"
<unshadow_> Damn...
<unshadow_> Trying to compile GHOST vunrabilty exploit via 1 liner is hard..
waterlink has quit [Quit: Leaving.]
waterlink1 has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
lokulin has joined #crystal-lang
HakanD_ has joined #crystal-lang
HakanD has quit [Read error: Connection reset by peer]
jeromegn has joined #crystal-lang
leafybas_ has joined #crystal-lang
leafybasil has quit [Ping timeout: 256 seconds]
<lokulin> >> "word word".split /\b/
<DeBot> lokulin: ["word", " ", "word"]
<lokulin> >> "foo".match(/(foo|bar)/)[0]
<DeBot> lokulin: Error in line 3: undefined method '[]' for Nil
<lokulin> >> "foo".match(/(foo|bar)/)
<DeBot> lokulin: #<MatchData "foo" 1:"foo">
<jhass> match may return nil so [0] chokes
<jhass> >> "foo".match(/foo|bar/).try &.[0]
<DeBot> jhass: "foo"
<lokulin> thanks
<lokulin> trying to convert a little toy Ruby project to Crystal..so far so good. :-)
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HakanD_ has quit [Quit: Be back later ...]
HakanD_ has joined #crystal-lang
<unshadow_> jhass, how can I check running thread ? I see that Thread.current is not avilable
<jhass> then you probably have to implement it ;)
<unshadow_> that could be cool, do I need to do it in C ?
<unshadow_> >> LibPThread.current
<DeBot> unshadow_: Error in line 3: undefined fun 'current' for LibPThread
<unshadow_> >> LibPThread.self
<DeBot> unshadow_: Error in line 3: undefined fun 'self' for LibPThread
<lokulin> Really cool project guys.
<unshadow_> >> LibPThread.pthread_self
<DeBot> unshadow_: Error in line 3: undefined fun 'pthread_self' for LibPThread
<unshadow_> >> LibPThread.pthread_self()
<DeBot> unshadow_: Error in line 3: undefined fun 'pthread_self' for LibPThread
<unshadow_> Yeha, it is ! as a ruby developer this is a dream comes true
<lokulin> Going to have to show this to all the ruby devs at work.
vikaton has joined #crystal-lang
<vikaton> hows the playpen going?
leafybas_ has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
Ven_ has joined #crystal-lang
willlll has joined #crystal-lang
waterlink1 has quit [Read error: Connection reset by peer]
waterlink has joined #crystal-lang
bcardiff has joined #crystal-lang
unshadow_ has quit [Quit: leaving]
unshadow has quit [Remote host closed the connection]
lokulin has left #crystal-lang [#crystal-lang]
vikaton has quit []
vikaton has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
harisamin has joined #crystal-lang
datanoise has joined #crystal-lang
havenwood has joined #crystal-lang
Ven_ has joined #crystal-lang
ponga has joined #crystal-lang
vikaton has quit []
HakanD_ has quit [Quit: Be back later ...]
<crystal-gh> [crystal] eidge opened pull request #658: Fix "Installing" docs link (master...patch-1) http://git.io/vUiB5
jtarchie has quit [Quit: Connection closed for inactivity]
<crystal-gh> [crystal] asterite closed pull request #658: Fix "Installing" docs link (master...patch-1) http://git.io/vUiB5
HakanD_ has joined #crystal-lang
shama has joined #crystal-lang
Ven_ has quit [Ping timeout: 246 seconds]
jtarchie has joined #crystal-lang
HakanD__ has joined #crystal-lang
HakanD_ has quit [Ping timeout: 244 seconds]
DerisiveLogic has joined #crystal-lang
willlll has quit [Quit: willlll]
HakanD__ has quit [Quit: Be back later ...]
ponga has quit [Quit: Leaving...]
harisamin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zz_Cidan is now known as Cidan
bcardiff1 has joined #crystal-lang
HakanD__ has joined #crystal-lang
bcardiff has quit [Ping timeout: 265 seconds]
HakanD__ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
HakanD__ has quit [Ping timeout: 264 seconds]
kulelu88 has joined #crystal-lang
leafybas_ has joined #crystal-lang
leafybasil has quit [Ping timeout: 264 seconds]
leafybas_ has quit [Ping timeout: 244 seconds]
willlll has joined #crystal-lang
bcardiff has joined #crystal-lang
willlll has quit [Quit: willlll]
bcardiff1 has quit [Ping timeout: 272 seconds]
HakanD__ has joined #crystal-lang
<jhass> >> "a"*100000
strcmp1 has quit [Ping timeout: 255 seconds]
DeBot has quit [Quit: Crystal]
DeBot has joined #crystal-lang
willlll has joined #crystal-lang
JBat has quit [Quit: Computer has gone to sleep.]
leafybasil has joined #crystal-lang
notfowl has quit [Excess Flood]
notfowl has joined #crystal-lang
unshadow_ has joined #crystal-lang
unshadow_ has quit [Client Quit]
strcmp1 has joined #crystal-lang
vikaton has joined #crystal-lang
<vikaton> How do I write to file without over writing the whole thing?
<kulelu88> vikaton: try appending
hplar has quit [Ping timeout: 250 seconds]
havenwood has quit [Ping timeout: 250 seconds]
kgadek has quit [Ping timeout: 250 seconds]
kgadek has joined #crystal-lang
hplar has joined #crystal-lang
<vikaton> ah that worked
<kulelu88> :) Similar to python
<vikaton> now this part
<vikaton> how can I make a crystal program run in the bg, but still get some I/O ?
<vikaton> or just Input in this case
<kulelu88> bg?
<kulelu88> oh background
<kulelu88> define where the input is coming from and what input it is
<vikaton> kulelu88: input is everywhere, every keystroke
<jhass> read the right input device in /dev/
<kulelu88> oh you're building a keylogger for microsoft devices. aah okay
<jhass> maybe bind a lib that abstracts that, I think libinput or something fell out of the wayland project
<vikaton> its not microsoft
<vikaton> yet anyway
<kulelu88> i'm kidding =)
<vikaton> oh lol
<vikaton> I'm using curses jhass
<vikaton> and I have a loop that writes Curses.getch to a file
<jhass> yeah, won't work for a background program
<jhass> it won't receive stdin from your tty/pty, simple as that
<jhass> you could probably hack around by reading the pty device in /dev
<jhass> but here be dragons
<vikaton> jhass, same deal with STDIN.getc ?
<jhass> try to understand what I said and that question becomes obvious
<vikaton> hmm
<kulelu88> jhass taking no nonsense tonight. sys.stdin ftw!!!
<vikaton> jhass, is there a specific file?
<kulelu88> for input check /dev/tty
<vikaton> there are many of them
<vikaton> I also can't open them
<kulelu88> there should be an API for input somewhere
<kulelu88> vikaton: try stealing the python code for this.
<vikaton> wut python code
<jhass> vikaton: man ctermid
<kulelu88> Look at sys.stdin
<kulelu88> yeah, that is what I use for input for a little script I wrote in python
bcardiff has quit [Quit: Leaving.]
DerisiveLogic has quit [Remote host closed the connection]
<vikaton> mh
notfowl has quit [Excess Flood]
notfowl has joined #crystal-lang
BlaXpirit has quit [Quit: Quit Konversation]
vikaton has quit []
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
notfowl has quit [Excess Flood]
notfowl has joined #crystal-lang
bcardiff has joined #crystal-lang
datanoise has quit [Ping timeout: 252 seconds]
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
HakanD__ has quit [Quit: Be back later ...]
notfowl has quit [Excess Flood]
HakanD__ has joined #crystal-lang
notfowl has joined #crystal-lang
HakanD__ has quit [Ping timeout: 245 seconds]
havenwood has joined #crystal-lang
datanoise has joined #crystal-lang
datanoise has quit [Read error: Connection reset by peer]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]