tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fridtjof has joined #ruby
FrostCandy has quit []
jtdoncas_ has joined #ruby
konsolebox has joined #ruby
d_kam has quit [Quit: Be back later ...]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
d_kam has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
RushPL has quit [Remote host closed the connection]
priodev has quit [Ping timeout: 256 seconds]
claw has quit [Remote host closed the connection]
mtkd has joined #ruby
bronson has joined #ruby
priodev has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d_kam has quit [Ping timeout: 256 seconds]
RushPL has joined #ruby
claw has joined #ruby
apeiros has quit [Ping timeout: 264 seconds]
apeiros has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
bronson has quit [Ping timeout: 263 seconds]
eckhardt has joined #ruby
dstrunk has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jamiejackson has joined #ruby
eckhardt has quit [Client Quit]
tcopeland has joined #ruby
chmurifree has quit [Ping timeout: 256 seconds]
jeffreylevesque has joined #ruby
eckhardt has joined #ruby
Daemen has joined #ruby
TomyLobo has quit [Ping timeout: 246 seconds]
lytol_ is now known as lytol
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wilbert has quit [Ping timeout: 240 seconds]
<catphish>
apeiros: i think i've fixed it, embarrassingly after 12 hours of debugging, i believe it was nginx's client write timeout, not a timeout i've ever run into before
<catphish>
the client was just hanging receiving the http stream while it did other IO
apeiros__ has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
sanscoeu_ has quit [Remote host closed the connection]
<darkhanb>
When I compile and install Ruby 2, how can get a list of standard modules that didn't get installed?
x77686d has joined #ruby
bmurt has joined #ruby
ren0v0_ has quit [Ping timeout: 246 seconds]
alex`` has joined #ruby
alfiemax_ has quit [Ping timeout: 248 seconds]
<catphish>
i don't know if there's a way to do that, but it's pretty rare that anything is missing in my experience
<darkhanb>
for example, when I "make", one of the lines are: configuring gdbm Failed to configure gdbm. It will not be installed.
ren0v0 has joined #ruby
<darkhanb>
I believe if I installed: apt-get install -y libgdbm-dev, it would've succeded
<darkhanb>
*succeeded
sanscoeur has quit [Remote host closed the connection]
<catphish>
yeah, that makes sense there are a couple of things you can miss out on, i don't know how to get the full list, maybe examine the output of configure
cdg_ has joined #ruby
<catphish>
openssl is the other obvious one :)
<darkhanb>
yea, I can examine the make output and install those libraries then re-make, I just thought maybe there was a way other than this
<darkhanb>
catphish thanks for response
cdg has quit [Ping timeout: 256 seconds]
<catphish>
there might be i'm afraid i don't know, maybe someone else has a better answer
chmurifree has joined #ruby
cdg_ has quit [Ping timeout: 260 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
riskish has joined #ruby
bronson has joined #ruby
Daemen has quit [Quit: Leaving]
crankharder has joined #ruby
jaequery has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marr has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 260 seconds]
Fenhl has joined #ruby
catphish has quit [Quit: Leaving]
jottr has joined #ruby
milardovich has joined #ruby
marxarelli is now known as marxarelli|afk
jottr_ has quit [Ping timeout: 260 seconds]
aphprentice has quit [Quit: Connection closed for inactivity]
jottr_ has joined #ruby
Psybur_ has quit [Ping timeout: 256 seconds]
milardovich has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 256 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has left #ruby [#ruby]
hahuang61 has quit [Quit: WeeChat 2.0.1]
jamiejackson has quit [Remote host closed the connection]
bmurt has joined #ruby
alfiemax has joined #ruby
veduardo has joined #ruby
camfowler has quit [Quit: Changing server]
sepp2k has quit [Quit: Leaving.]
jenrzzz has quit [Ping timeout: 240 seconds]
troys is now known as troys_
alfiemax has quit [Ping timeout: 256 seconds]
roshanavand has joined #ruby
milardovich has joined #ruby
dwickern has quit [Ping timeout: 248 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Dark_Arc has quit [Ping timeout: 240 seconds]
x77686d has quit [Quit: x77686d]
Dark_Arc has joined #ruby
RougeR has quit [Ping timeout: 268 seconds]
camfowler has joined #ruby
Azure|dc is now known as Azure
oleo has quit [Ping timeout: 265 seconds]
imode has joined #ruby
mtkd has quit [Ping timeout: 256 seconds]
mtkd has joined #ruby
vichib has joined #ruby
gothicsouth has joined #ruby
xuyuheng has joined #ruby
jaequery has quit [Ping timeout: 260 seconds]
jottr_ has quit [Ping timeout: 240 seconds]
Dimik has quit [Ping timeout: 240 seconds]
camfowler has quit [Quit: leaving]
sameerynho has quit [Ping timeout: 268 seconds]
camfowler has joined #ruby
workmad3 has joined #ruby
orbyt_ has joined #ruby
dstrunk has joined #ruby
alfiemax has joined #ruby
gizmore|2 has joined #ruby
headius has quit [Ping timeout: 268 seconds]
veduardo has quit [Ping timeout: 246 seconds]
headius has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
howdoi has joined #ruby
gizmore has quit [Ping timeout: 248 seconds]
mjolnird has quit [Remote host closed the connection]
jsaak has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pastorinni has joined #ruby
phate408 has joined #ruby
jrafanie has joined #ruby
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
guardianx has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xuyuheng has quit [Ping timeout: 264 seconds]
neo95 has joined #ruby
neo95 has quit [Client Quit]
neo95 has joined #ruby
neo95 has quit [Client Quit]
neo95 has joined #ruby
justinfaler has joined #ruby
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pastorinni has quit [Remote host closed the connection]
gix- has joined #ruby
gix has quit [Disconnected by services]
guardianx has quit []
armyriad has joined #ruby
workmad3 has joined #ruby
consti has quit [Quit: consti]
alfiemax has joined #ruby
neo95 has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 248 seconds]
xuyuheng has joined #ruby
Emmanuel_Chanel has joined #ruby
dviola has quit [Quit: WeeChat 2.0.1]
nadir has quit [Quit: Connection closed for inactivity]
alfiemax has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
Yzguy has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fezzler has joined #ruby
cadillac_ has quit [Ping timeout: 248 seconds]
crankharder has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
cadillac_ has joined #ruby
dkphenom has joined #ruby
bronson has quit [Ping timeout: 246 seconds]
xuyuheng has quit [Ping timeout: 240 seconds]
dnmeir has joined #ruby
<dnmeir>
/amsg Attention! If you are using FreeNode, consider that you *must* obey scientific, political and historical beliefs of a small group of people that own that private network, otherwise you will be restricted access, read more: https://gist.github.com/anonymous/0f9852b8aaf409c626d117cc8c9aaa2f
<dnmeir>
/amsg Attention! If you are using FreeNode, consider that you *must* obey scientific, political and historical beliefs of a small group of people that own that private network, otherwise you will be restricted access, read more: https://gist.github.com/anonymous/0f9852b8aaf409c626d117cc8c9aaa2f
<dnmeir>
/amsg Attention! If you are using FreeNode, consider that you *must* obey scientific, political and historical beliefs of a small group of people that own that private network, otherwise you will be restricted access, read more: https://gist.github.com/anonymous/0f9852b8aaf409c626d117cc8c9aaa2f
<audy>
noocx: I think these are kind of like helpers for handling different form types?
znz_jp has quit [Quit: kill -QUIT $$]
troys_ is now known as troys
<noocx>
maybe, I don't know, got some basic rails knowleedge, but I'm a total newbie
<noocx>
neither know ruby, only some basic things
<audy>
noocx: you know any other object oriented language?
<noocx>
but what do they do in the model folder?
<noocx>
if they are form helpers
<audy>
noocx: not sure why they're in the model dir
apeiros__ is now known as apeiros
milardovich has quit []
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<noocx>
there are custom fields in openproject with some fix types, I think these are the types
thejamespinto has quit [Remote host closed the connection]
EvilJStoker has joined #ruby
<noocx>
so you can create a custom field and you need to choose a defined type for it
<noocx>
you choose from these custom values
<audy>
noocx: sometimes people stick classes in the model dir even though they're not Models. The CanCanCan lib uses an Ability model to define user permissions that goes in models/
trautwein has joined #ruby
<noocx>
audy: ok its clearer now thanks
crankharder has joined #ruby
znz_jp has joined #ruby
<noocx>
I've got 1 hour to understand openproject's structure, learn ruby and rails and write a plugin:D
<noocx>
how should i reach this?:D
sidx64 has joined #ruby
<nso95>
Time travel
<noocx>
:)
jtdoncas has joined #ruby
apeiros has quit [Remote host closed the connection]
<noocx>
am I right if I say this openproject doesnt follow the proper rails way to solve things?
KeyJoo has joined #ruby
jtdoncas_ has quit [Ping timeout: 240 seconds]
<noocx>
or this is how a complex rails app looks like?
sidx64 has quit [Client Quit]
<audy>
noocx: I think sticking things in models/ that don't inherit from ActiveRecord is probably not 100% rails way since they can just go in lib/
darkhanb has joined #ruby
<audy>
noocx: but a lot of people seem to do it so maybe it's a popular convention
<noocx>
hm thanks, I learned something now:)
sidx64 has joined #ruby
dionysus69 has joined #ruby
<audy>
noocx: do any models include these classes? maybe then it makes sense
<noocx>
checking
<audy>
noocx: classes that are included into models are now called "concerns" but that's a relatively new thing in rails
jtdoncas_ has joined #ruby
<noocx>
this op uses 5.0.6 rails or something
<noocx>
5.0.x
<audy>
noocx: this could have been added long ago before rails 5
<noocx>
ok
jtdoncas has quit [Ping timeout: 248 seconds]
conta has joined #ruby
sidx64_ has joined #ruby
sidx64 has quit [Ping timeout: 256 seconds]
sidx64 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
<noocx>
what is the config/initializers folder for?
<audy>
noocx: it's for initializers ;)
<noocx>
:D
<audy>
noocx: usually it's for setting up other gems
ur5us has joined #ruby
kies has joined #ruby
<audy>
noocx: setting options
<noocx>
thanks
<audy>
noocx: what's your plugin?
<audy>
why do you only have an hour to write it?
<noocx>
cause i ran out of time
<audy>
procrastination?
<noocx>
but i wont be able to do this, so
<noocx>
yes, something like that and i dont have the knowledge to finish this
<noocx>
in time
crankharder has quit [Ping timeout: 256 seconds]
<noocx>
need to create a plugin which gives some custom fields where you can select data from an external database, need to show dynamic dropdowns with related data on form, etc
dionysus69 has quit [Ping timeout: 240 seconds]
<noocx>
and you need to be able to use this as a new custom field in openproject
andikr has joined #ruby
<audy>
noocx: is the external database delivered via API or a separate SQL database?
<noocx>
separate
<noocx>
with 3-4 connected tables
<audy>
noocx: hmm.. never used multiple DBs with Rails. There's probably a way to connect certain models to certain DBs
<noocx>
and you need to be able to add these fields from those tables to a task for example in op
<noocx>
yes, that part is easy
<audy>
noocx: I would probably create an API endpoint on the app that's running the separate database and then do the rest with javascript + jquery
<audy>
.. and not touch much in openproject outside of the views
<noocx>
additionally openprojects uses angular
<noocx>
-s
<audy>
ah. then I'd use angular instead of jquery maybe
<audy>
but still not touch the other app's database directly
<noocx>
hm
<noocx>
Ive got zero knowledge with angular too:/
<noocx>
and additionally they tell me how to do things, so I think I cant make it that way how you suggest
<audy>
noocx: is the other DB another rails app?
<noocx>
no, its some php thing
za1b1tsu has joined #ruby
<audy>
noocx: if the php app's DB schema changes, now you have to update two apps
<noocx>
but they messed that up too:D
<noocx>
cause they wanted me to just read some data, forget consistency etc
Hobbyboy has quit [Ping timeout: 265 seconds]
<noocx>
they need autocompletion with existing data and additionally they want to be able to add new! data in openproject, but not in the source db..
<noocx>
but they want to see the new data to when someone creates a new task or something:)
<noocx>
too*
<noocx>
so its a messy thing
keyjoo_ has joined #ruby
<audy>
noocx: so they want the PHP app to read OpenProject's DB as well?
<noocx>
no!:D
<noocx>
thats the point
<noocx>
thats why its messy, and cant be solved that way
<noocx>
so you cant write back to the source db
<noocx>
neither can store in rails db
<noocx>
i mean the fields what you need to select from at task creation
<noocx>
cause you read that data from the source db
amatas has joined #ruby
Hobbyboy has joined #ruby
KeyJoo has quit [Ping timeout: 265 seconds]
<noocx>
ok i lost the project(out of time):D
<noocx>
anyway, thanks for your help
al2o3-cr is now known as c5h8no4na
claudiuinberlin has joined #ruby
<noocx>
bye
noocx has quit [Quit: leaving]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
keyjoo_ has quit [Quit: Good luck! Have a nice Day!]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
KeyJoo has joined #ruby
ghoti has quit [Ping timeout: 276 seconds]
x77686d has quit [Quit: x77686d]
ghoti has joined #ruby
TomyWork has joined #ruby
Burgestrand has joined #ruby
aufi has joined #ruby
dionysus69 has joined #ruby
axsuul has quit [Ping timeout: 248 seconds]
skweek has joined #ruby
crankharder has joined #ruby
conta has quit [Ping timeout: 256 seconds]
nofxx_ has joined #ruby
axsuul has joined #ruby
conta has joined #ruby
cdg has joined #ruby
mark_66 has joined #ruby
nofxx has quit [Ping timeout: 248 seconds]
cdg has quit [Ping timeout: 240 seconds]
jtdoncas_ has quit [Ping timeout: 256 seconds]
apeiros has joined #ruby
mlehrer has quit [Ping timeout: 268 seconds]
mlehrer has joined #ruby
rahul_bajaj has joined #ruby
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
nowhereman_ has quit [Ping timeout: 240 seconds]
aero-224 has joined #ruby
rabajaj has quit [Ping timeout: 240 seconds]
_main_ has joined #ruby
rabajaj has joined #ruby
mjolnird has quit [Ping timeout: 276 seconds]
rahul_bajaj has quit [Ping timeout: 260 seconds]
__main__ has quit [Ping timeout: 268 seconds]
_main_ is now known as __main__
rahul_bajaj has joined #ruby
workmad3 has joined #ruby
bruce_lee has joined #ruby
nowhereman_ has joined #ruby
rabajaj has quit [Ping timeout: 240 seconds]
yohji has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
arne has quit [Quit: leaving]
workmad3 has quit [Ping timeout: 256 seconds]
alfiemax_ has joined #ruby
KeyJoo has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 264 seconds]
mjolnird has joined #ruby
crankharder has quit [Ping timeout: 248 seconds]
conta has quit [Ping timeout: 265 seconds]
justinfaler has quit [Ping timeout: 260 seconds]
mtkd has quit [Ping timeout: 260 seconds]
mtkd has joined #ruby
Dimik has quit [Ping timeout: 248 seconds]
mlehrer has quit [Ping timeout: 240 seconds]
jnollette has quit [Remote host closed the connection]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
careta has joined #ruby
thejamespinto has joined #ruby
naprimer2 has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
nadir has joined #ruby
<careta>
hey guys, I'm using Process.spawn to start this "java -DdebugTrial='ohc' -cp MainClass 'df -h'". However, when using ps to look at what is run, it looks like Ruby is exec'ing without the single quotes
<careta>
how can I force it to keep the single quotes when invoking the command?
skweek has quit [Remote host closed the connection]
za1b1tsu has quit [Read error: Connection reset by peer]
mlehrer has joined #ruby
za1b1tsu has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has joined #ruby
crankharder has joined #ruby
<apeiros>
careta: single quotes are evaluated by the shell. they are never really part to what your executable sees.
<careta>
apeiros, but this makes a big difference when invoking programs ; if you pass something between '' the shell will interpret that as a single argument
<apeiros>
correct
<apeiros>
but it will not pass the quotes
<apeiros>
and hence ps won't see it either
<careta>
while if I do it within ruby, even including the shell, the quotes will not be preserved, but running on the command line will
faces has joined #ruby
<careta>
apeiros, to make things simple - how can I invoke the process in ruby in the same way I do it in the shell?
<careta>
because if I invoke using the same command line args as in the shell, it will get passed as multiple arguments to the callee, instead of a single one
crankharder has quit [Ping timeout: 248 seconds]
<apeiros>
spawn("java -DdebugTrial='ohc' -cp MainClass 'df -h'") will invoke it exactly the way it'd be invoked when running `java -DdebugTrial='ohc' -cp MainClass 'df -h'` in the shell
<apeiros>
you not seeing the quotes in ps is you having wrong expectations. you won't see the quotes in ps if you invoke java this way directly either.
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
conta has joined #ruby
rabajaj has joined #ruby
bronson has joined #ruby
helpa has quit [Remote host closed the connection]
jaruga has joined #ruby
helpa has joined #ruby
DTZUZU has quit [Read error: Connection reset by peer]
rahul_bajaj has quit [Ping timeout: 260 seconds]
<careta>
apeiros, ok I see. But any idea why this works when called from the command line, but not from ruby, with the exact same command?
DTZUZU has joined #ruby
<apeiros>
no. mainly because "does not work" is not at all a helpful problem description.
<apeiros>
a likely cause is a different env than the env a login shell has.
rabajaj has quit [Remote host closed the connection]
<careta>
the Java class parses the first argument given on the command line; for example with java -DdebugTrial='ohc' -cp MainClass 'df -h', the Java class will see the last arg as 'df -h'. But when calling from ruby, it's only seeing 'df'
rabajaj has joined #ruby
marxarelli|afk has quit [Ping timeout: 256 seconds]
bronson has quit [Ping timeout: 248 seconds]
c5h8no4na is now known as al2o3-cr
InfinityFye has joined #ruby
naprimer2 has joined #ruby
yohji has quit [Ping timeout: 248 seconds]
Mike11 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
InfinityFye has left #ruby ["Leaving"]
tomphp has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
alfiemax has joined #ruby
tomphp has quit [Client Quit]
tomphp has joined #ruby
<apeiros>
careta: I can't tell you why that is. if I run e.g. `spawn("ruby -e 'p ARGV' -- -DdebugTrial='ohc' -cp MainClass 'df -h'")`, I get ["-DdebugTrial=ohc", "-cp", "MainClass", "df -h"] as output. i.e. "df -h" is passed as one argument.
alfiemax_ has joined #ruby
tomphp has quit [Client Quit]
alfiemax has quit [Ping timeout: 255 seconds]
yohji has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
<apeiros>
I think there's one part of the equation missing in your description
chmurifree is now known as chmuri
jenrzzz has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
guille-moe has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
tcopeland_ has joined #ruby
tcopeland has quit [Read error: Connection reset by peer]
tcopeland_ is now known as tcopeland
Beams has joined #ruby
tomphp has joined #ruby
tvw has joined #ruby
Serpent7776 has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
yohji has quit [Quit: Leaving]
yohji has joined #ruby
mkaito has quit [Read error: Connection reset by peer]
alfiemax has joined #ruby
mkaito has joined #ruby
alfiemax_ has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
shorberg has quit [Ping timeout: 256 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnyw has quit [Ping timeout: 246 seconds]
crankharder has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Cavallari has joined #ruby
Cavallari has quit [Client Quit]
marr has joined #ruby
vichib has joined #ruby
shorberg has joined #ruby
jnyw has joined #ruby
zipace has quit [Ping timeout: 265 seconds]
xuyuheng has quit [Ping timeout: 260 seconds]
tvw has quit [Remote host closed the connection]
xuyuheng has joined #ruby
alfiemax has quit [Remote host closed the connection]
jenrzzz_ has quit [Ping timeout: 256 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
imode has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
ldnunes has joined #ruby
Ltem has joined #ruby
crankharder has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
sidx64 has joined #ruby
ur5us has quit [Remote host closed the connection]
minas has joined #ruby
ur5us has joined #ruby
minas has quit [Client Quit]
segy has quit [Ping timeout: 240 seconds]
yohji has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
bkxd has quit [Max SendQ exceeded]
mtkd has quit [Ping timeout: 256 seconds]
guille-moe has quit [Ping timeout: 256 seconds]
mtkd has joined #ruby
roshanavand has quit [Quit: Leaving.]
roshanavand has joined #ruby
yohji has joined #ruby
roshanavand has quit [Client Quit]
cdg has joined #ruby
roshanavand has joined #ruby
guille-moe has joined #ruby
<marahin>
Hello! What is the most elegant way to parse 60010 to be 600.10, 600 to become 6.00, 50 to become 0.50?
<marahin>
(So an integer or a string into a decimal number with two point precision)
cdg has quit [Ping timeout: 264 seconds]
<marahin>
"#{num/100}.#{num%100}" is the basic one, but it will parse 500 into 5.0 instead of 5.00.
<apeiros>
so you mean "60010" and not 60010?
<apeiros>
wait… so you also mean the output should be "600.10" not 600.10?
<apeiros>
(those differences matter)
crankharder has joined #ruby
<apeiros>
60010 -> Integer
leitz has joined #ruby
<apeiros>
"60010" -> String
bkxd has joined #ruby
<apeiros>
600.10 does not exist and is really 600.1 -> Float
* apeiros
waits for clarification before answering
tvw has joined #ruby
bkxd_ has joined #ruby
bronson has joined #ruby
tobiasvl has quit [Ping timeout: 255 seconds]
RougeR has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
RougeR is now known as Guest47493
jnyw has quit [Quit: WeeChat 2.0.1]
tvl has joined #ruby
tvl is now known as tobiasvl
nadir has quit [Quit: Connection closed for inactivity]
bronson has quit [Ping timeout: 265 seconds]
<apeiros>
marahin: ok, >10min and not a blip. I'll assume you aren't actually interested in an answer. it's rather rude, though.
<marahin>
apeiros I'm very sorry!
<marahin>
I threw a question and expected a highlight, as most of the messages here are the join/part ones :(
<apeiros>
you got an immediate response…
<marahin>
Well, twelve seconds were enough for me to jump into ruby docs again and look for a formatting methods :)
<marahin>
I'm sorry again, really didn't mean anything, just tough morning where I'm struggling to focus.
* apeiros
notes to self to highlight even immediate replies.
<marahin>
apeiros input is integer, output could be either float or string (basically anything that can be later casted 'to string', and will be in format of INTEGER_PART.TWO_DECIMAL_POINTS)
Burgestrand has quit [Quit: Closing time!]
<apeiros>
well, two decimals isn't float. that's string.
<apeiros>
so: int.fdiv(100) will get you the float
<apeiros>
`"%.2f" % float` will get you the string with two digits
<marahin>
You're correct I suppose. What I mean is that I want to get a number containing two numbers after the integer part.
<marahin>
this is what I'm having now, and it seems to work fine
<marahin>
but I'm wondering if there's any nicer solution :P.
<apeiros>
`"#{amount / 100}.#{amount % 100}".to_f` is a rather expensive way of saying `amount.fdiv(100)`
<marahin>
that's correct, I'm gonna change that :)
<apeiros>
`sprintf format, *args` is the same as `format % args`. I use both. matter of preference. but yeah, that's what I'd use to get the representation you're looking for.
<marahin>
I'll stick to sprintf, but it's nice to know that
<marahin>
thank you apeiros, I really didn't mean to be rude
<apeiros>
it's ok. I'll remember to highlight.
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
plexigras has joined #ruby
shorberg has quit [Quit: shorberg]
rabajaj has quit [Quit: Leaving]
raynold has quit [Quit: Connection closed for inactivity]
roshanavand has quit [Quit: Leaving.]
crankharder has quit [Ping timeout: 260 seconds]
Guest47493 has quit [Ping timeout: 265 seconds]
shorberg has joined #ruby
shorberg has quit [Read error: Connection reset by peer]
shorberg has joined #ruby
shorberg has quit [Remote host closed the connection]
howdoi has quit [Quit: Connection closed for inactivity]
qba73 has joined #ruby
shorberg has joined #ruby
bkxd_ has quit []
tomphp has joined #ruby
tomphp has quit [Client Quit]
belmoussaoui has joined #ruby
yohji has quit [Ping timeout: 240 seconds]
nadir has joined #ruby
milardovich has joined #ruby
yohji has joined #ruby
crankharder has joined #ruby
justicefries has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
hurricanehrndz has quit [Ping timeout: 248 seconds]
boshhead has quit [Remote host closed the connection]
justicefries has quit [Client Quit]
creeg has quit [Quit: No Ping reply in 180 seconds.]
justicefries has joined #ruby
audy has quit [Ping timeout: 268 seconds]
boshhead has joined #ruby
Nilium has quit [Ping timeout: 248 seconds]
ahuman has quit [Quit: No Ping reply in 180 seconds.]
jottr_ has joined #ruby
creeg has joined #ruby
mtkd has joined #ruby
ahuman has joined #ruby
Nilium has joined #ruby
qba73 has quit [Ping timeout: 256 seconds]
cdg has joined #ruby
audy has joined #ruby
Guest47493 has joined #ruby
hurricanehrndz has joined #ruby
qba73 has joined #ruby
segy has joined #ruby
<careta>
apeiros, I've been living in hell for hours now, trying to understand what is going on. All I know is that the command started from the terminal works fine, but when started by ruby it doesn't. I've even edited the Java class to make sure the arguments received are the same, and they are the same.
<careta>
so if you have any idea let me know
<careta>
maybe some encoding problem?
<careta>
black magic?
cdg has quit [Ping timeout: 264 seconds]
<apeiros>
that's difficult to remote debug. since you managed to rule out argument differences, the remaining main culprit is env differences.
<apeiros>
your login shell usually executes a lot of scripts when starting, loading various env variables
<careta>
apeiros, I'm going to make a full pastebin to show you. I've even dumped the env, and they are the same
<apeiros>
Kernel.spawn however will be a mostly pristine shell
<apeiros>
ok
<apeiros>
same env and same args, yet still different results. that's weird.
raynold has joined #ruby
Guest47493 has quit [Ping timeout: 264 seconds]
<careta>
apeiros, Jesus Christ, all I needed was a sleep 5
<careta>
4 hours wasted
<apeiros>
wait, what?
apparition has joined #ruby
<apeiros>
what's the purpose of the sleep? wait for the subprocess to terminate?
crankharder has quit [Ping timeout: 265 seconds]
ur5us has joined #ruby
<careta>
apeiros, it's because the java command actually starts a server, and as you know java is pretty slow, so takes a while to startup
<careta>
the remote host was trying to connect straight away because I did a detach
<careta>
and then sending another request - basically the remote host was trying to connect while the java server was still starting up
<careta>
so putting a short delay after invoking the java process sorted it out
VladGh has quit [Quit: Lost terminal]
trautwein has quit [Quit: trautwein]
ur5us has quit [Ping timeout: 240 seconds]
VladGh has joined #ruby
thejamespinto has quit [Ping timeout: 276 seconds]
<apeiros>
careta: well, it a plain sleep you'll eventually run into timing issues
sepp2k has joined #ruby
qba73 has quit [Ping timeout: 240 seconds]
sidx64 has joined #ruby
crankharder has joined #ruby
Ltem has quit [Ping timeout: 265 seconds]
jrafanie has joined #ruby
crankharder has quit [Ping timeout: 264 seconds]
alex`` has quit [Quit: WeeChat 1.9]
marr has quit [Ping timeout: 255 seconds]
troulouliou_div2 has joined #ruby
alfiemax has joined #ruby
voxxit has quit [Ping timeout: 248 seconds]
synthroid has joined #ruby
jaruga has quit [Quit: jaruga]
synthroi_ has joined #ruby
aufi_ has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgestrand has joined #ruby
aufi has quit [Ping timeout: 263 seconds]
jaruga has joined #ruby
synthroid has quit [Ping timeout: 276 seconds]
nowhereman_ has joined #ruby
govg has quit [Ping timeout: 256 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arne has joined #ruby
<arne>
don't you guys think
<arne>
there should be a shorthand for
<dminuoso>
No.
<arne>
method { x }
<arne>
dminuoso: so meany
bronson has joined #ruby
sidx64 has joined #ruby
<dminuoso>
arne: strictly speaking there is a shorthand.
<dminuoso>
method(&callable)
<dminuoso>
which lets you avoid the explicit block
<arne>
well but callable would be
jaruga has quit [Quit: jaruga]
<dminuoso>
proc/lambda
<dminuoso>
or anything that implements #to_proc
<arne>
->() { x }
<arne>
then
rwb has quit [Ping timeout: 248 seconds]
<dminuoso>
arne: Yeah but you gain a lot of expressivitiy if you stop using blocks.
<dminuoso>
blocks are a kind of silly feature if you think about it a while.
<arne>
i like them, best thing about ruby
<arne>
i want something like $ in haskell
<dminuoso>
arne: what do you like about them?
<arne>
uhm.. fake-dsls
<dminuoso>
arne: you dont need blocks to do that.
<dminuoso>
you just need appropriate combinators.
<dminuoso>
arne: and in the end, is ->{ so much worse than just { ?
<dminuoso>
(you dont need () for a noarg lambda)
Sina has joined #ruby
<dminuoso>
i.e.
<arne>
for them too be looking good, i do
<arne>
dminuoso: i never said
<arne>
but
<arne>
imho sometimes
<arne>
if(pred) something(); looks better than if(pred){something();}
govg has joined #ruby
<dminuoso>
arne: that is not a block incidentally.
<arne>
yes, same principle
Psybur has joined #ruby
vichib has quit [Ping timeout: 264 seconds]
<arne>
if there is only one instruction you don't need {}
<arne>
same thing for blocks in ruby
<arne>
i'd like
<dminuoso>
but yeah I agree, that the less noise the better
<dminuoso>
arne: and thats kind of my point incidentally.
<dminuoso>
arne: because blocks force you to use ugly and non-expressive {}, and you have to specify points
bronson has quit [Ping timeout: 276 seconds]
<dminuoso>
f { |a| a.first }
<dminuoso>
f &:first
<dminuoso>
one is more expressive :)
<arne>
well you can do do.. end
<arne>
which i like
<dminuoso>
arne: for a dsl it's fine sometimes I guess.
<dminuoso>
for actual coding its not
<dminuoso>
arne: also re $, I fully and whole heartedly agree.
<dminuoso>
at least (.) can easily be hacked into ruby without much effort
govg has quit [Ping timeout: 240 seconds]
nfk has joined #ruby
govg has joined #ruby
<dminuoso>
arne: regarding your initial question, you can simply write your own combinator for this.
troulouliou_div2 has quit [Quit: Leaving]
<arne>
well it would look more ugly than the original thing, right?
<dminuoso>
not necessarily
<dminuoso>
sec
bmurt has joined #ruby
voxxit has joined #ruby
<dminuoso>
arne: Oh I know...
<dminuoso>
arne: semantically what you want is x itself to be a proc. then you would just pass it.
<dminuoso>
(or better yet lambda, since procs are kind of weird)
Psybur_ has joined #ruby
<dminuoso>
arne: but it would require half of ruby to accept lambdas instead of blocks (bringing us back to my original argument that blocks are bad)
<dminuoso>
i.e. would be cool if you could do [1,2,3].map(some_proc)
minimalism has quit [Quit: minimalism]
<dminuoso>
dunno, but I suspect this must have been discussed already in a PR.
Psybur has quit [Disconnected by services]
Psybur_ is now known as Psybur
Psybur has quit [Changing host]
Psybur has joined #ruby
<arne>
c0ol
<dminuoso>
arne: In my library you can even do that, rigged with * to act as (.)
<veloutin>
dminuoso: you mean specifically with a proc? [1,2,3].map(&method(:some_method)) does work
<dminuoso>
arne: you can do stuff like [1.2.3].map to_s * double
<veloutin>
right. I was wondering if it was specifically a proc you wanted, or other "callables" would work.
maum has quit [Remote host closed the connection]
<veloutin>
you can avoid [1,2,3].map{|x| some_method(x)} with &method(...), but not [1,2,3].map{|x| some_proc.(x)}
<dminuoso>
veloutin: Well once I find some time Im gonna finish my library and publish it. It will contain some fixups to monkey patch most common functions that accept blocks to also work with lambdas instead.
<dminuoso>
But ultimately you get into this rabbit hole where this is not truly useful until you have properly curried lambdas everywhere.
<veloutin>
coming from a py background, it's definitely wonkier to try to pass callables around in ruby heh
<dminuoso>
veloutin: can you curry lambdas in py?
<tobiasvl>
lol
<dminuoso>
And I dont mean manually currying them.
<tobiasvl>
python lambdas are pretty useless
<tobiasvl>
only one statement
<dminuoso>
tobiasvl: the one thing python has going for itself is list comprehensions that were ruthlessly stolen from haskell.
<dminuoso>
well technically its just mimicing set builder notation from mathematics so...
<tobiasvl>
hehe, yep. but stealing things ruthlessly is fine :)
marr has joined #ruby
<dminuoso>
yup :)
<dminuoso>
I dont think there's any "original" language left still in use other than lisp..
AJA4350 has joined #ruby
<dminuoso>
even that could be debatable if you consider LC
k0mpa has quit [Ping timeout: 255 seconds]
thejamespinto has joined #ruby
jamied has joined #ruby
<veloutin>
dminuoso: there's a bunch of things you can do with callables, including partial(f, arg1)(arg2) === f(arg1, arg2)
<bawNg>
dminuoso: you think procs are kinda weird and prefer lambas? I avoid lambdas at all costs since they have different semantics to blocks/procs and are more limiting
<bawNg>
why on earth did someone decide that warning for uninitialized instance variables by default are a good idea? I usually just ignore warnings like that completely, but now that I want to publish a gem, I don't want to just leave them there
<bawNg>
seems like a terrible idea, now we have to choose between having stupid warnings being printed, or having worse performance
Mike11 has quit [Quit: Leaving.]
aupadhye has quit [Ping timeout: 248 seconds]
<dminuoso>
bawNg: If object creation is such a bottleneck that you need this optimization, I would consider it highly unlikely for Ruby to be the best language.
<bawNg>
accessing an uninitialized ivar is only about 10% slower than an initialized one, but using defined? @ivar to avoid the stupid warning is 16% slower for uninitialied, and 25% slower for an initialized ivar
<dminuoso>
bawNg: Why not simply initialize it./.
<dminuoso>
bawNg: The point is not to use `defined?`, in fact it rarely is a good idea to do so.
<dminuoso>
The point is to make initialization explicit.
<bawNg>
alternatively, you'd have to create the ivar when the object gets created, which means adding the overhead of setting an ivar for every object initialized, even if the ivar only gets used on 0.0001% of those kinds of objects
<bawNg>
again, this is just a pointless performance loss for the sake of saving some bad programmer who forgot about their variable some time
<dminuoso>
asm>> class C; def initialize; @f = nil; end; end
cdg has quit [Ping timeout: 276 seconds]
<dminuoso>
bawNg: Have you profiled the code with initializers? =)
<bawNg>
I'll just rewrite all this in C++ later to avoid the warning
<dminuoso>
Or is that your "feeling" ?
<bawNg>
dminuoso: I am about to release a scheduler extension which needs to fire timers with 2 us precision
<bawNg>
every nanosecond counts
qba73 has quit [Remote host closed the connection]
thejamespinto has quit [Ping timeout: 256 seconds]
qba73 has joined #ruby
<dminuoso>
bawNg: setinstancevariable is an optimized iseq.
<dminuoso>
bawNg: well op rather.
cdg has joined #ruby
<bawNg>
basically anything in ruby takes time, no matter what it is
<dminuoso>
bawNg: It's really negligeble. And anyway, if your performance constraints are that tight, its unlikely CRuby will be your friend.
<bawNg>
you can do a lot more from the native side with the C API
<dminuoso>
bawNg: Yes, that's because Ruby has really poor implementations.
<bawNg>
I know ivars are faster than most things, but they still take time
<dminuoso>
bawNg: If you need that tight control over internal execution, go native.
<bawNg>
I've already implemented the scheduler's timing, reactor and timer scheduler in C++, and I plan on rewriting most of the ruby code as native later to reduce the remaining overhead
<bawNg>
just don't have time to do that right now
<dminuoso>
bawNg: Id say setting an instance variable amounts to no more than maybe 100 cpu instructions, its not that much.
<dminuoso>
I wonder whether the real price lies in having an explicit #initialize method
<dminuoso>
someone should profile this :D
<dminuoso>
bawNg: though.. you can also simply ignore it. make a remark that if people want to "ruby -w" your code, they have to live with those warnings.
rwb has joined #ruby
<dminuoso>
I mean if you have legit reasons to use implicit initializations, then go for it.
<bawNg>
I did profile it, and it appears that setting the ivar is ~14% faster than using defined? @uninit, but the big catch is to benchmark it has to repeat the same ivar
<bawNg>
so you can't truely measure how long it takes to initialize an uninitialized ivar
<bawNg>
it's likely not much faster than using defined?, if it's faster at all
<dminuoso>
bawNg: do you already have an initialize method?
rrutkowski has joined #ruby
<dminuoso>
bawNg: it absolutely is faster.
<bawNg>
yeah
<bawNg>
the thing is, that ivar would almost never get used
<bawNg>
so it would make the most sense to leave it uninitialized until it actually is needed in rare cases
<dminuoso>
bawNg: the reason has to do with how defined? works, setinstancevariable has almost no indirection and amounts to a few dozens lines of C code.
<dminuoso>
but defined? is really really weird.
<dminuoso>
bawNg: indeed.
<bawNg>
the other big catch is, that is 1 less ivar that I can use
catphish has joined #ruby
<bawNg>
if you go over like 3 or 4 ivars, the ivars are allocated on the heap instead of inlined in the VALUE
<bawNg>
so then the whole object is considerably slower
<bawNg>
since there is indirection for the ivar lookups
<dminuoso>
right
<bawNg>
but it'll be fine for now, I'll reimplement it all in C++ at some point and avoid using ivars completely
<dminuoso>
bawNg: Im not very familiar with the internals of Truffle, but you should probably try that as well.
<bawNg>
for the timers I store everything in a native struct already, so there is no overhead of having to setup ivars on ruby objects
jaruga has joined #ruby
rrutkowski has quit [Client Quit]
<bawNg>
when ruby needs to check something, it makes a native call which checks the struct, which is way more efficient
rrutkowski has joined #ruby
<bawNg>
I'm only supporting MRI with this extension for now, have no plans on supporting other VMs anytime soon
<bawNg>
I personally only use MRI, and I wrote this extension for an open source project based on MRI
<dminuoso>
bawNg: Is your project an open source project? Or is it some closed source project?
<bawNg>
I'm going to publish the initial alpha as a gem today, just about finished cleaning it up and making it into a gem
<dminuoso>
Be sure to give me a ping, interested in what you are writing. :)
<apeiros>
"ivar only gets used on 0.0001%" sounds like a bad use case for an ivar
vichib has joined #ruby
Psybur_ has joined #ruby
rrutkowski has quit [Quit: rrutkowski]
DLSteve has joined #ruby
rrutkowski has joined #ruby
<dminuoso>
apeiros: Dunno whether frequency is relevant. It's just relevant whether that ivar is part of the objects internal state.
Psybur has quit [Ping timeout: 248 seconds]
<apeiros>
frequency alone is not
trautwein has joined #ruby
<apeiros>
but if you have a ton of very infrequently used ivars, you might be better off with a single ivar + hash
<apeiros>
but if you're after the last little bit of performance, then indeed IMO go native
Guest47493 has joined #ruby
Rapture has joined #ruby
jaruga_ has joined #ruby
qba73 has quit [Remote host closed the connection]
<bawNg>
I think I have everything ready to publish the gem now, I don't usually do gems
<apeiros>
but kudos for removing all warnings before publishing. wish all gems did that.
<bawNg>
dminuoso: ^
<apeiros>
I have warnings disabled because too many gems don't :<
<bawNg>
well I have gotten very used to ignoring warning completely, but I imagine they annoy a lot of people who actually care about them
<bawNg>
to me, warnings serve no purpose what so ever
<bawNg>
I've been using Ruby since before there were pretty much any of these warnings
<apeiros>
yeah. I think warnings are not thought through.
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qba73 has joined #ruby
<apeiros>
I think unused ivar warning exists for over a decade now
<apeiros>
*uninitialized
<apeiros>
at least I'm pretty sure it was in 1.8.0 when I started using ruby
<apeiros>
(I may of course be mistaken, and I no longer have a 1.8 installed to test)
<bawNg>
yeah the amount of warnings that I have in a typical large application means that they all just become a blur that my brain automatically ignores and I scroll past
jaruga has quit [Ping timeout: 255 seconds]
jaruga_ is now known as jaruga
<bawNg>
this is the first time I've actually paid attention to warnings in years
sidx64 has joined #ruby
sidx64 has quit [Client Quit]
Puffball has quit [Remote host closed the connection]
<apeiros>
it'd be nice if we at least could scope warnings and e.g do something like "disable all warnings from 3rd party code".
amatas_ has joined #ruby
<pwillard>
I get this error, and I don't recall changing anything. "C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-4.0.3/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now"
<pwillard>
(well, ok "warning")
shorberg has quit [Quit: shorberg]
rrutkowski has quit [Read error: Connection reset by peer]
shorberg has joined #ruby
qba73 has quit [Ping timeout: 246 seconds]
<apeiros>
pwillard: changed the ruby version?
rabajaj has joined #ruby
<bawNg>
had to fight with hoe to get the gem to publish, it doesn't like parsing URLs from a markdown readme
<bawNg>
but it's published now
jrafanie has joined #ruby
<pwillard>
I didn't think I did... changing ruby version is non-trivial, right?
<apeiros>
👍🏻
<apeiros>
pwillard: depends. for me it's `rvm use <version>`, which I'd say is trivial :)
<pwillard>
Hmmm
<apeiros>
or even just cd into a project with a .ruby-version file.
<pwillard>
I've just never seen that warning before
<bawNg>
if anyone needs high precision timers or wants to replace native threads with light weight jobs which run in pooled fibers (along with replacements for common threaded functionality like #join, #kill, sleep, mutexesa nd conditional variables), you can take a look at the repo I linked above
<apeiros>
bawNg: that actually sounds quite interesting
<bawNg>
I created the high precision scheduler specifically so that I can replace hundreds of native threads in an open source project with light weight fibers, the functionality included with the gem allowed me to almost swap out all the threads directly with few additional changes
workmad3 has joined #ruby
rabajaj has quit [Client Quit]
<bawNg>
I plan on refactoring the project later, since a lot of synchronization and other overhead is how redundant without native threads, but it's nice to be able to swap things out and have them work with as few changes as possible
<apeiros>
bawNg: do you have any benchmarks wrt performance gains?
<bawNg>
(the open source project I'm referring to is Sonic Pi)
<bawNg>
it no longer supports low end hardware like first and second generation Raspberry Pi's, I hope to be able to change that in the future
<pwillard>
Ok. Updating activesupport from 4.0.3 to 5.1.4 made warning go away
xuyuheng has quit [Ping timeout: 248 seconds]
<bawNg>
apeiros: it's hard to compare performance when there is a ton of overhead in the code base itself, I imagine the performance gain will be reasonable small on high end hardware with the direct port, but once I refactor and remove all the remaining stuff that was needed for threads, it will be considerably faster
jottr_ has quit [Ping timeout: 248 seconds]
<bawNg>
I need to optimize the remaining bottlenecks in the code base itself too, but most of that requires heavy refactoring which I need to find time to work on
xuyuheng has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
apparition has quit [Quit: Bye]
<bawNg>
also, if anyone here uses OSX and would like to try build the gem and run the tests, I'd appreciate that
careta has quit [Ping timeout: 240 seconds]
<bawNg>
I don't have OSX to test with, but I did implement high precision timer support for OSX
ur5us has joined #ruby
<dminuoso>
bawNg: Ill do that when Im home :)
rabajaj has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
Guest47493 has quit [Ping timeout: 246 seconds]
<bawNg>
dminuoso: thanks, just drop me a ping whenever you get around to it
qba73 has joined #ruby
<apeiros>
bawNg: there's no gemspec? o0
sundhell is now known as sundhell_away
<apeiros>
oh, hoe…
rippa has joined #ruby
<bawNg>
yeah I have mixed feelings about hoe, but it works, so good enough
<apeiros>
you might want to consider to add a Gemfile, helps developers with getting all dev gems installed
<apeiros>
alternatively if it's possible with hoe, a built gemspec, since that can contain dev deps too
<bawNg>
I can do that, hoe allows you to generate one to include in a repo
<apeiros>
which gems do I need to have installed to build it?
<bawNg>
only dependency is minitest
<apeiros>
that does not seem correct
tcopeland has quit [Quit: tcopeland]
<bawNg>
well and rake-compiler
<apeiros>
and hoe
<bawNg>
well that's a given, haha
<apeiros>
ok, rake test is running now.
ur5us has quit [Ping timeout: 255 seconds]
trautwein has quit [Quit: trautwein]
<bawNg>
maybe one day I'll be able to find time to wrap libuv and add IO support to this gem, then I can use it instead of eventmachine for many applications, but I doubt I'll get to that anytime soon
<apeiros>
hm, is rake test not self-contained? "Could not find 'actuator' (>= 0) among 118 total gem(s)"
<bawNg>
oh damn, I forgot to revert my test change
<bawNg>
I'm not too worried about warnings in the C/C++ compilation, they should all be harmless
<bawNg>
I'll try reduce the amount of warning spam when I rewrite more ruby into native
shinnya has joined #ruby
<apeiros>
that's fine. the tests are expected to take a while to run?
<apeiros>
asking because "000000.000 WARN Timer::Schedule() called before delay was set" is the only output for the last 2min
<bawNg>
that sounds very broken
<bawNg>
are you on OSX?
<apeiros>
yes, high sierra
<apeiros>
ruby 2.5.0
<bawNg>
damn, that sucks
<bawNg>
I will have to try figure out why that is broken, without being able to reproduce and test
<apeiros>
ctrl-C interrupts at actuator/lib/actuator.rb:11:in `start'
<dminuoso>
bawNg: You naughty.
<dminuoso>
All those C style casts. :(
<bawNg>
I use as little C++ as possible :P
<bawNg>
this is the most C++ I've used in years actually
<dminuoso>
bawNg: Well if you do, please use static_cast instead. :-)
<bawNg>
I can't wait for Jai to be released, so that I can use it instead of C and C++
<dminuoso>
C style casts are the best way to hide bugs.
<dminuoso>
Anyway
Gnukpd has joined #ruby
<apeiros>
Jai?
<bawNg>
apeiros: what you can try do for me, is enable debug log level and set a debug log file so that it goes to the file instead of spamming stdout
<apeiros>
tell me how and I'll do
<bawNg>
the debug log level will spam a lot, but hopefully it'll include something useful, otherwise I'll have to add even more
Ltem has joined #ruby
<dminuoso>
bawNg: Ill send a PR later :)
<bawNg>
Log.file_path = "actuator.log"
<bawNg>
Log.level = :debug
<bawNg>
I didn't test any of that, since I added it just for the gem, hopefully it works :P
thejamespinto has joined #ruby
<apeiros>
where do I put that code? test/setup_test.rb?
<bawNg>
yeah you can just put it at the top after the gem is required
cagomez has joined #ruby
<bawNg>
Jai is a systems programming language that aims to be a C/C++ replacement that is ideal for game devs, it allows you to write code that is even more efficient than C++, it has no headers, it compiles a full game and engine in 500ms instead of an hour like C++
<bawNg>
it has insanely powerful compile-time metaprogramming and polymoric support that puts all other languages to shame
Guest47493 has joined #ruby
<bawNg>
it will hopefully be released by this time next year
<dminuoso>
bawNg: I find it very unlikely that an implementation that can compile a full game engine in 500ms to produce more effective code than an equivalent engine written in C++.
<apeiros>
uh, Log is native? it raises :D
<bawNg>
well it's done, I've been tracking the development of it for a while now
<apeiros>
it wants a symbol instead of a string for file_path=
<bawNg>
the game engine will be open sourced with the language
<dminuoso>
bawNg: Part of the reason why compilation is so slow is just the monstreous optimization passes the compiler has to go through.
<dminuoso>
Also, people should stop using C++ and start using Rust.
<bawNg>
almost all developers don't write efficient code these days
<darix>
dminuoso: c++ templating and stuff makes compile time explode easily
<bawNg>
compiler devs are apparently no different
<bawNg>
but even C++ vtables are slow due to indirection and cache invalidation
<bawNg>
Jai doesn't have that problem
Gnukpd has quit [Quit: Leaving]
<bawNg>
Rust forces everyone to learn new ways of writing code that ensure you can't make a mistake, all the safety introduces overhead and the learning curve of learning all the different ways of doing things requires time
cagomez has quit [Remote host closed the connection]
<bawNg>
Jai gives you the power to do things however you like, you can be unsafe and break things, there are no training wheels
<dminuoso>
You can also do unsafe things in Rust.
<bawNg>
but that means that you can write insanely efficient code, which works very well with the CPU caches
pastorinni has joined #ruby
<bawNg>
Jai will even support transparent SoA out of the box
thejamespinto has quit [Remote host closed the connection]
<dminuoso>
darix: I guess its not ideal yeah.
thejamespinto has joined #ruby
<dminuoso>
If only Rust had higher kinded types.. =)
<bawNg>
I'm really excited about a lot of the problems that Jai solves, many of which most programmers and languages don't even consider to be problems
<bawNg>
these days writing inefficient software that wastes CPU cycles is just considered normal, hardware is big enough to handle it in many cases, but you could do so much more in so much less time if you actually did things efficiently
<darix>
bawNg: all those safety restrictions make your code faster
<bawNg>
some do, but many things introduce overhead, and all that overhead adds up
aonemd has joined #ruby
<dminuoso>
bawNg: I find that a lot of self-proclaimed "game developer experts" have managed to get stuck in the infinite premature optimization trap, thinking too much in terms of "how vtable indirections are expensive".
<bawNg>
dminuoso: do you know who Jonathan Blow is?
<dminuoso>
Not only do compilers employ devirtualization optimizations, but the actual penalty is really small. It's far more likely that programmers write shit algorithms.
kapil___ has joined #ruby
<bawNg>
he's created almost all of Jai, the engine and the game written in it
<dminuoso>
bawNg: Your new hero! :-)
<dminuoso>
bawNg: Just like my hero is Simon Marlow!
<bawNg>
he created Braid and The Witness
<bawNg>
I've never played The Witness, but Braid was a serious work of art
<apeiros>
?ot
<ruby[bot]>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<apeiros>
;-)
<darix>
yeah
<dminuoso>
Lets move it to -ot
<darix>
lets talk about using mruby in jai engine?
<bawNg>
mruby needs some serious optimization because it will be feasible to use it in any large scale game
<bawNg>
hopefully it gets a JIT after MRI
<dminuoso>
bawNg: 3.0 will get things.
<dminuoso>
bawNg: Also truffle has a proper JIT.
<dminuoso>
bawNg: But all of this is happening 8 years too late.
moei has joined #ruby
<bawNg>
I would love to be able to use mruby for game server scripting, I've been using C, C++, C# and SourcePawn for the last 10 years
bronson has joined #ruby
<darix>
not python?:P
<bawNg>
I've been hoping to be able to use mruby since Matz just started working on it, but it's still not fast enough
<arne>
dminuoso: interesting.. i get different behaviours for calling a method without arguments
<arne>
and just sending it
<arne>
i guess you're the right person for that
<dminuoso>
arne: got an example?
<bawNg>
definitely not python, it's even slower than ruby, and any language which isn't native to the engine is pointless since the overhead of a bridge and serialization is way too much
<arne>
dminuoso: not really, it's huge
<arne>
it's a class << self;...;end defined class method
<arne>
does that matter?
<dminuoso>
arne: no. just gist the callsite for both invocations.
<bawNg>
I used LuaJIT for one engine a few years ago, not the best language but reasonably fast at least
<dminuoso>
arne: note that strictly speaking Ruby doesn't have "class methods". a "class method" is also just an instance method, just on a different class.
<dminuoso>
which is why this is really not relevant.
<arne>
i know, but it seems to matter
<arne>
CPlus::Model::Realm._my_create
<arne>
vs
<arne>
CPlus::Model::Realm._my_create
<arne>
CPlus::Model::Realm.send(:_my_create)
<dminuoso>
arne: what observable difference do you have?
<apeiros>
try __send__ (only matters if somebody has send overwritten)
<dminuoso>
^-
<dminuoso>
Also one possible observable difference is that .send will bypass visibility restrictions. Just in case _my_create is private
mtkd has quit [Ping timeout: 248 seconds]
<apeiros>
also try in reversed order (in case your different result is because you'd also get a different result when calling it twice)
<dminuoso>
public_send should be your default
<apeiros>
ah right. send will ignore method_missing if a private method is present.
<dminuoso>
Yup
nfk has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
belmoussaoui has quit [Remote host closed the connection]
<bawNg>
#send could have been named better, it gets replaced by IO related methods in a lot of libraries
<arne>
weird it works now
<arne>
guess i mispelled something
<arne>
sorry false alarm
<apeiros>
bawNg: agreed. also I still want an Introspection module.
anisha has joined #ruby
<apeiros>
so you can do stuff like `obj = BasicObject.new; Introspection.ivars(obj)`
<bawNg>
how would that be different from #instance_variables?
nfk has joined #ruby
<bawNg>
apeiros: oh I missed what you said about #file_path earlier, are you sure it rejects a string?
aonemd has quit [Ping timeout: 265 seconds]
<bawNg>
I copied the string check from the ruby core code base, since the STRING_P macro is defined in a different header
<bawNg>
(RB_TYPE_P(path, T_STRING) && CLASS_OF(path) == rb_cString) should allow a string
<apeiros>
bawNg: yes, I am
<apeiros>
actuator/test/setup_test.rb:65:in `file_path=': wrong argument type String (expected Symbol) (TypeError)
<apeiros>
that line is `Log.file_path = "actuator.log"`
<bawNg>
ah, the symbol check macro must raise an exception if false
<bawNg>
that's stupid, I'll figure out what macro just returns false
<apeiros>
Qfalse
<bawNg>
no, I mean to check if a value is a symbol
<bawNg>
looking at the macro in the core, I don't see why SYMBOL_P would raise an exception
<bawNg>
that argument type error definitely isn't coming from my code
<bawNg>
unless SYMBOL_P returns true on a string too
anisha has quit [Quit: This computer has gone to sleep]
<apeiros>
iirc there was a check macro, SYMBOL_T or T_SYMBOL or somesuch
<bawNg>
oh I just made a stupid mistake with the implementation
xuyuheng has joined #ruby
dviola has joined #ruby
<bawNg>
apeiros: I've published and pushed a new version
aonemd has joined #ruby
<apeiros>
ok, test runs
<apeiros>
I'll let it run for a minute, then abort and gist the logfile
<bawNg>
you can just kill it when it starts spamming warnings
<bawNg>
since that means something is very wrong
xuyuheng has quit [Ping timeout: 256 seconds]
yohji has quit [Ping timeout: 265 seconds]
<apeiros>
meanwhile I'll be having fun generating some ~1KB of plsql from ruby 😵
<apeiros>
something as simple as `some_string.split(" ").include?(word)` is ~30 lines of code. I hate a good bit of it.
<apeiros>
and that sql and plsql are two different engines with different capabilities doesn't help either.
rrutkowski has joined #ruby
<bawNg>
I guess getting the clock time on OSX is failing completely then
<bawNg>
I wish I had a mac to test with
<bawNg>
do you know if __APPLE__ is defined when you compile an extension?
<apeiros>
nope
<apeiros>
iirc there are various __DARWIN* flags, but don't really know those eithers
<bawNg>
looks like the ruby core source is full of __APPLE__ #ifdefs, so it probably should be defined
rrutkowski has quit [Client Quit]
a_duck has joined #ruby
rrutkowski has joined #ruby
Burgestrand has quit [Quit: Closing time!]
<bawNg>
I don't see any #ifdef's that include DARWIN in the ruby core source, and the only OSX one is MACOSX_DYLD, which seems like something specific that isn't relevant
<apeiros>
eh, I'm probably not the best person to talk with in that regard 0:-)
<bawNg>
but it seems most likely that you're somehow compiling without __APPLE__ being defined, since that would explain 0 being returned for the clock
<dminuoso>
16:26 apeiros | also try in reversed order (in case your different result is because you'd also get a different result when calling it twice)
<dminuoso>
apeiros: This is so priceless!
<dminuoso>
Equational reasoning / referential transparency is priceless.
yohji has joined #ruby
<apeiros>
dminuoso: hm?
afro has joined #ruby
rrutkowski has quit [Ping timeout: 240 seconds]
<apeiros>
are you going to tout functional language advantages now? :D
<bawNg>
everything points to __APPLE__ being the correct define, I guess I could detect OSX in the extconf and add my own define, but that doesn't seem like the best solution
<dminuoso>
apeiros: I would never do that.
alfiemax has quit [Remote host closed the connection]
<dminuoso>
I just subtly hint at them.
<dminuoso>
apeiros: Im honestly on the brink of making a PR of Proc#*
<arne>
"sublty"
<dminuoso>
This should be a thing.
<arne>
what?
cagomez has joined #ruby
conta has quit [Ping timeout: 264 seconds]
<bawNg>
apeiros: what compiler are you using? apparently __APPLE__ will likely only work on gcc, clang and intel compilers
zautomata has joined #ruby
<bawNg>
so your ruby must have been compiled with one of those, but maybe you are compiling extensions with a different compiler?
milardovich has quit [Remote host closed the connection]
<dminuoso>
arne: The non-currying way would be Proc.class_eval { def *(f) ->(*args) { self[f[*args]] } end; }
<dminuoso>
Simple and plain function composition.
zautomata has quit [Client Quit]
zautomata has joined #ruby
<dminuoso>
so: `f * g` in ruby corresponds to `f ◦ g` in mathematics.
<apeiros>
bawNg: clang I'd say. whatever comes with current xcode.
gizmore|2 is now known as gizmore
<a_duck>
i get 'incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError) when using the report_builder gem. Trouble is i'm not sure which files it's got problems with
<apeiros>
I installed ruby using rvm. xcode might actually ship with both, gcc and clang. not sure what rvm uses to compile.
<bawNg>
hmm, strange
cagomez has quit [Remote host closed the connection]
<apeiros>
a_duck: not sure whether there was a question hidden in that statement, but it seems to me that your first step should be to narrow the issue down…
alfiemax has joined #ruby
armando_ has joined #ruby
cagomez has joined #ruby
LastWhisper____ has joined #ruby
synthroi_ has quit [Remote host closed the connection]
<a_duck>
apeiros: yeah, that was a masquerading questions sorry. i'm trying to narrow it down with pry, but i'm not having much luck
cagomez has quit [Read error: Connection reset by peer]
cdg has quit [Remote host closed the connection]
<apeiros>
a_duck: if you have the backtrace, just add a begin/rescue binding.pry; end around it
mark_66 has quit [Remote host closed the connection]
<a_duck>
so the stack trace ends in 'erb', which sounds like it's a templating thing? when i enter the debugger there pry doesn't seem to be able to tell me much
<apeiros>
do you generally try to give as little information as possible?
<apeiros>
and yes, erb is a templating engine
<a_duck>
not trying... just not familiar with the environment. sorry.
lcarlson has joined #ruby
qba73 has quit [Remote host closed the connection]
<apeiros>
I'd assume it'll be utf-8. and then you probably have some expression in your template which evaluates to a binary string. so you have <%= some_binary_string %>, and that fails when interpolating.
<apeiros>
but just a wild guess due to lack of detailed info
* apeiros
afk for a bit
<a_duck>
great, thanks. i'll take a look. again, happy to give any info i can but i'm mostly in the dark here
<a_duck>
the template should be from the report_builder library itself i think, it builds an html report from cucumber test runs
tlaxkit has joined #ruby
<apeiros>
bawNg: honestly, I think in your place I'd just polish the gem for your use, state in the readme that you'd love to work with somebody on osx compat, but that it's currently not there
<bawNg>
apeiros: it's something so small that is needed, will be worth getting to the bottom of it
troys has joined #ruby
<apeiros>
bawNg: heh, ok. I wish you luck :)
<bawNg>
I'm 99% sure that the code in the extension will just work on OSX, if that define was there
a_duck has quit [Quit: leaving]
<bawNg>
so I'll probably just have to detect OSX and add my own define from extconf
<bawNg>
it's just shit to not be able to test it myself
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
milardovich has joined #ruby
<bawNg>
but ideally I'd really like to know why __APPLE__ isn't defined on your system, with your compiler
<bawNg>
since everything seems to say that it should be
synthroid has quit [Remote host closed the connection]
synthroi_ has joined #ruby
jottr_ has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
<bawNg>
apeiros: I added support for the __MACH__ define and made compilation fail if no clock support is found, you can try build it again whenever you get a chance
<bawNg>
if that doesn't work, I'll have to just try hack the detection into extconf
milardovich has quit [Remote host closed the connection]
aonemd has quit [Quit: leaving]
mtkd has joined #ruby
<bawNg>
apeiros: nevermind, I was just being dumb, there was a missing line for OSX that I didn't notice, should hopefully be working now
dionysus69 has joined #ruby
workmad3 has joined #ruby
cagomez has joined #ruby
<apeiros>
bawNg: two green dots
<apeiros>
log is being spammed. letting it run :)
<bawNg>
oh, you should have probably disabled the log, that will slow it down
[Butch] has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
<apeiros>
oy, "average timer precision is worse than 200 us (707.65 us)"
* apeiros
hands bawNg a µ
anisha has joined #ruby
<bawNg>
that's either because your machine is loaded, or the log is slowing it down too much
<bawNg>
it'll retry the precision test a bunch until it passes
<apeiros>
I restarted without the log
ur5us has joined #ruby
<apeiros>
and by "loaded", do you mean under heavy load? it's not really. and it's a relatively fast machine.
<apeiros>
says >90% idle
<bawNg>
well, if theres no CPU time available exactly when a timer is due, the scheduler thread will wake up late, so a moderate load
<bawNg>
but that's probably just the log file slowing it down
maufart__ has quit [Quit: Leaving]
<leitz>
In this bit of code, show_number uses number but is passed nothing. If Receiver.show_number is called on a separate line it fails. Does this mean Receiver.new(num) passes its initialized value to show_number? https://gist.github.com/LeamHall/a645ab94f9ac1cb6963c6829f42a09c1
<apeiros>
as said, logfile is disabled
<bawNg>
I made the the precision test much more relaxed than it should really be, so that it passes on really low end hardware
<apeiros>
and even while running the tests, CPU load is reported as >90% idle.
<bawNg>
it passes on a raspberry pi v1, which is really slow
<bawNg>
yeah it has a very small footprint, the test should use almost no measurable CPU
<bawNg>
most of the CPU used is the ruby code in the test itself
shinnya has quit [Ping timeout: 260 seconds]
<apeiros>
yeah, this machine's 2.9 GHz i7 should definitively beat a raspi
<bawNg>
let me know what the precision results are like on OSX with plenty of free CPU time
<bawNg>
will be interesting to see if it's better or worse than the clock on Windows
<apeiros>
hovers around 700µs
ur5us has quit [Ping timeout: 240 seconds]
<bawNg>
the median?
Xiti has quit [Quit: Xiti]
<apeiros>
yes
<bawNg>
that seems really high, so either the clock is inaccurate, or the thread sleeping is
<bawNg>
this is the result on my windows 7 desktop which is reasonably loaded - Total: 5000, Over 1ms: 1, Low: 0.4 us, High: 1172.4 us, Median: 2.2 us, Variance: 20.4 us
tvw has quit [Remote host closed the connection]
<bawNg>
my machine is using > 50% CPU constantly
<apeiros>
yeah, mine is mostly on idle. so I doubt load is the issue
<bawNg>
which accounts for the single sample over 1ms
<bawNg>
thanks for the results, definitely should be better, I'll have to put some thought into it and come up with some more tests for you to run
bijan_ has joined #ruby
[Butch] has joined #ruby
<bijan_>
Hey Guys, how do I iterate over all values of a hash that has n-levels of nested hashes?
<bijan_>
my_hash.values only gives me toplevel values
<dminuoso>
bijan_, what exactly do you want to iterate over?
<dminuoso>
bijan_, the leaf values?
<dminuoso>
bijan_, is the hash of uniform depth?
<bijan_>
yes to the lowest level
<dminuoso>
bijan_, do you want to map (i.e. transform) or just iterate for effects?
<bijan_>
transform the values
<dminuoso>
bijan_, are there only hashes or other containers (Array or other) involved?
cagomez has quit [Remote host closed the connection]
<dminuoso>
bijan_, also regarding uniformity of depth?
<bijan_>
actually I wrote a converter for Rails I18n language files to ember-i18n and this forces me to do some changes on the template strings deeply nested in my hash (that is then exported to json)
<bijan_>
hashes that include n-levels of hashes that have ultimate string values
<dminuoso>
bijan_, well Ruby 2.5 does have transform_values which you could trivially use in a simple deep_transform_values method you would have to add
<bijan_>
so actually I'll be recursively traversing each "leaf" and as soon as my value is a string I'll do my string-transformation
<bijan_>
you would do the same?
wilbert has joined #ruby
orbyt_ has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
orbyt_ has quit [Client Quit]
<dminuoso>
bijan_, yeah - I would just generalize it as focusing on whether its a hash.
alfiemax has quit [Remote host closed the connection]
<bijan_>
okay I thought I might overlook a method in the stdlib but then this is the way to go
rrutkowski has joined #ruby
cagomez has joined #ruby
<dminuoso>
bijan_, in pre 2.5 you can simply use .map you just have to to some .to_h to make it hashes again
cadillac_ has quit [Read error: Connection reset by peer]
<bijan_>
Ruby spoiled me so I'm not used to implement those things by myself anymore
dinfuehr has quit [Ping timeout: 256 seconds]
<bijan_>
I guess I have to step my c-game up again to be able to contribute to ruby core :/
<dminuoso>
bijan_, in a way I think it's really bad. There's a lot of great intuition that comes from implementing trivial problems with recursive algorithms.
<dminuoso>
Took me so long to wrap my head around `fix`
<dminuoso>
And by that I dont mean to say that Ruby is bad, but I think this kind of "looking for a library to solve your problem" kind of does make you forget how simple some problems are.
<bawNg>
yeah these days people use libraries for the most simple things that can be implemented with a single line of code
dinfuehr has joined #ruby
reber has joined #ruby
<dminuoso>
bijan_, there's nothing complicated about the C used in Ruby. It's just that the vast majority of Ruby's internals are utterly and completely undocumented.
cdg has joined #ruby
<dminuoso>
bijan_, So the main effort comes from deciphering what some of the terribly named, non-descript, bad-japanese-english-mix-named things are.
<bijan_>
That's true... I wrote lots of Go code until a year ago and starting from then worked ruby and js and now I got burned so many times for implementing something that is somewhere hidden in the batteries anyways
<bawNg>
once you get past the names of things, working with ruby from C isn't really that much different from ruby itself
zipace has joined #ruby
<bawNg>
you work with ruby objects pretty much the same way, everythings just a VALUE in C, just like everythings an objects in ruby
<dminuoso>
bawNg, yup. You just have to understand a lot of the subtleties of the various subsystems. For example you have to understand how the GC works exactly in order to now crash things left and right.
<dminuoso>
Or what caches exist, and when they have to invalidated and what not.
<bawNg>
yeah, handling GC properly is one thing that is easy to mess up
<bawNg>
and can be rough to track down, but once you get a handle on it, it's not all that bad
<dminuoso>
Indeed. But say modifying the compiler is really easy once you understand what the names mean. :)
<bijan_>
Languages that are now implemented in themselves definitely have an edge when it comes to contribution
cadillac_ has joined #ruby
<bijan_>
(looking at go and crystal)
<dminuoso>
bijan_, you can only do that if the language has the ability to produce native machine code somehow.
<bijan_>
dminuoso: I know...
eckhardt has joined #ruby
ruby[bot] has joined #ruby
<dminuoso>
bawNg, "rough" heh. Especially if you crash in completely unrelated code regions. =)
cdg has quit [Ping timeout: 276 seconds]
<bawNg>
yup, that's when GC usually kicks in, at some completely random time haha
bronson has joined #ruby
<dminuoso>
It's like when you overflow in a malloc'ed buffer and accidentally overwrite its internal metadata - and it crashes in a completely different code region when some completely unrelated code using the same bucket tries to free, and then bam..
fyrril3 has quit [Quit: Leaving]
<bawNg>
absolute hell to track down
andikr has quit [Remote host closed the connection]
<dminuoso>
Not really. You just valgrind it.. :P
<dminuoso>
But that requires having something valgrindable, not like Ruby on OSX.
<chrisseaton>
(Probably depends a lot on how you count it)
bronson has quit [Ping timeout: 264 seconds]
<dminuoso>
chrisseaton, curious, Rubinius is on your highlight list as well? =)
<chrisseaton>
No I was actually here just about to ask a question this time!
<bijan_>
Ah I starred truffle ruby on github some time ago but totally forgot it exists
<chrisseaton>
Does Ruby have any way to define a 'virtual' global variable? As in it looks like one but you supply your own callbacks to give the value? I'm sure I remember it does, but can't find it now.
<dminuoso>
chrisseaton, natively or with a patch?
troys is now known as troys_
<dminuoso>
If its the latter, then yes.
<chrisseaton>
Natively
<chrisseaton>
Is the patch somewhere online?
<dminuoso>
chrisseaton, set_trace_func
<dminuoso>
(Or Tracepoint)
<dminuoso>
chrisseaton, yeah in Ox0dea's gists somewhere.
<dminuoso>
chrisseaton, he basically rigged the underlying mechanism for those $1 type of variables (which are not really global variables - I think they are called svars)
<chrisseaton>
Yeah we're writing something up on all these 'global' variables
anisha has quit [Quit: This computer has gone to sleep]
jeffreylevesque has quit [Ping timeout: 248 seconds]
<dminuoso>
bijan_, yup. It would be a bit more Rubyish if you tested for .responds_to probably.
kies has quit [Ping timeout: 256 seconds]
<dminuoso>
bijan_, also you probably should make this also work with blocks.
<bijan_>
dminuoso: that's what I'm currently changing in the code :D
xuyuheng has joined #ruby
<bijan_>
dminuoso: can you elaborate on the responds_to?
nickjj__ has joined #ruby
Serpent7776 has quit [Quit: Leaving]
gregf_ has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
<bawNg>
dminuoso: if you ever have a segfault problem, you can always just install neversaydie, haha
<dminuoso>
bawNg, oh man its from tenderlove - I dont know whether its a troll repo or not!
<bawNg>
I don't think we will ever know for sure
<dminuoso>
I remember about this one.
nickjj_ has quit [Ping timeout: 248 seconds]
nickjj has joined #ruby
<bawNg>
I think it's hilarious
<dminuoso>
bawNg, oh wait. I remember him talking about this one in one of this troll moments.
<dminuoso>
bawNg, maybe Ill write the opposite: HardRealTimeRuby that simply reboots the machine on any exception.
Ltem has quit [Quit: bbl]
<bawNg>
might as well reboot when there is a warning too
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nickjj__ has quit [Ping timeout: 260 seconds]
xuyuheng has quit [Ping timeout: 260 seconds]
<bawNg>
ruby warnings are serious business
<dminuoso>
bijan_, you could think of "transform_values" as "transform_leaves". So when you're at that point, what would { a: someTreeObj }.transform_leaves { ... } do?
<dminuoso>
bawNg, Oh man I remember some old rubyland hacks that would allow you to catch that without a native extension!
<dminuoso>
I think you can still do it.
<bawNg>
I've seen some really dodgy things built with Pry
<dminuoso>
The trick revolved around monkey patching the printing code for the crash dump screen
alfiemax has joined #ruby
<dminuoso>
apeiros, you remember this?
yohji has quit [Remote host closed the connection]
nickjj_ has joined #ruby
meesles has quit [Ping timeout: 260 seconds]
<dminuoso>
It was from some RubyConf a while back IIRC.
<bawNg>
I've watched quite a few RubyConf videos over the years, never saw that though
<dminuoso>
bawNg, the first 2 have long been fixed though.
sanscoeur has joined #ruby
<apeiros>
lol, charlie going to a rubyconf with a php t-shirt
<apeiros>
sad he isn't as active in ruby anymore as he used to be
<bawNg>
ah, an AU RubyConf
<dminuoso>
YouTube thinks that watching Erik Meijers Functional Programming video next is a good thing. Clearly YouTube knows whats best for a programmer.
catphish has quit [Quit: Leaving]
<apeiros>
it's personalized. I get a talk by tenderlove as next video.
<dminuoso>
So my focus is on FP, yours is on trolling!
<dminuoso>
=P
<apeiros>
no. puns and cat pictures.
<dminuoso>
Heh.
<dminuoso>
But its funny, I didnt even pay attention to his t shirt.
<bawNg>
apeiros: so I did a bit of research, and it seems like it's possible that the clock returned by that system call on your version of OSX could not be so high precision, but most likely it is the thread sleeping that is causing the precision loss, and it sounds like the only way to solve that is to set the threads scheduling priority to real-time on OSX
nickjj_ is now known as nickjj
<bawNg>
but there is conflicting information and benchmark results online, so it's hard to say for sure
<bawNg>
the one results show that OSX is more precise with thread sleeps than both linux and windows, and didn't mention anything about thread priority, but the official apple docs say that high priority is needed for good precision, and that more than 500 us without load is considered a serious error with high priority
<bawNg>
so that makes me wonder what the expected precision even is with high priority
<bawNg>
it seems like solving this will require some testing, trial and error, so I'm probably going to have to just leave OSX with worse precision for now
<apeiros>
well, I don't have any idea :D
<apeiros>
but I can rerun tests whenever you want.
<bawNg>
hopefully someone with OSX can look into it and make a patch for it
<apeiros>
that's fine too
<bawNg>
otherwise I'll have to put together some tests for you or someone else with OSX to run at some point
<bawNg>
remote debugging is never fun
<apeiros>
indeed
<apeiros>
I think it's absolutely fine to make this a contributor thing
troys_ is now known as troys
<bawNg>
maybe dminuoso can have a look at it at some point
xuyuheng has joined #ruby
<dminuoso>
My knowledge about anything related to OSX is scoped to how ridiculously expensive the new iMac Pro is.
<bawNg>
well you have access to OSX, and know C, so you're in a better position than anyone else I know
<bawNg>
it shouldn't be hard to solve this, it'll just require some testing
<bawNg>
need to figure out if the system call which returns the clock is accurate, and test making the thread real-time
<dminuoso>
bawNg, I wouldn't presume to make a patch in that area when I dont understand the underlying kernel and subsystems at all.
orbyt_ has joined #ruby
<bawNg>
dminuoso: there's basically just 3 things that could be the issue, so I just need test results to figure out which is to blame
xuyuheng has quit [Ping timeout: 260 seconds]
<bawNg>
either the clock being returned by mach_absolute_time() is inaccurate, which is unlikely. else the thread is not waking up soon enough, and that is either because of the threads priority not being set to real-time, or because the ruby API is not calling the same thing are mach_wait_until() which is documented at the link above
raynold has quit [Quit: Connection closed for inactivity]
<dminuoso>
adaedra, when you find the time, please update to 2.5 :)
<bawNg>
oh right, it's literally on module
<bawNg>
couldn't be easier to use
<dionysus69>
thanks to both of you :)
<dminuoso>
dionysus69, however, explicit requires are the way to go nevertheless.
<dminuoso>
Personally I consider autoloading to be a kind of misfeature.
<dionysus69>
ok fine :D let it be require_relative
<dminuoso>
Adding require does not cost much time, but it makes dependencies obvious and avoid weird errors down the road.
<bawNg>
yeah, I don't like autoload very much for a bunch of reasons
belmoussaoui has joined #ruby
jeffreylevesque has joined #ruby
<dminuoso>
If only Ruby had a proper module system where you could explicitly export and import symbols..
<nchambers>
is there a ruby equivalent to python's twisted?
<bawNg>
sometimes implicit module loading in long running modular applications makes sense, but then I end up having to build a full dependency management system along with plugin loading, since with implicit loaded modules, dependency modules and super classes need to be loaded first
<dminuoso>
nchambers, EventMachine
<bawNg>
I've done exactly that in a few languages over the years, probably at least 4 different times in ruby alone
<dminuoso>
nchambers, its a bit more general than twisted.
<nchambers>
dminuoso: perfect. thank you!
<nchambers>
(general is what I wanted anyways)
Beams has quit [Quit: .]
<bawNg>
EventMachine is your best option for async IO
Azure has quit [Read error: Connection reset by peer]
<bawNg>
I'd love to add IO support to my reactor eventually, so that I can use it instead of EM, since EM is not implemented anywhere near as efficiently as it could be
cadillac_ has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
<bawNg>
but it's good enough for pretty much any normal use case
<nchambers>
yeah, it sounds perfect. thanks guys
Azure has joined #ruby
hfp_work has joined #ruby
<bawNg>
almost all the ruby applications I have built for the last 8 years are EM-based
<kenichi>
celluloid::io is a reactor as well
<bawNg>
I didn't like celluloid very much when I looked at it years ago, can't remember exactly why
<dminuoso>
kenichi, sadly no longer maintained though.
jeffreylevesque has quit [Ping timeout: 248 seconds]
cadillac_ has joined #ruby
<bawNg>
but I have also built so much EM-related code up until this point, that changing to some other reactor doesn't make sense unless it's really worth it
oleo has quit [Ping timeout: 276 seconds]
<bawNg>
I have monkeypatched more gems than I can count to be EM-based and/or fibered, and I've implemented even more protocols from scratch for EM applications
<kenichi>
EM does .. involve itself :)
<dionysus69>
in order to use Gemfile/bundler in ruby app, I required rubygems and bundler but still doesn't include gems
<havenwood>
dionysus69: Prefix `bundle exec` to your command.
<dionysus69>
hmm
<dionysus69>
i am running a file
<dionysus69>
ruby main.rb
<bawNg>
I personally use require 'bundler/setup'; Bundler.require(:default)
<dionysus69>
bundle exec right, but I am not running a ruby task I am executing a ruby file
<dminuoso>
havenwood, sadly rails trains people to not know this by doing this inside that magic shim.
<bawNg>
I'd probably just wrap libuv if I ever find the time to add IO support to my reactor
<dminuoso>
dionysus69, `bundle exec ruby file`
<dionysus69>
oh
<dionysus69>
:D
<bawNg>
I wrapped libuv in C# which I use for async IO embedded in game servers and other server-side applications
<bawNg>
it's what nodejs is built on
<kenichi>
havenwood: ah that's where it got to
desperek has joined #ruby
workmad3 has joined #ruby
mtkd has quit [Ping timeout: 264 seconds]
<havenwood>
It looks like Thribers (not going to be named that) are coming along nicely (they wrap kqueue and epoll): https://bugs.ruby-lang.org/issues/13618
alfiemax has joined #ruby
<havenwood>
LightThread? HeavyFiber? :-P
<havenwood>
Threadlet isn't too bad.
kapil___ has quit [Quit: Connection closed for inactivity]
<havenwood>
How about Routine?
guille-moe1 has joined #ruby
<dminuoso>
havenwood, they finally decided against that horrid name?
<bawNg>
the auto fibers are an interesting idea, maybe if that works out soon enough, I can just use that and not have to implement IO reactor support at all
<dminuoso>
It was almost sad.
<havenwood>
Kinda like a goroutine without the go.
<havenwood>
dminuoso: Yeah, hah.
<havenwood>
dminuoso: No Thribers or Freds.
<bawNg>
I just want to be able to do IO and high precision timers in a single thread
<dminuoso>
havenwood, honestly I would name it "HonestThread"
jottr_ has quit [Ping timeout: 240 seconds]
guille-moe has quit [Ping timeout: 240 seconds]
guille-moe1 is now known as guille-moe
<dminuoso>
Think we had this discussion before where I pointed out that these Thribers kind of already exist in the form of threads (in the context of modern operating systems)
<bawNg>
I didn't even want to write my own reactor, but I profiled a bunch of ruby reactors like EM and a libuv wrapper, and they all have insanely bad timer precision
<havenwood>
dminuoso: RedThread
mtkd has joined #ruby
<dminuoso>
havenwood, know what we really need?
<dminuoso>
havenwood, STM.
<havenwood>
dminuoso: We already have it via JRuby and RedBridge to Clojure! :-P
<dminuoso>
though concurrenty-ruby has TVars
<dminuoso>
Haha.
<havenwood>
I actually have used STM that way, heh. >.>
<bawNg>
whatever the name ends up being, it's going to confuse a lot of people
dwickern has joined #ruby
<dminuoso>
havenwood, kind of reminds me how we planned to bolt our rendering frontend into ruby through .NET through IronRuby.
ur5us has joined #ruby
<bawNg>
most people already can't wrap their heads about a fiber, now they are going to have to know the difference between 3 different kinds of stack based interactions
<dminuoso>
bawNg, no they just have to understand how Threads really work.
<dminuoso>
bawNg, a thriber is just a more explicit thread.
<nchambers>
does eventmachine have an irc channel?
<dminuoso>
It's no different, except the yield point is not implicitly every syscall, but has to be picked explicitly. And there's no preemption.
<bawNg>
nchambers: it's never really been active, you can ask here for advice about EM
<nchambers>
ok thanks, will do
workmad3 has quit [Ping timeout: 260 seconds]
<dminuoso>
bawNg, or rather.. its exactly like threads without preemption (which happens really rarely to be important anyway)
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bawNg>
dminuoso: but I mean, fibers are even more simple, in that there is nothing automagically happening at all
<dminuoso>
bawNg, with threads most of the time nothing automagic happens either.
<dminuoso>
because most context switches are cooperative in form of syscalls.
<bawNg>
but a lot of people can't even seem to wrap their heads around how a fiber/coroutine works, including people who use the things
<havenwood>
I think Erlang, Haskell, Go and Crystal have shown good use of such a light, green thread.
TomyLobo has joined #ruby
<dminuoso>
Linux has what, a default timer frequency of 250Hz?
<bawNg>
1 ns precision
<dminuoso>
Yeah but by default is preempts every 4ms.
<dminuoso>
dionysus69, and equivalently #osdev here on freenode.
<dionysus69>
hmm cool
<dionysus69>
would give it a shot when I on a sysdev mood xD
<dminuoso>
It forces you to completely understand how stuff works. How memory works. How the CPU works. What processes are. How compilers work. How linkers work.
<bawNg>
dminuoso: there are some parts of the kernel that should actually be implemented in user space, it's 2018
<dminuoso>
bawNg, oh boy. Here comes the "best kernel architecture" discussion again!
<bawNg>
large companies like google use network drivers implemented in user space, which minimizes latency and saves on all the copies of buffering the data that the kernel would do, there are a bunch of other advantages too
<bawNg>
game servers should be using user space networking, but we're still using kernel space stuff from the 70s
eckhardt has quit [Client Quit]
<dminuoso>
bawNg, it kind of depends on having a performant IPC architecture.
<WA9ACE>
there's also the fact that parsing anything sent from somewhere else in kernel space is inherently dangerous
<bawNg>
yeah, security is one of the other big things
eckhardt has joined #ruby
Guest47493 has joined #ruby
eckhardt has quit [Client Quit]
<WA9ACE>
I mean, Windows had a vuln based on Font loading being done in kernel space
tomphp has joined #ruby
<bawNg>
the recent major exploits that are currently being patched by all the kernels can compromise networks in a huge way
OyoKooN has joined #ruby
<bawNg>
that wouldn't be an issue if it was in user space
<WA9ACE>
I though spectre and meltdown were a big deal because it meant you could run things in userspace and access memory in someone else's space
<dminuoso>
WA9ACE, meltdown is a big deal. Spectre 1/2 kind of depends and is much more limited in the attack surface.
<dionysus69>
so what about my error :D cant get gemfile/bundler to import gems in my app :S :D
<bawNg>
you can, but it depends on a bunch of factors
<bawNg>
the performance loss caused by patching the exploits will affect all software pretty badly
ta_ has quit [Read error: Connection reset by peer]
<bawNg>
in some cases, over 35% worse performance, just because of heavy use of vtables in C++, and various other things
<WA9ACE>
I'm holding out a new mac for when the expandable Mac Pro comes out 2018*
ta_ has joined #ruby
<WA9ACE>
but now I'm not certain I want it if it doesn't use AMD
<bawNg>
we basically just lost many years of CPU hardware advances due to the patches
<dminuoso>
No we did not lose many years of CPU hardware advances.
<bawNg>
when software is compiled with the patched compilers, all caches will be invalidated constantly to prevent the exploit, which destroys performance in many cases
drakko has joined #ruby
<dminuoso>
WA9ACE, yeah that's meltdown. Luckily its trivially fixable from the OS.
<bawNg>
when all OS kernels have been patched, that introduces a bunch more overhead
<dminuoso>
And by trivially I mean that KPTI is implementable - you just lose the benefits of sharing TLB entries when switching to kernel space.
<dionysus69>
good way to learn both rust and kernel at once xD
<dminuoso>
dionysus69, there are rust related resources on the osdev wiki too.
stormpack has quit [Quit: Leaving]
<dminuoso>
dionysus69, and there's some people in #osdev who are working on rust based kernels.
<dionysus69>
i did ctrl f rust and nothing popped :S
<dionysus69>
ill search deeper I guess
<OyoKooN>
Hello there! I got an issue with HMAC. I have to sign a form before sending it to a bank. They only provide an example in PHP. I have a hex key to sign my data. In the PHP exemple, they do `$binKey = pack('H*', $key) before signing the data. Should I do something similar too with my key? I use: `digest = OpenSSL::Digest.new('sha512') ; signature = OpenSSL::HMAC.hexdigest(digest, ENV['HMAC_KEY'], msg)`. Thanks for you help! :)
<dminuoso>
dionysus69, you dont really need any specific resources.
<dminuoso>
dionysus69, just go through the initial examples and it will very rapidly become obvious.
<dionysus69>
kk thanks dminuoso
desperek has quit [Ping timeout: 248 seconds]
<dminuoso>
dionysus69, I wrote my entire kernel in C++ but didnt need any C++ specific articles. Most of what I needed was readily found in GCC manuals.
drakko has quit [Client Quit]
tlaxkit has quit [Quit: Saliendo...]
<eam>
kpti is part of the story, a bigger problem is disabling branch prediction in critical sections
sameerynho has joined #ruby
<dminuoso>
eam, yeah that's spectre 2 though.
troys is now known as troys_
<eam>
1 and 2, yeah?
<dminuoso>
eam, mm yeah.
<eam>
re: user space drivers above - I haven't seen anyone doing that with network devices. I think it's mostly about USB "drivers" and they're still brokered by the kernel
<eam>
I don't think you could implement a high performance network device driver from user space
<dminuoso>
eam, Mach for example places network into userspace.
<dionysus69>
dminuoso: you just seem more talented :D
<dminuoso>
I think.
afro has quit [Remote host closed the connection]
<dionysus69>
I cant handle dry docs, not enough patience :S I prefer guides xD
<dminuoso>
dionysus69, this is part of what makes osdev great. It _forces_ you to read docs. In doing so you become a better developer./
<dminuoso>
If I want to understand how things in the CPU work, I know fairly where to look in the intel manuals for example.
<dminuoso>
*fairly well
<eam>
I wrote a usb device driver in ruby a year or two ago
<dminuoso>
I still suck at it, but at least I know where to look =)
<bawNg>
eam: there are open source user space network stacks
<dminuoso>
dionysus69, and this whole thing translates onto other parts because you begin to learn that everything can be understood. Since then Ruby has stopped being scary.
<eam>
sure, but they're not performant
<bawNg>
large companies like google use user space stacks almost exclusively
<eam>
bawNg: I would be surprised to learn that
<dminuoso>
bawNg, care to take this into #osdev?
<dminuoso>
bawNg, because I know there's a kernel developer from Google right there.
<dminuoso>
=)
<dionysus69>
they are dissing ruby in #osdev, come help! xD
Dimik has joined #ruby
krawchyk has joined #ruby
<bawNg>
I'd need to figure out where my source for that information came from
desperek has joined #ruby
<eam>
pushing certain components into userspace can make sense in certain scenarios, but there's basically no chance that the hardware driver is moved there, for example
<eam>
for example, when I wrote a USB device driver in ruby it basically just involved reading and parsing data from the bus. Very high level
<eam>
not really any different than reading and parsing data from a socket
<dminuoso>
Part of the reason why USB drivers are commonly done in user space is because there's tons of idiotic developers out there. So to avoid badly written drivers for gazillion of devices to crash your kernel left and right..
guille-moe has quit [Ping timeout: 248 seconds]
<eam>
yeah. In my case, I needed to write something in short order for a custom device
<bawNg>
I personally didn't know about that open source stack until a couple months ago either
<nchambers>
thanks dminuoso. I'll look at that
rubycoder38 has joined #ruby
<rubycoder38>
hi
<eam>
bawNg: kinda. You've gotta realize this isn't a driver that you could effectively use to run an application server
<eam>
as I said above there are limited scenarios (like building a router or firewall or other networking device which only pushes packets) where this can make sense, but you wouldn't ever use this to drive the networking stack underlying another application
<bawNg>
you could, it may just require some effort
<bawNg>
I'm fairly sure companies are using inhouse userspace stacks built on that exact open source toolkit
<eam>
if you have a multi-user system, the cost becomes identical or greater
<bawNg>
sure, it's not ideal for that use case
<bawNg>
but large high performance latency-sensitive services are generally hosted on dedicated hardware, where it would make sense to have a dedicated network stack
<havenwood>
rubycoder38: hi
<eam>
if it's a service (like a database or an app server) then there's no gain
<eam>
these kinds of frameworks are useful if you're doing something like writing say, an SNAT load balancer
<eam>
or maybe even a traffic router
<bawNg>
if there is a huge amount of throughput, then the gain is in avoiding all that redundant copying for kernel buffers, and all the CPU time needed by the kernel to do that
<rubycoder38>
I have an api that returns an array of 'courses', I need to write a script to listen for when new courses are added to the api and after a new one is added I need to send that data somewhere else... I'm a bit confused about how to check for new courses
<rubycoder38>
and should I just use a loop?
<rubycoder38>
hi havenwood
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bawNg>
and what kind of application are you building?
npgm has quit [Quit: Connection closed for inactivity]
<eam>
bawNg: if you're merging your network driver and application into the same process, sure. But if you want to spin up, say, a high performance mysqld you're still going to end up copying between it and your driver regardless of where the driver lives
d^sh has quit [Ping timeout: 264 seconds]
<dminuoso>
bawNg, anyway. To understand why most dont go for userspace stacks requires understanding kernel architecture.
tomphp has joined #ruby
<dminuoso>
bawNg, in order to make a true userspace stack work fast, it requires a well developed micro kernel architecture with a really low latency high throughput IPC architecture.
d^sh has joined #ruby
<rubycoder38>
bawNg: it needs to be a standalone ruby script that does just that, check for new courses and advertise the new courses to another app
<dminuoso>
bawNg, and Linux simply does not have it.
eckhardt has joined #ruby
<dminuoso>
bawNg, in fact any high performance stack on Linux is always a) in kernel, but b) out-of-tree.
<dminuoso>
*high performance network stack
<dminuoso>
Because the in-tree stack is really poor and can barely deal with 40gbe or even 100gbe
<bawNg>
rubycoder38: then you could just use a simple loop with a blocking HTTP request and appropriate response/error handling, or you could use EventMachine to register a timer and have the request asynchronously
<rubycoder38>
bawNg: nice
<bawNg>
dminuoso: most boxes don't have that amount of throughput, but sure kernels could support it better
tomphp has quit [Client Quit]
kekolodeon has joined #ruby
<rubycoder38>
I'm a bit confused about how to keep track of which courses are new and which ones I already advertised
<bawNg>
rubycoder38: store their information in a Hash using some unique info as a key
<bawNg>
like an ID or something else unique
eckhardt has quit [Client Quit]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
<dminuoso>
eam, I suppose realistically meltdown and spectre are not that big of an issue in high performance situations. I mean ultimately you dont let untested and unverified code run on such hardware anyway.
guille-moe has joined #ruby
<dminuoso>
So you might as well forego any microcode patches, KPTI implementations and compiler changes.
<bawNg>
biggest impact by far is cloud services
<kekolodeon>
Hi guys! I'm a baby rubyist. I'm coming from a low level background (C/ASM/RE/Binary Exploitation) and I've decided to learn a scripting lang and thought I'd give ruby a go. I'm amazed by how quickly I found resources on its internals such as the C implementation behind MRI. My question is, is there a way to inspect the C representation of ruby programs via a debugger?
<dminuoso>
And if you do, any of these mitigations will help you if the code is bad..
<dminuoso>
kekolodeon, you might want to understand the basics of the ruby virtual machine (Ruby under a microscope gives a good and quick introduction, although its a bit dated)
<bawNg>
kekolodeon: the MRI internals aren't nearly as bad as people make them out to be
<dminuoso>
kekolodeon, that book is pretty great for writing native extensions, not so much for understanding the abstract execution model.
<kekolodeon>
dminuoso: that's actually the book I'm reading atm and it's awesome!
<kekolodeon>
I don't know if Pat Shaughnessy is here but I'd like to thank him for his blog/book
pastorinni has quit [Remote host closed the connection]
<kekolodeon>
dminuoso: sweet, thanks! :D
<dminuoso>
kekolodeon, which basically gives you sort of repl access inside gdb - which is a pretty slick combination.
jaruga has quit [Quit: jaruga]
<dminuoso>
kekolodeon, keep in mind that the book is a bit dated, so dont use it if you inspect the kernel. Check out the actual ruby source code, because a lot of details have changed.
<kekolodeon>
I used to hate high level langs and their OOP since I could barely find any resources on explaining their C implementation underneath and damn ruby has so many refs on it
<dminuoso>
A lot of the layout has been improved, nested, etc.
goatish has joined #ruby
<dminuoso>
(Conceptually the book is still spot on though)
<bawNg>
kekolodeon: also make sure you look at the ruby source for the version you are using, if you're not using 2.5, since things change
<kekolodeon>
bawNg: I've found that pry tool to be handy for that
<bawNg>
yeah, pry is useful
amatas_ has quit [Quit: amatas_]
AspiringIRCUser has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
<bawNg>
I've added to the known issues for Actuator that timer precision on OSX is shit, hopefully someone who has OSX and knows a little C will be able to investigate further
<kekolodeon>
as for the langs itself, I really don't want to go through resources which teach basic syntax -- any decent books which explain the ruby-ish way of programming?
<kekolodeon>
lang*
<dminuoso>
kekolodeon, Eloquent Ruby.
<dminuoso>
kekolodeon, it quickly races through the basics in the first 20 pages or so, and then it's just how to write elegant ruby code.
<dminuoso>
And its probably the most recommended book in this channel.
<zleap>
which book is that
<dminuoso>
Right next to Well Grounded Rubyist, which is better for newcomers.
<zleap>
i am learning with codecademy at the moment
<eam>
dminuoso: yeah, the tricky part is that things like browsers or mobile are performance critical (not in terms of throughput, but in terms of UX latency and power)
<kekolodeon>
perfect, I'll combine it side by side with the ruby hacking guide and the microscope one to get up to speed
<kekolodeon>
dminuoso: well I'm currently really into linux binary exploitation and recently got the feeling that my knowledge is getting too specialized and I've barely touched anything high level. I figured ruby could improve my toolset and I'm also really interested in lang theory as a subject -- as in how they are truly implemented -- let's just say I love knowing internals
Psybur has joined #ruby
Psybur has quit [Changing host]
<kekolodeon>
dminuoso: I'm also into code auditing (only C atm and some ruby skills won't be that)
<kekolodeon>
that bad*
nowhereman_ has joined #ruby
ur5us has joined #ruby
elcontrastador has joined #ruby
glow2 has quit [Quit: leaving]
bkxd has joined #ruby
bkxd has quit [Max SendQ exceeded]
bkxd has joined #ruby
rrutkowski has joined #ruby
ltem_ has joined #ruby
ltem_ has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
rubycoder38 has quit [Quit: Lost terminal]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dwickern has quit [Ping timeout: 260 seconds]
tomphp has joined #ruby
bkxd_ has joined #ruby
rrutkowski has quit [Quit: rrutkowski]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
bkxd has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
ltem_ has joined #ruby
ltem_ has quit [Remote host closed the connection]
jaruga has joined #ruby
shorberg has quit [Quit: shorberg]
konsolebox has quit [Ping timeout: 260 seconds]
shorberg has joined #ruby
bronson has quit [Ping timeout: 246 seconds]
vichib_ has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
vichib has quit [Ping timeout: 260 seconds]
Mitko_ has quit [Quit: Leaving]
kekolodeon has left #ruby ["WeeChat 1.4"]
konsolebox has joined #ruby
jaruga has quit [Quit: jaruga]
vichib_ has quit [Ping timeout: 260 seconds]
justinfaler has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
shorberg has quit [Quit: shorberg]
biberu has quit []
jamiejackson has joined #ruby
shorberg has joined #ruby
wilbert has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
bkxd has joined #ruby
bkxd has quit [Max SendQ exceeded]
<baweaver>
Program Ruby like Ruby and C like C.
bkxd_ has quit [Ping timeout: 256 seconds]
bkxd has joined #ruby
<dminuoso>
A tautology is just a tautology.
plexigras2 is now known as plexigras
claw has quit [Ping timeout: 255 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
claw has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jottr_ has joined #ruby
imode has joined #ruby
bkxd has quit []
nopolitica has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
one would like to think so :)
jottr_ is now known as jottr
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
justinfaler has joined #ruby
tomphp has joined #ruby
sepp2k has quit [Remote host closed the connection]
sepp2k has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
tomphp_ has joined #ruby
nowhereman_ has quit [Read error: Connection reset by peer]
nowhereman_ has joined #ruby
guille-moe has quit [Ping timeout: 265 seconds]
SeepingN has joined #ruby
nopolitica has quit [Quit: WeeChat 1.9]
nopolitica has joined #ruby
LenPayne has quit [Ping timeout: 240 seconds]
tomphp has quit [Ping timeout: 248 seconds]
LenPayne has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
plexigras has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
plexigras has joined #ruby
tomphp_ has quit [Read error: Connection reset by peer]
kurko_ has joined #ruby
tomphp has joined #ruby
rwb has quit [Ping timeout: 255 seconds]
tycoon177 has joined #ruby
tycoon177 has left #ruby [#ruby]
kurko_ has quit [Client Quit]
<nchambers>
for EventMachine::Connection#post_init, is there any way to get the ip address of the entity connecting?
<tcopeland>
background is I was hoping to write a thing that, at runtime and in the context of a rails app, would detect code like “heyo”.gsub(/yo/, ‘’) and suggest replacing it with “heyo”.remove(/yo/)
jeffreylevesque has joined #ruby
orbyt_ has joined #ruby
oleo has quit [Ping timeout: 255 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
plexigras has quit [Ping timeout: 240 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
hahuang65 has joined #ruby
sanscoe__ has quit [Remote host closed the connection]