<rubyLearner>
Is "raising an exception" the same as "creating an object of one of Exception descendants" ? If not, how exactly is it different?
Ishido has quit [Remote host closed the connection]
ascarter_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<centrx>
rubyLearner: raising an exception is actually activating it, causing the program to terminate unless the exception is caught by a rescue
<centrx>
rubyLearner: creating an Exception object is just like creating any other object
kies has quit [Ping timeout: 245 seconds]
<rubyLearner>
centrx when you say “exception is caught by a rescue” do you mean “the exception object is caught by a rescue”? I would like to understand the underlying mechanics of it, in a more concrete, less abstract way. The idea of “exception” is always so abstract, I'd like to know what actually happens.
ekinmur has joined #ruby
ekinmur has quit [Client Quit]
amclain has quit [Ping timeout: 240 seconds]
nitric has quit [Ping timeout: 258 seconds]
swills has joined #ruby
<centrx>
rubyLearner: Easier said than done
<centrx>
rubyLearner: You can look at the C source code for Kernel#raise and follow that
Rodya_ has joined #ruby
<centrx>
rubyLearner: It's not particularly unique to Ruby, so you could look up how it's done in a more basic learning programming language
bkxd has quit [Ping timeout: 240 seconds]
minimalism has quit [Quit: minimalism]
DLSteve has joined #ruby
minimalism has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
t-recx has joined #ruby
bvcosta has joined #ruby
gusrub has quit []
roamingdog has joined #ruby
bvcosta has quit [Ping timeout: 260 seconds]
enterprisey has joined #ruby
jameser has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
DarthGandalf has quit [Ping timeout: 255 seconds]
__Yiota has joined #ruby
roamingdog has quit [Ping timeout: 260 seconds]
tolerablyjake has joined #ruby
tolerablyjake has quit [Client Quit]
ascarter_ has joined #ruby
enterprisey has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ResidentBiscuit has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Ping timeout: 246 seconds]
<rubyLearner>
centrx is this correct to say? → “If the program commits a transgression, ruby saves an Exception object at $!”
bkxd has joined #ruby
<centrx>
rubyLearner: If an error occurs
<elomatreb>
You can define your own error classes and raise it anywhere in your code
d^sh_ has quit [Ping timeout: 260 seconds]
ascarter_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rubyLearner>
centrx mm ok... is this process that I described a description of “raising an exception”? is it the “raising of the exception” the creation of that object and its saving in $! ?
<elomatreb>
raise first instantiates the class you give it, and saves where it occurs. It then goes up the method call stack to find a matching rescue block, if it reaches the top without finding one your program exist and prints a stack trace
d^sh has joined #ruby
<elomatreb>
*exits
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb>
I.e. there is little special about the Error/Exception object itself, it's only used to indicate what error occured and where
amclain has joined #ruby
<al2o3-cr>
rubyLearner: fuck me, you got me thinking now cock sparrow
<rubyLearner>
elomatreb: but what if I call raise and there's already an exception in $! ?
<rubyLearner>
al2o3-cr hahaha man, I got myself thinking so much my head might explode
<elomatreb>
I think if you call `raise` without an argument it defaults to re-raise what's in $!, otherwise it will override it
uZiel has joined #ruby
<al2o3-cr>
rubyLearner: if it moves like water...
enterprisey has joined #ruby
DeeJayh has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 246 seconds]
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jellycode>
The issue is that in order to encrypt a string for travis, one has to install ruby language, then install the travis client gem, and then they can encrypt the string. It feels like an excessive dependency chain for something so simple.
Esf has joined #ruby
<jellycode>
There's no magic with encryption like this, it's just hard for someone who doesn't do ruby.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Esf has joined #ruby
gothicsouth has joined #ruby
Esf has quit [Client Quit]
Esf has joined #ruby
Esf has quit [Client Quit]
Esf has joined #ruby
segmond has joined #ruby
ascarter has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
nowhere_man has joined #ruby
SeepingN has joined #ruby
bmurt has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
nowhereman has quit [Ping timeout: 255 seconds]
user__ has quit [Ping timeout: 246 seconds]
mim1k has joined #ruby
xall has joined #ruby
_whitelogger has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
roamingdog has joined #ruby
Esf has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
roamingdog has quit [Ping timeout: 268 seconds]
nachoman has quit []
ResidentBiscuit has quit []
dc4 has joined #ruby
olivi____ has joined #ruby
chopin has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
speakingcode has joined #ruby
Rodya_ has joined #ruby
chopin has quit [Remote host closed the connection]
chopin has joined #ruby
olivi____ has quit [Ping timeout: 255 seconds]
Rodya_ has quit [Ping timeout: 240 seconds]
speakingcode has quit [Ping timeout: 240 seconds]
chopin has quit [Ping timeout: 246 seconds]
speakingcode has joined #ruby
jenrzzz has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
htb has joined #ruby
xerx has quit [Ping timeout: 240 seconds]
swills has quit [Quit: Leaving]
mim1k has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
amclain has quit [Quit: Leaving]
<htb>
Hi all, I am trying to install some ruby app (http://orgmode.org/worg/blorgit.html); I used rvm to setup an isolated environment and I am getting errors running rake: I get a "LoadError: cannot load such file -- blorgit" when running rake new (as per the instructions) and I get another error when adding -I (Mustermann::CompileError: regular expression should not contain ^: "^\\/.search"). Could anyone give me pointers to debug this?
<htb>
Thanks
<zenspider>
hello fellow emacs user... :P
ascarter has joined #ruby
xall has quit [Ping timeout: 240 seconds]
weathermaker has quit [Ping timeout: 240 seconds]
Azure has quit [Ping timeout: 240 seconds]
<htb>
hello
<zenspider>
htb: so... that project hasn't had a commit in 5 years. some stuff has changed in that time.
<zenspider>
it is expecting the load path to have "." in it, which it doesn't by default anymore
<zenspider>
that's why it isn't finding the file... also, it doesn't have proper project directory structure set up, which is odd
xerx has joined #ruby
<zenspider>
also, it seems to be flat out MISSING files: LoadError: cannot load such file -- /Users/ryan/xxx/blorgit/backend/active_file/init.rb
xerx has quit [Client Quit]
<htb>
I have a backend/active_file/init.rb file after the git clone and submodule init
<zenspider>
ah. I skipped that step. my fault.
mkillebrew has left #ruby [#ruby]
<htb>
when I do 'rake -I . new' from the root blorgit folder, I get the Mustermann regexp error. Did you get past that already?
<zenspider>
this is pretty horribly written tho
<zenspider>
not yet
<zenspider>
you're gonna have to slow down
<zenspider>
it doesn't like the way I'm running emacs server??
<zenspider>
nope. I'm done. this is too horrible
<zenspider>
can you gist the actual error you're seeing?
<htb>
ok
AnoHito has joined #ruby
<zenspider>
I think what you're seeing is shitty dependency management. this hasn't changed in 5 years, but the other projects have.
<zenspider>
and since the instructions just say "install this shit willy nilly" you wind up with the latest versions
<htb>
if the software doesn't look good (or too obsolete), I'll look for something else, thanks for the help anyway
AnoHito_ has quit [Ping timeout: 240 seconds]
username_ has quit [Ping timeout: 260 seconds]
AnoHito_ has joined #ruby
<zenspider>
htb: go to line 45 of blorgit.rb and remove the anchor there
<zenspider>
then do it for the others
user__ has joined #ruby
segmond has quit [Quit: l8r]
<zenspider>
hopefully you won't have too much shit to deal with
<htb>
thanks a lot that gets me through the first step. I am not sure what I disabled there, I am illeterate in ruby
AnoHito has quit [Ping timeout: 246 seconds]
user__ has quit [Client Quit]
<zenspider>
it's just regular expressions. pretty much the same in all real languages
<zenspider>
they don't want you to have "^" in the regexp anymore. the blog software is ancient so it hasn't been updated
<zenspider>
you could for the project and send a PR back to the author, but I doubt they'd bother. maybe file an issue asking about it
arescorpio has quit [Quit: Leaving.]
bvcosta has joined #ruby
<htb>
the get/post anchors is what i don't understand I think (I guess it responses to http requests). I'll play with it for a while, see if I can get it to a working state.
ekinmur has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 268 seconds]
cjhowe7 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cjhowe7 has joined #ruby
htb has quit [Remote host closed the connection]
charliesome has joined #ruby
jgnagy has quit []
bvcosta has joined #ruby
hamid has joined #ruby
hamid is now known as Guest84209
Guest84209 has quit [Client Quit]
bvcosta has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Read error: Connection reset by peer]
vincent has joined #ruby
vincent is now known as Guest8855
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
Guest8855 has quit [Ping timeout: 240 seconds]
dc4 has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
oliv_____ has joined #ruby
Rodya_ has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
oliv_____ has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Ping timeout: 258 seconds]
Xakotu has joined #ruby
konsolebox has joined #ruby
tvw has joined #ruby
TomyLobo has joined #ruby
Xakotu has quit [Client Quit]
shengquangang has joined #ruby
shengquangang has left #ruby [#ruby]
Ishido has joined #ruby
_whitelogger has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
belmoussaoui__ is now known as belmoussaoui
keyjoo_ has joined #ruby
konsolebox has quit [Max SendQ exceeded]
cfec0b8d has joined #ruby
gregf_ has quit [Ping timeout: 260 seconds]
belmoussaoui has quit [Quit: belmoussaoui]
belmoussaoui has joined #ruby
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
latemus has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
SeepingN_ has quit [Client Quit]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nowhere_man has quit [Ping timeout: 240 seconds]
zapata has quit [Quit: WeeChat 1.8]
zapata has joined #ruby
roamingdog has joined #ruby
latemus has joined #ruby
Rodya_ has joined #ruby
symm- has joined #ruby
charliesome has joined #ruby
roamingdog has quit [Ping timeout: 240 seconds]
<symm->
irb causes a strange increase in power usage... all the more strange since cpu usage stays negligible
Rodya_ has quit [Ping timeout: 246 seconds]
Miron has quit [Read error: Connection reset by peer]
oleo has joined #ruby
spectrum has quit [Read error: Connection reset by peer]
Ishido has quit [Read error: Connection reset by peer]
spectrum has joined #ruby
hahuang65 has joined #ruby
hutch34_ has joined #ruby
nunchuck has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
muelleme has joined #ruby
ascarter has joined #ruby
hutch34_ has quit [Ping timeout: 255 seconds]
symm- has quit [Ping timeout: 255 seconds]
vincent has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
vincent is now known as Guest73074
bkxd has joined #ruby
cjhowe7 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cjhowe7 has joined #ruby
cjhowe7 has quit [Client Quit]
ascarter has quit [Ping timeout: 240 seconds]
cjhowe7 has joined #ruby
cjhowe7 has quit [Client Quit]
nhhc has joined #ruby
muelleme has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
axsuul has quit [Ping timeout: 240 seconds]
cjhowe7 has joined #ruby
axsuul has joined #ruby
godel_ has joined #ruby
CacoS has joined #ruby
stormbytes has joined #ruby
mathys has joined #ruby
Guest73074 has quit [Ping timeout: 268 seconds]
kith has quit [Ping timeout: 240 seconds]
leonthemisfit has quit [Ping timeout: 268 seconds]
marr has joined #ruby
mathys_ has joined #ruby
mathys has quit [Ping timeout: 240 seconds]
mathys_ has quit [Remote host closed the connection]
dasher^0_o has joined #ruby
vincent has joined #ruby
Rodya_ has joined #ruby
vincent is now known as Guest96920
patarr has joined #ruby
prubini87 has joined #ruby
<prubini87>
Can anyobody enlighten me, please? I need to manage 2 processes running at the same time in a console window, one is a socket connection (read/write) and the other is the user input/output. Does anyone have a tip or, very so much better an example of how to go about hangling this??
mathys has joined #ruby
Rodya_ has quit [Ping timeout: 258 seconds]
patarr has quit [Ping timeout: 240 seconds]
belmoussaoui has quit [Quit: belmoussaoui]
belmoussaoui has joined #ruby
prubini87 has quit [Read error: Connection reset by peer]
prubini87 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
prubini87 has quit [Read error: Connection reset by peer]
prubini87 has joined #ruby
nofxxx has joined #ruby
lxsameer has joined #ruby
nofxx has quit [Ping timeout: 246 seconds]
prubini87 has quit [Read error: Connection reset by peer]
ascarter has joined #ruby
cjhowe7 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
prubini87 has joined #ruby
jenrzzz has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
nanoz has joined #ruby
mathys has quit [Remote host closed the connection]
mathys has joined #ruby
prubini87 has quit [Read error: Connection reset by peer]
prubini87 has joined #ruby
prubini87 has quit [Client Quit]
mathys_ has joined #ruby
mathys_ has quit [Remote host closed the connection]
mathys has quit [Ping timeout: 240 seconds]
Guest96920 has quit [Remote host closed the connection]
muelleme has joined #ruby
blackwind_123 has quit [Ping timeout: 255 seconds]
blackwind_123 has joined #ruby
govg has joined #ruby
bkxd has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
ur5us has joined #ruby
naftilos76 has joined #ruby
Rodya_ has joined #ruby
Ishido has joined #ruby
agent_white has quit [Quit: bai]
Rodya_ has quit [Ping timeout: 246 seconds]
ddffg has joined #ruby
blackwind_123 has quit [Ping timeout: 240 seconds]
saschavoid has joined #ruby
hahuang65 has joined #ruby
hahuang65 has quit [Ping timeout: 255 seconds]
brent__ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
mikecmpbll has joined #ruby
Fira_ has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
ascarter has quit [Ping timeout: 260 seconds]
naftilos76 has quit [Quit: Αποχώρησε]
Fira_ has quit [Changing host]
Fira_ has joined #ruby
ur5us has quit [Remote host closed the connection]
patarr has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
tvw has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
AnoHito_ has joined #ruby
AnoHito has quit [Ping timeout: 240 seconds]
AnoHito has joined #ruby
jenrzzz has joined #ruby
AnoHito_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
Azure has joined #ruby
marr has quit [Ping timeout: 240 seconds]
bvcosta has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
bvcosta has quit [Ping timeout: 245 seconds]
godel_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Rodya_ has quit [Ping timeout: 245 seconds]
Ishido has quit [Remote host closed the connection]
godel has joined #ruby
s1kx has joined #ruby
Ishido has joined #ruby
herbmillerjr has quit [Remote host closed the connection]
bkxd has joined #ruby
stormbytes has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
oleo has quit [Quit: irc client terminated!]
oleo has joined #ruby
cschneid_ has joined #ruby
James123 has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
quobo has joined #ruby
saschavoid has quit [Quit: leaving]
vuoto has joined #ruby
dasher^0_o has quit [Ping timeout: 240 seconds]
godel has quit []
jhass has quit [Quit: Bye]
<James123>
Any ideas on how to replace a character in an string only if it doesn't occur at the beginning of it?
bkxd has joined #ruby
marr has joined #ruby
howdoi has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
jrgifford has joined #ruby
mikecmpbll has joined #ruby
nowhere_man has joined #ruby
_whitelogger has joined #ruby
nowhere_man has joined #ruby
Rodya_ has joined #ruby
Fira_ has quit [Ping timeout: 255 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Ping timeout: 246 seconds]
roamingdog has joined #ruby
devyn has quit [Ping timeout: 240 seconds]
<zenspider>
"hangling"! I love it!
<zenspider>
James123: do the simplest thing that could possibly work. exactly what you described. nothing more.
devyn has joined #ruby
hahuang65 has joined #ruby
lightstalker has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
Fernando-Basso has joined #ruby
ekinmur has joined #ruby
marr has quit [Ping timeout: 268 seconds]
ekinmur has quit [Client Quit]
ledestin has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby
ekinmur has joined #ruby
bkxd has joined #ruby
Tempesta has quit [Quit: See ya!]
rohitpaulk has joined #ruby
ascarter has quit [Ping timeout: 268 seconds]
eifran has quit [Quit: Leaving]
nanoz has quit [Ping timeout: 240 seconds]
nanoz has joined #ruby
bvcosta has joined #ruby
bvcosta has quit [Ping timeout: 240 seconds]
ekinmur has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has quit [Remote host closed the connection]
ekinmur has joined #ruby
babykosh has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ekinmur has quit [Client Quit]
Rodya_ has joined #ruby
Rodya_ has quit [Ping timeout: 240 seconds]
muelleme has quit [Read error: Connection reset by peer]
muelleme has joined #ruby
mjuszczak has joined #ruby
Tempesta has joined #ruby
muelleme has quit [Ping timeout: 240 seconds]
roamingdog has joined #ruby
jhass has joined #ruby
manveru_ is now known as manveru
petruff2 has joined #ruby
ekinmur has joined #ruby
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #ruby
ascarter has joined #ruby
oliv_____ has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
mjuszczak has quit []
mjuszczak has joined #ruby
mjuszczak has quit [Client Quit]
symm- has joined #ruby
jakew has joined #ruby
jakew has quit [Client Quit]
bvcosta has joined #ruby
jakew has joined #ruby
jakew has quit [Client Quit]
jakew has joined #ruby
muelleme has joined #ruby
kobain has joined #ruby
jakew has quit [Client Quit]
rippa has joined #ruby
ekinmur has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weathermaker has joined #ruby
bvcosta has quit [Ping timeout: 246 seconds]
davic has quit [Quit: Connection closed for inactivity]
muelleme has quit [Ping timeout: 240 seconds]
ruurd has joined #ruby
roamingdog has quit [Remote host closed the connection]
dasher00 has quit [Ping timeout: 268 seconds]
roamingdog has joined #ruby
oliv_____ has quit [Remote host closed the connection]
olivi____ has joined #ruby
roamingdog has quit [Remote host closed the connection]
gnufied has quit [Ping timeout: 245 seconds]
dasher00 has joined #ruby
Esf has joined #ruby
olivi____ has quit [Ping timeout: 255 seconds]
roamingdog has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
oliv_____ has joined #ruby
Esf has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
blackwind_123 has quit [Ping timeout: 260 seconds]
blackwind_123 has joined #ruby
mendel has joined #ruby
<apeiros>
rubyLearner: I think it's close and a good first understanding
<apeiros>
some corrections: there are no assumptions. exceptions are raised when something is wrong
jottr has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
<apeiros>
(of course, as all other code too, the code which detects a case where an exception is raised can have a bug)
<apeiros>
then: rescue is not "in the local scope"
<apeiros>
calling a method creates a stack. i.e. foo calls bar calls baz -> your stack is foo > bar > baz. exceptions unwind this stack until it finds a wrapping begin/rescue
<apeiros>
the ultimate begin/rescue is rubys interpreter itself, which will cause the application to exit with the error message you usually see in case of "unhandled" exceptions
<apeiros>
also, raise can create an exception object, but it doesn't have to. you can pass an exception object directly: raise MyExceptionClass.new("message")
solocshaw has joined #ruby
<rubyLearner>
apeiros: is the “method stack” that you say the same thing as the backtrace that is saved in the Exception object?
<apeiros>
yes
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
s1kx has quit [Quit: s1kx]
<rubyLearner>
mmm ok, so the interpreter will search the backtrace saved in the Exception object for a rescue clause
<apeiros>
kinda. it doesn't exactly use the backtrace for the search.
<apeiros>
but that's the route/way it takes
<rubyLearner>
The backtrace tells the interpreter where to go? Or do they just happen to hold the same stack trace?
PatrikasZvaigzde has quit [Ping timeout: 260 seconds]
<apeiros>
I'm actually not entirely sure about the details. but I think the thing in the exception is a copy of the actual thing used.
<matthewd>
Somewhere in between. Do you have any other-language experience we might help you compare/contrast?
prubini87 has joined #ruby
bawsky has joined #ruby
<apeiros>
since the actual thing is "live", when the stack is being unwinded, it changes. so the exception would no longer accurately depict the origin if didn't copy before unwind.
<rubyLearner>
matthewd: mmm not unfortunately
bkxd has quit [Ping timeout: 258 seconds]
<matthewd>
Yeah, the exception's backtrace is a representation of the VM's actual call stack state at the time the exception occurred
<bawsky>
Got a problem involving the need for non-blocking requests... Can someone help? Details in a sec
<apeiros>
also the actual thing might contain more/different information related to implementation details of the VM
<matthewd>
Most notably, the exception's backtrace is mutable.. your power to mutate the real stack is somewhat more limited :)
<apeiros>
the thing in the exception contains what you can actually see in your ruby code
<apeiros>
matthewd: I really wish it was frozen
<matthewd>
rubyLearner: Consider that the VM is always tracking where you called from, because even absent an exception, it has to go back there when you return
<apeiros>
I've been bitten too often by well-intended libraries which tried to "tidy up" the backtrace and in turn made my bugsearch multiple times more annoying.
<matthewd>
apeiros: I'm pretty torn.. a nontrivial library can leave the backtrace awful to read for "normal" use -- but if you do need to care about parts it's hiding, yeah, not fun
<apeiros>
I't be nice if ruby made it obvious and kept a frozen copy available
<apeiros>
like "Exception foo in bar\n[POSTPROCESSED BACKTRACE, ORIGINAL IN $!.original_backtrace]\n…tidied backtrace…"
<apeiros>
wrt, I'm glad they introduced Exception#cause
<apeiros>
that was another source of frustration
<apeiros>
"has been" is better to indicate it no longer is?
prubini87 has quit [Read error: Connection reset by peer]
<rubyLearner>
I'm still trying to wrap my mind around what you guys wrote... thanks, I'm starting to get a few internal eurekas in my mind... How did you guys learn this? Do you suggest some resource where I can learn Ruby in this level of detail? Because the abstraction kinda puzzles me too much, I only feel clarified when I actually see it happening in my mind
<rubyLearner>
.
<bawsky>
I am maintaining an app in which users may have a MMR (aka a number defining his ability in a game) and may invite/be invited to teams ONLY if they are not much higher than the highest MMR on team or much lower than the lowest.
<bawsky>
The problem is that I get the MMR value from an external API and the value may change at any time (therefore storing locally is not reliable).
<bawsky>
The external API used to support batch calls (I send a bunch of player ids, get their MMRs and bam I'm set). The problem is that it does not support batch calls anymore and now I am kinda lost about my options...
<bawsky>
May someone help? :/
prubini87 has joined #ruby
<bawsky>
I am referring specifically to League of Legend's API - it used to support batch calls on v2, but v2 is going to be deprecated (and with that, batch calls)
<apeiros>
rubyLearner: I already had a good understanding of the callstack when I learned my first lang with exceptions, so the way they work seemed natural to me. somewhat "the way I'd have done it"
bkxd has joined #ruby
cdg has joined #ruby
<matthewd>
rubyLearner: I personally prefer to learn one abstraction layer at a time -- accept that "and then it just does stuff", then return later to try to understand how that part works in turn [where it'll be building on yet another abstraction, etc]
<apeiros>
and to understand the callstack - well, I had years of time. I started around age 8 ;-) no idea when what understanding formed in my mind.
roamingdog has joined #ruby
<apeiros>
bawsky: store a value and a vector and extrapolate?
<apeiros>
only query if the data is "too old"
<apeiros>
alternatively - do the batch client side
<apeiros>
i.e. dozens of individual mmr queries
<rubyLearner>
matthewd: I like that suggestion a lot.. .I might be too stubborn.. because I'm reading a ruby book and whenever I don't fully understand something, I start googling for ages, it takes too much time. I would love to find a book or webite that just told me everything haha.
<apeiros>
you can also ease the burden by querying only the strongest and weakest few players of the team
<elomatreb>
I found it helpful to understand the need for exceptions, look at languages like C where you have to carefully check for special error return codes all the time
<rubyLearner>
apeiros: wow, you started early.. I wish I was that smart to get into programming at an early age.. it's a fascinating universe
<elomatreb>
Then you can see Exceptions are a formalization of that mechanic that is designed to keep you from confusing an error value with an actual return code
cdg has quit [Ping timeout: 246 seconds]
<matthewd>
rubyLearner: I'd like to confidently say "horses for courses, go with whatever learning style feels like it suits you"... but I worry that there's always another abstraction layer, and then another -- you have to stop at some point, or you'll end up learning subatomic physics instead of programming ;)
<apeiros>
elomatreb: eh, there's a point in that. the issue is, it's a kind of "if you have that other additional knowledge, you'll understand this additional knowledge" :D
<elomatreb>
To understand exceptions, you must first understand the universe
<elomatreb>
:P
<apeiros>
but it's a good point and I think it becomes stronger with "revisit things you learned once you have alternative perspectives"
<prubini87>
Does anyone know a good-for-dummies, concise tutorial on concurrency? Something not overcomplicated, for a starter hehehe :S
<rubyLearner>
matthewd
<rubyLearner>
elomatreb hahahaha
<elomatreb>
apeiros: I like learning/understanding by understanding the history/reasons for creation of something
<apeiros>
rubyLearner: ruby is your first language?
<rubyLearner>
matthewd yeah, it's definitely a trap I fall into all the time... you feel this urge to “get it”, but it's like water, it seems haha
<apeiros>
elomatreb: yeah, same
<apeiros>
elomatreb: trying to build my own language helped tremendously there
<apeiros>
you suddenly have to question things you took for granted, or always thought "wow that sucks" and suddenly understood, why it was not improved.
<rubyLearner>
apeiros: yes.. I did some webdesign before, playing here and there with javascript trying to fix bugs, not really programming
<apeiros>
rubyLearner: ok. I think elomatreb's advice is something you should remember for later then. it's a good idea to learn more than one language. it helps understand why the other language works the way it works :)
patr0clus has quit [Quit: tempusfugit]
<bawsky>
apeiros: I'm looking at client side being the first option - and then sending the data to the backend to do the dirty job (a problem is that a player may have up to two different MMRs and I still need to grab the highest; we even have a class for treating that case...)
prubini87 has left #ruby [#ruby]
<rubyLearner>
also, I have this urge to write everything I study, I use this great tool called Workflowy for that... I definitely solidifies the knowledge, but it also is a trap, it sucks a lot of time
<apeiros>
rubyLearner: well, can't have your cake and eat it too
<apeiros>
I think writing everything is a good choice.
<bawsky>
alternatively, I guess I'll probably do it serverside anyway and use the "too old or not" approach.
<matthewd>
rubyLearner: To that end, I'd say your approximation is pretty well close enough... I'd just refine it to note that the backtrace is a *representation* of the call stack. So it's not technically the thing that's driving the unwinding (looking for rescue clauses), but the distinction is unlikely to matter.
nesoi has joined #ruby
prubini87 has joined #ruby
prubini87 has quit [Client Quit]
Puffball has quit [Read error: Connection reset by peer]
t-recx has joined #ruby
Rodya_ has joined #ruby
marius has joined #ruby
bawsky has quit [Quit: Leaving]
bawsky has joined #ruby
Rodya_ has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jcao219 has quit [Ping timeout: 260 seconds]
ruurd has joined #ruby
<rubyLearner>
thanks a lot guys.. tremendously helpful.. for those of you who like to write and take notes on stuff you study, I'd really recommend this tool “Workflowy”.. it's a pretty awesome outliner I've been using for years to try to organize my brain.. helps a lot to memorize stuff :)
<apeiros>
nesoi: you don't need to parse a Time object
<apeiros>
parse means translate a String to Time. you already have Time.
<nesoi>
apeiros: I want it as a string
<apeiros>
that's not what parse does.
<nesoi>
so why would that code have worked before?
<apeiros>
"worked"
<nesoi>
worked = it's comparing values in a database which are string
<apeiros>
you're mistaken
oliv_____ has joined #ruby
<apeiros>
and your own code tells you that you are mistaken.
<apeiros>
puts r.last_updated_at.class -> Time
<nesoi>
right I know it's originally a Time, but in the DB it's a varchar and is human-readable as time
<apeiros>
it worked because it converted your Time to a String and parsed that String converting it back to the Time it was before. hurray for useless waste of CPU cycles :)
<apeiros>
nesoi: I doubt that. but even if, you're doing it terribly wrong.
<apeiros>
also, if it really is, then the output you showed us is misleading.
<nesoi>
that's the current output
<nesoi>
hm. maybe the input data format changed? have to see
ltem has quit [Quit: Leaving]
<apeiros>
so is r.last_updated_at from the database?
<nesoi>
yeah it's supposed to be
<matthewd>
What Active Record version is this, and where did `r` come from?
<apeiros>
because if it is, "but in the DB it's a varchar" is simply wrong.
<apeiros>
nesoi: well then ^
<apeiros>
(and it'd be rather stupid to have last_updated_at as varchar tbf)
<nesoi>
I'm not specifying the activerecord version. actually r came from an api call, not a db. and the API has changed so the format could have changed… nevermind, I'm unprepared and need to research it more. thanks for the hints!
Rodya_ has joined #ruby
creshiem has joined #ruby
oliv_____ has quit [Ping timeout: 268 seconds]
saschavoid has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
creshiem has quit [Quit: creshiem]
solocshaw has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
psychicist__ has quit [Ping timeout: 240 seconds]
Fysicus has joined #ruby
nertzy has joined #ruby
agent_white has joined #ruby
belmoussaoui__ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Fira_ has joined #ruby
Fira__ has quit [Ping timeout: 240 seconds]
marlinc has quit [Ping timeout: 260 seconds]
belmoussaoui has quit [Ping timeout: 240 seconds]
tobbie has joined #ruby
bkxd has joined #ruby
username_ has joined #ruby
ddffg has quit [Remote host closed the connection]
chopin has joined #ruby
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
jottr has quit [Quit: WeeChat 1.8]
Ishido has quit [Read error: Connection reset by peer]
ruurd has quit [Ping timeout: 240 seconds]
saschavoid has quit [Ping timeout: 258 seconds]
saschavoid has joined #ruby
Puffball has joined #ruby
chopin has quit [Ping timeout: 255 seconds]
faelkle has joined #ruby
faelkle has joined #ruby
faelkle has quit [Changing host]
hahuang65 has joined #ruby
ddffg has joined #ruby
marr has joined #ruby
dasher00 has quit [Ping timeout: 260 seconds]
tristanp has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 240 seconds]
dasher00 has joined #ruby
otherj has joined #ruby
ddffg has quit [Ping timeout: 246 seconds]
dzodzo has quit [Ping timeout: 255 seconds]
otherj has quit [Client Quit]
dzodzo has joined #ruby
segy has joined #ruby
banisterfiend has joined #ruby
ur5us has joined #ruby
saschavoid has quit [Quit: leaving]
olivi____ has joined #ruby
swills has quit [Quit: Leaving]
gothicsouth has joined #ruby
mjuszczak has joined #ruby
symm- has quit [Ping timeout: 246 seconds]
mjuszczak has quit [Client Quit]
cfec0b8d has quit [Remote host closed the connection]
olivi____ has quit [Ping timeout: 260 seconds]
cfec0b8d has joined #ruby
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
Puffball has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]