<ponga>
i wonder what has changed, it only fetched 0.6.1 before
<unshadow>
:)
<ponga>
and all of sudden i made typo , and retried it, works now
<ponga>
i will never understand computer's feeling
<unshadow>
just make sure crystal --version shows 0.7.3
<ponga>
the weird part was that i did "brew uninstall crystal" then "brew install crystal"
<ponga>
it still installed 0.6.1
<unshadow>
maybe you needed to use the "tap" command to refresh the repo or package info ?
<unshadow>
I'm using Linux so i'm not 100% on what those do TBH
<strcmp1>
unshadow, i dont know how you might get a backtrace in that situation, or the tooling available. it would be cool if from another thread, you could print the callstack for another thread somehow. anyway definitely not possible since they have just segfault :P
<strcmp1>
but did you try the 'timeout' library? is it even available in crystal?
<strcmp1>
in ruby it uses threads so it probably wont work even if it were
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<strcmp1>
yeah there's no timeout.cr in the repo
<unshadow>
It could be coll to have somekind of a backtrace of frames for each function happening
<strcmp1>
yeah
<unshadow>
cool*
<strcmp1>
did you try ^C?
<strcmp1>
i guess you could try setup a handler for SIGINT, but dont know what useful stuff you could print
<unshadow>
I use ^C and it pauses the program, and then I can do "bc" or "frame n" to show the backtrace, but I want it to print it while it runs
<strcmp1>
maybe its the regex, and not gsub?
<strcmp1>
if you swap it for a string does it still hang?
<unshadow>
strcmp1: not sure, I'm trying to debug the hang, to see why it does that
<strcmp1>
yeah
<unshadow>
my first susspecion was that it comes from the Regex
<unshadow>
but then I wanted to be more specific to the code I posetd
<unshadow>
so..
<strcmp1>
if you want to debug it, then probably easiest to clone the repo, edit the gsub method yourself, and add debugging calls to see how far it gets, where it blocks, etc.
<unshadow>
yap, done , added, now lets try :)
<strcmp1>
gl
<unshadow>
strcmp1: I think I found it :)
<strcmp1>
what is it?
<unshadow>
Issue is with def gsub(pattern : Regex) (line 951 of string.cr), while match is looping endleslly
<strcmp1>
can probably work around it by using a string instead
<unshadow>
strcmp1: what do you mean ?
<strcmp1>
does gsub only have a method for regex?
<unshadow>
Nope, also for char to char replacment
<unshadow>
def gsub(char : Char, replacement)
<unshadow>
also string
<unshadow>
def gsub(string : String, replacement)
Ven has joined #crystal-lang
<unshadow>
yeha, using string seems to work, but it will only work for this example test, not for my whole project :(
<unshadow>
>> a = "Testing"; a.gsub("ti", "123"); puts a
Ven has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
<jababb>
jhass: thanks, just what I needed!
<jababb>
do you know if it works well with nested anonymous objects? I see I can do { result: {type: Hash }} -- but I assume I can expand Hash with its own json_mapping
<luislavena>
hello folks, checking here since I cannot find anything on GitHub, anyone implementing something like DataObjects (DO) adapter pattern?
<jhass>
I've only seen activerecord (though unlike the rails/ruby version)
asterite has joined #crystal-lang
<asterite>
luislavena: o/
<ponga>
hi
<luislavena>
jhass: yeah, saw active_record.cr, but not looking at ORM (yet), but more low level but unified interface
willl has quit [Quit: Connection closed for inactivity]
<ponga>
when do you guys expect cry-1.0.0 will release?
<jhass>
shortly after it's ready for that
<asterite>
No idea, really. We have to sit down with waj and build a Roadmap: things that we'd like the language, std, and tools to have at that point
<asterite>
A Roadmap would be something really nice to have, so anyone can take bits of tasks and implement them if they want :-)
<luislavena>
asterite: hello there :)
<asterite>
luislavena: cómo va? :-)
<ponga>
jhass: asterite if anyone of you studied formal computer science courses/degree can you recommend me a CS101 style book
<ponga>
i really lack the principles too much
<ponga>
i don't even know what kernal is and had to google it
* ponga
is sad for being dumb
<jhass>
mmh, I basically only had a book for math
<asterite>
ponga: I studied CS but didn't finish my studies. I was close, though. I needed to start/finish the thesis and then also the Language Theory course (no kidding here)
<asterite>
ponga: what are you interested in learning? algorithms? complexity?
<ponga>
asterite: is it common in the CS field for one who had not completed the course start career?
<jhass>
yes, very
<ponga>
asterite: i do natural language processing , i come from linguistics, language teaching, philosophy of language
<asterite>
ponga: you mean, start working without CS studies?
<ponga>
i work myself to write a AI chatbot
<ponga>
asterite: no i meant " without finished degree "
<asterite>
I'm missing something in that question: "is it common in the CS field for one who had not completed the course start career?". Is it common.. what?
<ponga>
sorry i missed "to"
<ponga>
is it common in the software field for ones who had not completed the course TO start their career and work?
<ponga>
and thanks jhass for response
<asterite>
At least here it's very common. I started working at the same time I started studying
<asterite>
but I knew a bit about programming before I started working
<ponga>
asterite: interesting, i never really studied anything related to language itself at university, i just took normal boring philosophy courses
<ponga>
i feel kinda empathic
<jhass>
see, CS is solving someone else's problem with computers
<ponga>
that's what i believe it is
<jhass>
you're constantly learning just enough of a to you foreign domain to solve that problem
<ponga>
solving an issue in machine way
<ponga>
hm
<jhass>
as such people who can adapt quickly to new material and/or with diverse backgrounds are very welcome
<ponga>
true however very often i feel i need to learn some basic
<jhass>
and if "all" you can do is translating terms of a different domain to a domain a programmer can understand, that's incredibly valuable already
<ponga>
for example i still don't know how to install a thing from tar.gz(tar ball?)
<jhass>
well, a tarball is just a bunch of files
<ponga>
thank you jhass you are being very kind
<jhass>
a zip, rar or whatever
<jhass>
compressed bunch of files
<ponga>
today i tried to use tar ball for crystall cos my brew install command kinda was messed up
<ponga>
got the tar ball, unzipped it in home folder, and didn't know what to do for next step
* ponga
felt bad that moment
<jhass>
well, did you look at the files that you got from it?
<jhass>
digging into stuff and being curios, trying out is a core requirement to a good programmer IMO
<ponga>
wow
<ponga>
jhass: thank you i figured it out
<jhass>
;)
<ponga>
just run crystal in /bin
<jhass>
see, that's how I learned 80% of what I know
willl has joined #crystal-lang
<ponga>
now i need to learn how to run this without cd into it, i think it was something about editing $path thingi in vim or smethng
<ponga>
i will try
waj has quit [Ping timeout: 252 seconds]
<ponga>
jhass: so you don't have a degree in computer science?
<jhass>
well, working on it
<ponga>
wow
<asterite>
ponga: did you do `brew update` ?
<ponga>
i mean it could sound dumb, but how did you get a job in first place? do you work in software field?
<ponga>
asterite: yes i did brew update! i figured it out today myself sir!
<jhass>
well, tbh I don't have a job yet, went straight from school to university
<ponga>
i used the exprience from "rvm get head"
<jhass>
and don't need to work to finance that due to some circumstances
<ponga>
then i thought "maybe this thing works like rvm too, it needs a newer version to fetch newer crystal, after all they are all package mangaers"
<ponga>
im proud
<asterite>
:)
<jhass>
but at least to me a CS degree doesn't mean much
<ponga>
thanks jhass, for answering , i want to apologise if the question was sensitive
<jhass>
I know a lot of people that have one that I'd never hire
<ponga>
lol
<jhass>
and equally many that don't and who I'd hire any time
<ponga>
maybe this is first time me seeing harsh jhass
<ytti>
i think higher education should be reserved to people with academic interest
<ytti>
now higher education is factory
<ytti>
where people go, since they feel they are investing in future
<jhass>
yeah, agreed especially in CS
<ytti>
not because they are genuinely interested in academia
<ponga>
seems like 'higher education is factory' is a problem with every developed society
<ytti>
academia is important and academics should be compensated better
<ytti>
but we should have MUCH less people receiving higher education
<ponga>
i agree too
<ponga>
asterite: if i was only interested in writing scripts for my NLP scripts, i would worry far less, but im into more general stuff too. for instance i like crystal and if i had the skill i want to contribute too
<ponga>
this motivates me to learn fundamentals and jargons
<ponga>
this was reason of asking for a good book
<jhass>
did you read something like Chris Pine's learn to program?
bcardiff1 has quit [Quit: Leaving.]
mdz_ has joined #crystal-lang
<ponga>
nop
<ponga>
is that book good
<jhass>
I see it generally recommended by those who read it