msaffitz has quit [Quit: Computer has gone to sleep.]
sonicpon1 has joined #ruby-lang
cube526_ has joined #ruby-lang
Natch_z has joined #ruby-lang
spectra- has joined #ruby-lang
My_Hearing has joined #ruby-lang
CoverSli1e has joined #ruby-lang
brianpWins_ has joined #ruby-lang
unixabg_ has joined #ruby-lang
postmodern_ has joined #ruby-lang
gix has quit [Ping timeout: 264 seconds]
crackity_jones has quit [Ping timeout: 264 seconds]
spectra has quit [Ping timeout: 264 seconds]
cube526 has quit [Ping timeout: 264 seconds]
Natch has quit [Ping timeout: 264 seconds]
mistym has quit [Ping timeout: 264 seconds]
CoverSlide has quit [Ping timeout: 264 seconds]
postmodern has quit [Ping timeout: 264 seconds]
unixabg has quit [Ping timeout: 264 seconds]
solars has quit [Ping timeout: 264 seconds]
brianpWins has quit [Ping timeout: 264 seconds]
JustinCampbell has quit [Ping timeout: 264 seconds]
rue has quit [Ping timeout: 264 seconds]
Mon_Ouie has quit [Ping timeout: 264 seconds]
kain has quit [Ping timeout: 264 seconds]
Tasser has quit [Ping timeout: 264 seconds]
sonicpond has quit [Ping timeout: 264 seconds]
brianpWins_ is now known as brianpWins
Natch_z is now known as Natch
JustinCa_ has quit [Remote host closed the connection]
Tasser has joined #ruby-lang
solars has joined #ruby-lang
gix has joined #ruby-lang
dalekurt has quit [Quit: Zzz...]
stardiviner has joined #ruby-lang
acidreflux has joined #ruby-lang
QaDeS_ has quit [Quit: Ex-Chat]
msaffitz has joined #ruby-lang
msaffitz has quit [Client Quit]
bfreeman has joined #ruby-lang
postmodern_ has quit [Quit: Leaving]
postmodern has joined #ruby-lang
igotnolegs has joined #ruby-lang
flowerpot has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
headius has joined #ruby-lang
TheHunter_1039 has quit [Quit: TheHunter_1039]
flowerpot has quit [Ping timeout: 264 seconds]
Pip has joined #ruby-lang
Pip has quit [Changing host]
Pip has joined #ruby-lang
naz has joined #ruby-lang
kvirani has quit [Remote host closed the connection]
Rizzle has joined #ruby-lang
rmascarenhas has quit [Quit: leaving]
ViperMaul has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
Rizzle has quit [Ping timeout: 240 seconds]
mistym_ has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
qpingu has joined #ruby-lang
qpingu has left #ruby-lang [#ruby-lang]
acidreflux has quit [Remote host closed the connection]
<banisterfiend>
hey frens
<bnagy>
o/
<banisterfiend>
bnagy: fren.
ramonmaruko has quit [Remote host closed the connection]
acidreflux has joined #ruby-lang
<erikh>
helo
dfr|mac has joined #ruby-lang
<banisterfiend>
erikh: naggy, we can now read in and display a 2000 line class definition in 0.5 seconds using show-source :D
ramonmaruko has joined #ruby-lang
<banisterfiend>
erikh, naggy:
<bnagy>
which is good?
<banisterfiend>
bnagy: Hells Yeah, using our old technique it would take up to 5-10 seconds to display a 2000 lines class def
<erikh>
did you ever sort out what about my code was breaking your C parser?
<banisterfiend>
erikh: not yoru code specifically, but we had the problem with another gem and we fixed it by editing the C file and making it follow more standard style
<erikh>
feh
petercooper has quit [Remote host closed the connection]
ryanf has quit [Quit: leaving]
<banisterfiend>
erikh: basically he was casting a function pointing when binding a ruby method, uisng soething like: (VALUE (*)(ANY_ARGS))my_func
<banisterfiend>
or osme such
<banisterfiend>
and since yard (im pretty sure) just uses a simple regex to extract that stuff out, it freaks out and just ignores it
<banisterfiend>
it's just, for some strange reason, the monkey patch with the most method definitions is an 'eval' or something
msaffitz has joined #ruby-lang
florentg2 has joined #ruby-lang
<banisterfiend>
deryl: how do you feel about new versions of RVM performing 'bundle exec' by default? :/
<banisterfiend>
deryl: do you think u could get mpapis to revert that ? :D
macmartine has quit [Quit: macmartine]
acidreflux has quit [Remote host closed the connection]
macmartine has joined #ruby-lang
macmartine has quit [Read error: Connection reset by peer]
dalekurt has joined #ruby-lang
srbartlett has joined #ruby-lang
macmartine has joined #ruby-lang
<deryl>
*I* am actually having trouble with it NOT doing it.
<deryl>
so with pry in my @global, and pry in my gemfile, its picking the global over the Gemfile version
<deryl>
pissing me off actually
macmartine has quit [Read error: Connection reset by peer]
macmartine has joined #ruby-lang
macmartine has quit [Read error: Connection reset by peer]
umttumt has joined #ruby-lang
macmartine has joined #ruby-lang
<banisterfiend>
deryl: the problem i have with is that it's too much magic, if it doesn't work for someone it's becaues they forget to do bundle exec, but in my case i was doing everything correctly and it wasn't working due to a hidden 'bundle exec'. I prefer the explicit approach, and not to the magic implicit default
<deryl>
we shouldn't have to friggin bundle exec at ALL damn it
<banisterfiend>
deryl: but the main issue i hda with it was that it was a huge, breaking change and it wasn't properly communicated to people. So suddenly everything stopped working and i had no idea why
<deryl>
bundler should AUTOMATICALLY detect the damned Gemfile/Gemfile.lock and determine where the hell the gems are
<deryl>
i realize that means that bundler should somehow be autoloaded when you cd into a dir that a Gemfile pair resides in, but thats what rubygems-bundler is supposed to do
tindron has quit [Ping timeout: 248 seconds]
<deryl>
banisterfiend: if *I* knew more of the internals of bundler I'd try to figure it all out. unfortunately, I fully admit I'm not on that level yet
<banisterfiend>
deryl: but, what's wrong with you just intsalling rubygems-bundler if you want that behaviour? isn't that easy enough? i just dont think it should be the default, forcing everyone else to use it. IMO that magic implicitness should be expliticly enabled, rather than be the default
<deryl>
or at leat that i could do it fast
<deryl>
heheh i HAVE it installed
tindron has joined #ruby-lang
<deryl>
its just not working as its supposed to
<deryl>
thats the current problem and i haven't had the time to sit down with michal and figure out WHY its not working
<banisterfiend>
deryl: well, why not then make it an RVM config option? so a user who wnats that behaviour can just type: rvm enable auto-exec or something
<deryl>
I'm less than 2 weeks from moving
<deryl>
banisterfiend: now THAT is a friggin good idea!
<deryl>
open a ticket on RVM for me on that and cc @deryldoucette
<deryl>
as soon as I get a bit of free time during the next couple of days I'll discuss it with mpapis even if I can't work on implementation
<deryl>
(sorry but implementation time right now is just too much. My plate is actually overflowing. DTF has suffered as a result, as well as my RVM support time)
Sambalero has joined #ruby-lang
<deryl>
I *might* be able to do something about it this weekend. depends on a couple irl things, but just realized that tomorrow is Saturday so its possible
<banisterfiend>
deryl: Yeah, and in the meantime could u get them to put a huge warning message on the rvm website or something? :) because this new behaviour is really unexpected and confusing, and doesn't seem to be communicated nearly effectively enough
<banisterfiend>
and the way to turn it off is really obscure
<banisterfiend>
export NOEXEC=0
<deryl>
actually thats already a knob
florentg2 has quit [Quit: florentg2]
<deryl>
export noexec=0 iiirc
<deryl>
sec
<banisterfiend>
deryl: is wayne not doing active development on rvm anymore?
<deryl>
so mpapis and I are working on rvm, with mpapis leading it and me handling docs and site
umttumt has quit [Remote host closed the connection]
brianpWins has joined #ruby-lang
joast has quit [Quit: Leaving.]
s0ra_h is now known as sora_h
joast has joined #ruby-lang
imperator has joined #ruby-lang
yxhuvud has joined #ruby-lang
pcboy_ has quit [Read error: Operation timed out]
pcboy_ has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
gouthamvel has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
xtagon has quit [Read error: Operation timed out]
mssola has joined #ruby-lang
sora_h is now known as s0ra_h
jduan1981 has joined #ruby-lang
s0ra_h is now known as sora_h
neoesque has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
chill13j_ has joined #ruby-lang
woollyams has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
Pip has quit [Read error: Connection reset by peer]
Torrieri has joined #ruby-lang
Torrieri has joined #ruby-lang
ryanf has joined #ruby-lang
nertzy has quit [Quit: This computer has gone to sleep]
andrewhl has quit [Remote host closed the connection]
woollyams has quit [Quit: Computer has gone to sleep.]
Sambalero has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
msaffitz has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby-lang
zmack has joined #ruby-lang
perry is now known as perryh_away
sepp2k has joined #ruby-lang
Carnage\ has joined #ruby-lang
nick_h has joined #ruby-lang
perryh_away is now known as perryh
macmartine has quit [Quit: macmartine]
mortice has quit [Ping timeout: 250 seconds]
schroedinbug has joined #ruby-lang
mortice has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
imperator has left #ruby-lang ["Leaving"]
brianpWins has quit [Quit: brianpWins]
perryh is now known as perryh_away
burgestrand1 has quit [Quit: Leaving.]
banisterfiend has quit [Remote host closed the connection]
Torrieri has quit [Read error: Operation timed out]
postmodern has quit [Ping timeout: 250 seconds]
postmodern has joined #ruby-lang
dhruvasagar has joined #ruby-lang
woollyams has joined #ruby-lang
jduan1981 has quit [Quit: jduan1981]
Banistergalaxy has joined #ruby-lang
igotnolegs has quit [Quit: Computer has gone to sleep.]
Torrieri has joined #ruby-lang
Banistergalaxy has quit [Remote host closed the connection]
postmodern has quit [Ping timeout: 248 seconds]
postmodern has joined #ruby-lang
toretore has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
ryanf has quit [Quit: leaving]
workmad3 has joined #ruby-lang
qwerxy has joined #ruby-lang
Criztian has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
vmoravec has joined #ruby-lang
woollyams has quit [Ping timeout: 248 seconds]
QaDeS has joined #ruby-lang
voker57 has quit [Ping timeout: 246 seconds]
qwerxy has quit [Quit: offski]
chill13j_ has quit [Quit: Leaving]
IPGlider has joined #ruby-lang
Z33K|Lux has quit []
workmad3 has quit [Ping timeout: 240 seconds]
toretore has quit [Quit: Leaving]
robotmay has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
saLOUt has joined #ruby-lang
toretore has joined #ruby-lang
apeiros_ has joined #ruby-lang
kaspernj has joined #ruby-lang
burgestrand has joined #ruby-lang
cdt has joined #ruby-lang
a3li has quit [Ping timeout: 265 seconds]
a3li has joined #ruby-lang
banisterfiend has joined #ruby-lang
My_Hearing is now known as Mon_Ouie
lian_ has joined #ruby-lang
gnufied has joined #ruby-lang
lian_ has quit [Client Quit]
lianj has joined #ruby-lang
lianj has quit [Changing host]
lianj has joined #ruby-lang
tbuehlmann has joined #ruby-lang
Torrieri has quit [Read error: Operation timed out]
tbuehlmann has quit [Read error: Connection reset by peer]
qwerxy has joined #ruby-lang
tbuehlmann has joined #ruby-lang
jxie has quit [Ping timeout: 252 seconds]
lorinc has joined #ruby-lang
jxie has joined #ruby-lang
<whitequark>
apeiros_: ewww, pl/sql
<whitequark>
as per your benchmarks, there might be important differences
<whitequark>
e.g. java 1.6 vs java 1.7 have significant code generator changes
<whitequark>
same for gcc
<whitequark>
I'm pretty sure that JVM should have inlined that calc function
<whitequark>
maybe it didn't do that because it's static (i.e. might be called from outside). Could you extract these two functions to a class and then invoke it from the DBM?
thisirs has joined #ruby-lang
rolfb has joined #ruby-lang
<erikh>
pl/sql isn't java
<erikh>
oracle has a java api, but that isn't pl/sql.
Criztian has quit [Remote host closed the connection]
gsav has joined #ruby-lang
Carnage\ has quit [Read error: Connection reset by peer]
rue_XIV has left #ruby-lang [#ruby-lang]
Carnage\ has joined #ruby-lang
rue has joined #ruby-lang
<rue>
Stupid unregistered backup
<rue>
erikh: Maybe you only THINK it isn’t
<erikh>
yeah
<erikh>
well, I guess it could have changed since 8i
<erikh>
the last time I really used oracle was when that was the "hotness"
<andrewvos>
rue: rbfu
<erikh>
rbfu rules
<rue>
That sounds like an insult
<andrewvos>
Like "ruby fuck you"
<erikh>
or like ruby-fu
<erikh>
like if kato was a ruby user
<andrewvos>
Kenya Association of Tour Operators?
<andrewvos>
Seriously though. Weird that I can get so excited of a tool like that. It's just so fast though.
<erikh>
kung-fu, the series
neoesque has quit [Quit: Bye!]
<erikh>
david carradine
<erikh>
damn kids.
<rue>
Autoswitch still sounds suspicious
<rue>
andrewvos: How many versions do you have installed?
<erikh>
you don't need to turn it on
<erikh>
I have some shell functions you may find useful
<andrewvos>
rue: 2
<andrewvos>
rue: 2 + system
<apeiros_>
whitequark: which two functions? from the link? that was a blog I found when I googled
<apeiros_>
and yes, eeeew pl/sql :)
<andrewvos>
I need autoswitch because I work on a project that uses two rubies (don't ask).
<apeiros_>
right now it feels awfully underpowered. but right now that's probably mostly due to my own ignorance.
charliesome has joined #ruby-lang
<apeiros_>
whitequark: and yes, I'm pondering learning the java API instead. but I fear that's even more effort…
<apeiros_>
I mean, java isn't a difficult language. but it's freaking class hierarchy is a damn jungle, and I don't have a machete :-)
<erikh>
haha that's pretty standard for oracle products
<erikh>
that *is* easy.
futurechimp has quit [Ping timeout: 245 seconds]
<rue>
Yep :C
futurechimp has joined #ruby-lang
Carnage\ has quit [Ping timeout: 246 seconds]
thisirs has quit [Remote host closed the connection]
qpingu has joined #ruby-lang
toretore has quit [Quit: This computer has gone to sleep]
qpingu has quit [Quit: Leaving.]
virunga has joined #ruby-lang
saLOUt has quit [Quit: Konversation terminated!]
qpingu has joined #ruby-lang
GarethAdams has joined #ruby-lang
<GarethAdams>
Is there a builtin method which will both convert "08" to 8 (as String#to_i does) but will treat "123abc" as an error (as Kernel#Integer does)?
<Defusal>
GarethAdams, why not use regex? that's what it is for
qwerxy has quit [Ping timeout: 244 seconds]
<banisterfiend>
GarethAdams: why not just strip all leading 0
<GarethAdams>
banisterfiend: well I certainly *can*, but it's a weak 'convert-to-a-number' process if I have to do half of it myself
stiang has joined #ruby-lang
<GarethAdams>
but I've just found that Kernel#Integer takes a second radix argument which ignores the ruby integer literal syntax
<banisterfiend>
GarethAdams: well there might be something in active_support or so, but in stdlib/core i very much doubt they provide 30 different convert string to number routines with varying degrees of nuanced differences
Carnage\ has joined #ruby-lang
<GarethAdams>
banisterfiend: there's a little bit of hyperbole there. Although it's unusual for people to enter numbers with leading zeros it's not incorrect for them to do it
<GarethAdams>
it's not like you can tell users "Be sure to enter a value ruby integer literal"
<banisterfiend>
GarethAdams: im not saying there's anything wrong with it, just that i doubt there's yet another string-to-number routine in core/stdlib that caters for your particular use case
<GarethAdams>
no, I'm just saying it's not "yet another", it's "how people write numbers"
<banisterfiend>
but u might find something in active support or a gem
<GarethAdams>
least surprise, maybe?
<banisterfiend>
GarethAdams: well, there's already 2 methods, and neither of them work for u, so i would be surprised if there's a 3rd one in core/stdlib, that's all.
workmad3 has joined #ruby-lang
<GarethAdams>
Integer(str, 10) works
<banisterfiend>
what does the 10 do?
<GarethAdams>
base 10
<GarethAdams>
I do see what you're saying about not having lots of methods which just combine other methods
<GarethAdams>
This isn't PHP, after all
<banisterfiend>
interesting i didnt kow Integer took a second param
<GarethAdams>
only since 1.9.2
<banisterfiend>
cool
zmack has quit [Remote host closed the connection]
Carnage\ has quit []
qpingu has quit [Quit: Leaving.]
Carnage\ has joined #ruby-lang
kvirani has joined #ruby-lang
acyed has quit [Read error: Connection reset by peer]
acyed has joined #ruby-lang
qpingu has joined #ruby-lang
<kalleth>
you guys reckon ~3h approx is a good 'difficulty' level for a technical test for a dev?
IPGlider has quit [Ping timeout: 245 seconds]
<kalleth>
time-to-complete for me, that is
IPGlider has joined #ruby-lang
<kalleth>
its basically 'create a simple sinatra api per given spec' 'create a ruby script that consumes the data from that API and does clever stuff with it
<kalleth>
'
corundum has quit [Remote host closed the connection]
<kalleth>
my solution is ~200loc
corundum has joined #ruby-lang
thone has quit [Ping timeout: 244 seconds]
<GarethAdams>
is loc the metric they want minimised?
<kalleth>
you mean -we- want minimised, and no, loc is a horrible 'metric'
<kalleth>
its more 'can they code', check the output of the script is correct + handles certain gotchas (what if api not available, what if returns not json but something else, etc) and can they actually write code
thone has joined #ruby-lang
<GarethAdams>
I think in principle it's a good level
<kalleth>
i'm trying to make sure i'm not setting a technical test that's ridiculously overcomplicated or undercomplicated
<kalleth>
that's all :) first time writing one
futurechimp has quit [Ping timeout: 244 seconds]
<GarethAdams>
are they doing this on site or on their own time?
<kalleth>
own time
qpingu has quit [Quit: Leaving.]
<GarethAdams>
yeah I think that's pretty reasonable, I've been asked to do one of those and it worked well
<kalleth>
i like the idea of giving a programming exam, i don't like being asked to do one on-site in an interview
<kalleth>
USING THE WHITEBOARD, DO FIZZBUZZ is fine
<kalleth>
but anything more involved imo should be 'here it is, do it and get back to us'
stiang has quit [Quit: stiang]
futurechimp has joined #ruby-lang
<GarethAdams>
the key is that ~3h isn't generally enough time to write a complete solution. You're wanting to see successful operation with a couple of parameters, and some kind of hint at error handling
<rue>
Own time, 3 h might be tricky.
<GarethAdams>
and then you ask them what their next step would be
<rue>
Generally it’s a reasonable timeframe
<kalleth>
GarethAdams: 3h for me doing it includes error handling and successful operation :)
<GarethAdams>
kalleth: you also already know the API, presumably
<kalleth>
API is provided in a doc
<kalleth>
its really simple, 2 get URLs returning a fixed format JSON
<kalleth>
=> list of objects + urls to those objects, /object/ID => object-specific info
<kalleth>
client is obtain all objectinfo then do some simple math calcs on the object-specific data returned :)
qwerxy has joined #ruby-lang
<kalleth>
sec, i'll pastie the doc
<kalleth>
we're sending it out to interviewees so it's not like it's secret or anything :P
<GarethAdams>
ok, 3h sounds like a reasonable time frame then
<rue>
andrewvos: A Ruby job, I’d consider relocating (eventually) to London…or Barcelona, Berlin, … ;) Right off the bat just some on-site, though, I think.
neocoin has quit [Remote host closed the connection]
dfr|mac has quit [Remote host closed the connection]
echoprinter has left #ruby-lang [#ruby-lang]
dfr|mac has joined #ruby-lang
dfr|mac has quit [Remote host closed the connection]
<yorickpeterse>
it's a shame there are not many non Rails shops around here (at least that I know of)
<gnufied>
yorickpeterse: russia or dutch?
pharaoh has joined #ruby-lang
<yorickpeterse>
Holland
dfr|mac has joined #ruby-lang
<apeiros_>
I think there's a couple in amsterdam
rolfb has quit [Quit: Leaving...]
<apeiros_>
at least there were quite some railsers at euruko
<yorickpeterse>
Most that I know of are just generic Rails shops
dfr|mac has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
kvirani has joined #ruby-lang
outoftime has joined #ruby-lang
fgomez has quit [Remote host closed the connection]
<ddfreyne>
yorickpeterse: where are you from exactly?
dv310p3r has joined #ruby-lang
acidreflux has joined #ruby-lang
cantonic has joined #ruby-lang
jbsan has joined #ruby-lang
<yorickpeterse>
NL
cantonic_ has joined #ruby-lang
<rue>
Ha
<rue>
Do you know that one guy in the Netherlands? His name is Jan
<rue>
ddfreyne: He tricks us into thinking he’s danish, but alas poor Yorick isn’t
<yorickpeterse>
Because there's one guy with that name, right? :)
<rue>
yorickpeterse: It’s about as exact as your answer ;)
<rue>
Still, there’s not that much space anyway
sailias has joined #ruby-lang
krohrbaugh has joined #ruby-lang
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
<yorickpeterse>
But no, I don't think I know anybody named Jan
kyrylo has joined #ruby-lang
krohrbaugh has quit [Read error: Connection reset by peer]
rippa has joined #ruby-lang
<ddfreyne>
I know a lot of Jans
<ddfreyne>
more Jans in NL than in BE?
<ddfreyne>
or the other way around maybe
dhruvasagar has joined #ruby-lang
krohrbaugh has joined #ruby-lang
akira989 has joined #ruby-lang
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 246 seconds]
<rue>
Probably other way
mistym has joined #ruby-lang
mistym has joined #ruby-lang
<rue>
There’s Jan Bakelandts at least
JustinCampbell has joined #ruby-lang
imperator has joined #ruby-lang
<imperator>
good morning
<rue>
Good internet time of day, sir
dbck has joined #ruby-lang
dbck has left #ruby-lang [#ruby-lang]
Carnage\ has quit [Ping timeout: 244 seconds]
<yorickpeterse>
rue: you're up norf of Europe right?
<rue>
HEL .fi
<yorickpeterse>
ah
<yorickpeterse>
Yeah, those fuckers with all the oil laughing about Europe going to shit
akira989 has quit [Remote host closed the connection]
<imperator>
finland has oil?
bglusman has joined #ruby-lang
<apeiros_>
snake oil
<imperator>
finland has snakes?!
<apeiros_>
on planes!
<imperator>
looks like most of their power is nuklar
<apeiros_>
have I ever mentioned how much fun finding duplicates in a customer db is? :)
<apeiros_>
nucular!
<apeiros_>
nu-cu-lar. homer knows best.
<rue>
yorickpeterse: No, that’s Norwegia
<imperator>
apeiros_, are you sure it's the same person?
<yorickpeterse>
Lies! You're not telling us about the internet oil
<apeiros_>
imperator: you think it's one?
<apeiros_>
I'm searching a db of a couple of 100k people for duplicates. it's a fun time waiting for results…
<apeiros_>
then readjust the query
<apeiros_>
then wait again…
<apeiros_>
so much fun. I'm almost sploding…
<rue>
Well, there’s irc
<yorickpeterse>
^
<yorickpeterse>
and cat pictures
<apeiros_>
why do you think I'm here :D
<rue>
“Running DB queries!”
<workmad3>
it's caturday!
<apeiros_>
rue: yeah, totally the new "Compiling!"
<yorickpeterse>
No, it's "Fuck you friday"
<apeiros_>
maybe I should add some indexes, eh? :)
<mistym>
yorickpeterse: I heard Google built a cluster for that
<rue>
apeiros_: …Might be a good idea
<workmad3>
apeiros_: sure... although then you'll be waiting for those indexes to be added
<yorickpeterse>
mistym: haha
<apeiros_>
workmad3: that actually works pretty fast
<yorickpeterse>
apeiros_: meh, searching for duplicates isn't that difficult and can be done quite fast
<imperator>
apeiros_, there's no index? no unique key like an SSN (or equivalent)
<yorickpeterse>
even without indexes
<apeiros_>
most are in the single digit seconds area
<apeiros_>
imperator: there are indexes, but not necessarily the best ones for the queries I currently run
<workmad3>
apeiros_: adding an index is dependent on the amount of data that's already there
<apeiros_>
workmad3: yeah, sure, also on the kind of index. a function index will take longer.
<workmad3>
apeiros_: true
<imperator>
i index every column, that way they're all faster
<workmad3>
imperator: hahahaha
fgomez has joined #ruby-lang
<rue>
yorickpeterse: How do you propose?
<apeiros_>
but even adding an index for the transliterated name is some couple of seconds, so pretty fast
jondot has joined #ruby-lang
<apeiros_>
(the amount of data is as said a couple of 100k customer records)
pharaoh has quit [Quit: Konversation terminated!]
<yorickpeterse>
rue: loop through an N number of rows (keeps memory usage down instead of retrieving 100k at a time) and generate some sort of hash of the field you're looking at. This hash (as in hash digest) is stored in a Hash.
<yorickpeterse>
Then on each iteration you simply check if the hash already exists
<yorickpeterse>
if so, you have a duplicate
<yorickpeterse>
I however doubt this works in terms of memory usage for a lot of records
<yorickpeterse>
Ruby doesn't like it when you shove a lot in a Hash and don't prune it once in a while
<apeiros_>
yorickpeterse: hash matches don't work all that well with jaro_winkler matching ;-)
<yorickpeterse>
well yeah, it depends on your data
<apeiros_>
also you can't create an index for that
<rue>
Could use it to reduce your working set, though
<yorickpeterse>
if you're searching through things like comments where "Hello" != "Hello!" then yes, it doesn't work very well
<yorickpeterse>
Though you can normalze your data before comparing it
<apeiros_>
rue: yes, I have data that reduce the working set. otherwise this query would take hours or even days…
<apeiros_>
yorickpeterse: you misunderstand the problem.
<apeiros_>
the data IS normalized
<apeiros_>
you know what jaro_winkler matching is?
<apeiros_>
or what the jaro winkler algorithm is…
denysonique has quit []
<yorickpeterse>
ugh, missed that
<yorickpeterse>
sorry :)
<apeiros_>
np :)
<yorickpeterse>
Yeah, that doesn't work with hashes
<yorickpeterse>
What exactly is the reason for using jaro winkler opposed to levenshtein?
Carnage\ has joined #ruby-lang
savage- has joined #ruby-lang
<apeiros_>
but it takes too long… I estimate it to be around 2.5mio pairs it should have to match after the other join conditions, and that shouldn't take that long…
<apeiros_>
yorickpeterse: better suited for name comparison. it yields much better results.
<yorickpeterse>
Ah
Carnage\ has quit [Client Quit]
denysonique has joined #ruby-lang
<apeiros_>
you see, "Yorick van Peterse" and "Yorick Peterse" are mostly the same name. yet its levenshtein distance is 3
<yorickpeterse>
Hm, that's a good one
<apeiros_>
and with that distance, you get things to match, that aren't even closely related
<apeiros_>
with jaro winkler you get that one easily
<apeiros_>
also things like "Peterse Yorrick" vs. "Yorrick Peterse" - huge distance in levenshtein, very high similarity rating in jaro winkler
<apeiros_>
(and trust me, people do mess up with first- vs. last-name - especially with foreign names)
<yorickpeterse>
hehe yeah, I know
<yorickpeterse>
It's interesting to see how some people can't even spell their own name
<apeiros_>
^^
<apeiros_>
and me not being able to spell yorick, even though I see it right in front of me ;-)
<yorickpeterse>
haha don't worry, I've long since stopped caring about how people write or pronounce it
<yorickpeterse>
Especially my last name seems hard for non Dutch people
* FiXato
cringes every time people write his wallet name as Philip or even Fhilip instead of Filip ><
<FiXato>
especially when it is an e-mail reply that clearly has the correct spelling in the sender name and signature ><
krohrbaugh1 has joined #ruby-lang
<rue>
Felipe
krohrbaugh has quit [Ping timeout: 244 seconds]
<imperator>
Tim
futurechimp has quit [Read error: Connection timed out]
<apeiros_>
hi Phillippe :)
<apeiros_>
triple-cringe? :D
futurechimp has joined #ruby-lang
<apeiros_>
oh, quadruple even…
Sambalero has joined #ruby-lang
<imperator>
Phil
<yorickpeterse>
Fhillippe
<imperator>
Battle of Phillipi
<yorickpeterse>
By now he's probably jumping out of a window
<kyrylo>
:D
<imperator>
he's czech?
<kyrylo>
From Philippines.
<yorickpeterse>
* Fhilippines
zz_wasnotrice is now known as wasnotrice
codewrangler has joined #ruby-lang
<kyrylo>
The Czhech from Fhilippines, yes.
<rue>
Peter Cech, the Czech, must get all kinds of czit…
<whitequark>
is there a strtoul analog in ruby?
<whitequark>
like .to_i, but which would detect 0x prefix
<yorickpeterse>
You want to convert something to hexadecimal?
<yorickpeterse>
errr
<yorickpeterse>
wait, that might not be hex. I might be being silly here
<whitequark>
yorickpeterse: I want one function which works like strtoul. That is, converts from hex if there's 0x prefix and from dec if there is none
<yorickpeterse>
Hmm
bglusman has quit [Read error: Connection reset by peer]
<yorickpeterse>
I wouldn't know actually, but it wouldn't be too difficult to make I suppose
bglusman has joined #ruby-lang
<rue>
Try Integer?
<rue>
Integer("0xF")
<rue>
Etc.
<yorickpeterse>
def strtoul(n); if n =~ /^0x/; n.hex; else; n.to_f; end;
<apeiros_>
aaaaaaaah!
<yorickpeterse>
I really shouldn't write Ruby on a Friday at work
<apeiros_>
naming a method strtoul is a crime against humanity
<yorickpeterse>
:>
<rue>
It makes totally sensible
<apeiros_>
could be mongolian, though…
<yorickpeterse>
Missed an end actually :<
<FiXato>
congratulations yorickpeterse, you've just killed me ;p
wallerdev has joined #ruby-lang
<yorickpeterse>
haha
<yorickpeterse>
Well, then who's this talking? The ghost of Filippe that will haunt us forever?
<FiXato>
the ghost in the shell
<yorickpeterse>
yay beer
<yorickpeterse>
I should probably stop talking now
akira989 has joined #ruby-lang
chimkan_ has joined #ruby-lang
<yorickpeterse>
awww yeah, beer + C. Nothing can go wrong
<imperator>
beer + C++. Everything can go wrong
DHOSS is now known as dhoss
spuk has quit [Ping timeout: 265 seconds]
spuk has joined #ruby-lang
savage- has quit [Remote host closed the connection]
gouthamvel has joined #ruby-lang
<rue>
Beer + C++ = C±
<banisterfiend>
yorickpeterse: can u pull down bugfix/yozzy and tell me if $ ActiveRecord::Base is fast now
slyphon has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<yorickpeterse>
yeah sure
<yorickpeterse>
oh god....I had half a can and my typing is already going to shit
<banisterfiend>
yorickpeterse: not master, bugfix/yozzy
arooni-mobile has quit [Read error: Connection reset by peer]
<imperator>
burgestrand, or checkout the ffi branch of the win32-nio project if you want the full source
dmwuw has joined #ruby-lang
<burgestrand>
imperator: are unions FFI::Pointers?
<burgestrand>
I’m wondering if you need to map the array and get the pointers to their base
<lianj>
"aSegmentArray [in] - A pointer to an array of FILE_SEGMENT_ELEMENT buffers that receives the data." - you have a pointer to an array of pointers
<burgestrand>
what it said ^
<burgestrand>
Possibly :p
<imperator>
FILE_SEGMENT_ELEMENT is a union
<burgestrand>
Oh, durr.
<burgestrand>
imperator: you’re trying to fill the array with pointers
<burgestrand>
imperator: instead of the actual unions
<burgestrand>
imperator: if you had an array of pointers, put_array_of_pointer would work
<imperator>
i guess i thought that's how ffi wanted it
<burgestrand>
(like, if segment_array was an array of pointers, and not an array of unions)
<imperator>
ok so, uh, how do i create a pointer to an array of fse ?
<imperator>
i have the array filled with the fse's i need, just need to make a pointer to it
<burgestrand>
imperator: I’m not sure how to copy the entire unions to their respective place in the array, I usually just deal with pointers
* burgestrand
word juggling
<burgestrand>
imperator: yeah, pretty much
<burgestrand>
imperator: or, probably in this case, create a C array that can fit all the fse’s (you’ve done this with segment_array) and copy the values for each fse to it’s rightful place
kvirani has quit [Remote host closed the connection]
arooni-mobile has joined #ruby-lang
<burgestrand>
trying to find any mention of how to do it in the wiki
qpingu has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby-lang
<burgestrand>
!
bglusman has joined #ruby-lang
<banisterfiend>
burgestrand: did u hear that Mon_Ouie uploaded a 1 gigabyte gem "just for the hell of it" ?
<burgestrand>
banisterfiend: :d
<imperator>
burgestrand, did you find something?
unixabg_ has quit [Quit: leaving]
<burgestrand>
imperator: you might be able to use write_array_of_type
<lianj>
mine doesnt create useless structs first :P
<burgestrand>
:P
<burgestrand>
interesting approach really
<burgestrand>
I like that one, took me a while to wrap around it
<burgestrand>
Essentially typecast and then memory modification right off the bat!
<lianj>
hehe
<burgestrand>
Granted if you already have the structs from somewhere else it’ll be a bit troublesome, but if you create them at the spot might just as well do that
qpingu has quit [Quit: Leaving.]
<imperator>
progress!
<burgestrand>
There really is no write_array_of_struct.
<burgestrand>
I’m in the wrong timezone to ask Wayne.
unsymbol has joined #ruby-lang
badfish129 has joined #ruby-lang
<imperator>
ok, i think that worked lianj, now i just have to fix the overlapped struct; something wrong there
<imperator>
thanks guys!
dhruvasagar has joined #ruby-lang
cantonic has quit [Read error: Connection reset by peer]
robotmay has joined #ruby-lang
chimkan_ has quit [Quit: chimkan_]
mistym has quit [Remote host closed the connection]
Sambalero has quit [Remote host closed the connection]
cirwin has joined #ruby-lang
cirwin has quit [Changing host]
cirwin has joined #ruby-lang
wasnotrice is now known as zz_wasnotrice
gsav has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
msaffitz has quit [Quit: Computer has gone to sleep.]
<KINGSABRI>
Is there a way to send " EventMachine::start_server" to background by eventmachine ?
Sambalero has joined #ruby-lang
kvirani has joined #ruby-lang
Axsuul has joined #ruby-lang
IPGlider has joined #ruby-lang
asahi has joined #ruby-lang
<asahi>
can someone tell me how I can do a wildcard search and replace? I want something like s/foo./bar./g which would change foo1 to bar1
workmad3 has joined #ruby-lang
workmad3 has quit [Client Quit]
workmad3 has joined #ruby-lang
<augustl>
rue: :D
<augustl>
rue: planning a series of articles on crypto as well, there's not much material out there
jarred has quit [Quit: jarred]
<rue>
That’d definitely be welcome
<rippa>
asahi: string.gsub /foo(.)/, "bar\\1"
<augustl>
with examples in ruby and node.js, at least
<asahi>
rippa: ah thanks
kain_ is now known as kain
krohrbaugh has joined #ruby-lang
imperator has joined #ruby-lang
<workmad3>
augustl: good articles on crypto would be awesome :)
<workmad3>
augustl: not much out there, and what is there tends to be wrong :)
rking has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 265 seconds]
badfish129 has quit [Ping timeout: 240 seconds]
rking has joined #ruby-lang
fayimora has joined #ruby-lang
dalekurt has quit [Quit: Zzz...]
fayimora_ has joined #ruby-lang
<augustl>
most of the articles out there seems to be someone that tried 4 or 5 differen things and sort of got something to work kinda
<augustl>
not just for crypto, it applies to almost all things
KINGSABRI has quit [Ping timeout: 264 seconds]
corsican has quit [Ping timeout: 265 seconds]
heftig has quit [Quit: leaving]
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
<cirwin>
augustl: this looks cool, thanks
heftig has joined #ruby-lang
<imperator>
lianj, burgestrand, is there some trick to using structs as in/out params?
fayimora has quit [Read error: Connection reset by peer]
fayimora has joined #ruby-lang
<imperator>
i've got an overlapped struct which it accepts fine, but it doesn't actually seem to set any of the members after the ReadFileScatter call
lsegal has joined #ruby-lang
kalleth has quit [Ping timeout: 248 seconds]
Guedes is now known as Guedes_out
bglusman has quit [Remote host closed the connection]
neocoin has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
gsav has quit [Ping timeout: 240 seconds]
chimkan has joined #ruby-lang
chimkan has quit [Client Quit]
kain has quit [Ping timeout: 248 seconds]
fayimora has quit [Read error: Connection reset by peer]
fayimora has joined #ruby-lang
fayimora_ has joined #ruby-lang
boobah has joined #ruby-lang
gouthamvel has joined #ruby-lang
erics has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
jstemmer has joined #ruby-lang
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
Skif has quit [Ping timeout: 240 seconds]
IPGlider has quit []
cirenyc has quit [Quit: Leaving...]
gsav has joined #ruby-lang
workmad3 has joined #ruby-lang
<drbrain>
augustl: you should audit against the OpenSSL documentation in trunk
<lianj>
imperator: overlapped? if you pass it a pointer to it should use/write to it or segfault if the pointer passed is not right (at least if its too small)
ryanf has joined #ruby-lang
sepp2k1 has quit [Ping timeout: 246 seconds]
<yxhuvud>
Heh. And next in the line of my constant amazement over the string literals, %(foo()bar) is a valid string o_O
<drbrain>
dang, Martin made this even longer than when I last checked
<drbrain>
augustl: but I think, at least, your cheat sheet should have something like "only use asymmetric encryption for secure key exchange"
<drbrain>
as the OpenSSL documentation linked above does
sepp2k has joined #ruby-lang
kalleth has quit [Ping timeout: 246 seconds]
kalleth has joined #ruby-lang
cantonic has joined #ruby-lang
fayimora has joined #ruby-lang
timvdalen has joined #ruby-lang
MrPunkin has joined #ruby-lang
codewrangler has joined #ruby-lang
<MrPunkin>
Okay, so what method does calling String(args) run on the String class?
<MrPunkin>
it doesn't seem to be the same as String.new, or Array() vs Array.new
<MrPunkin>
from what I can tell
<drbrain>
MrPunkin: it calls to_s on the object
<drbrain>
MrPunkin: well, it calls rb_convert_type(val, T_STRING, "String", "to_s");
<drbrain>
similarly, Kernel#Array calls to_a
<apeiros_>
drbrain: doesn't it try to_ary first?
* apeiros_
never sure
zz_wasnotrice is now known as wasnotrice
<drbrain>
apeiros_: ah, it does, I forgot what rb_check_array_type() did
<MrPunkin>
drbrain… so say you know that you have an object, and you have a class you want it converted to, but don't know the to_s / to_a notation in the code how could you do it? Like I have a class and an object that needs to be converted to the class. I'd prefer not to write a bunch of case conditions
<drbrain>
Kernel#String does the same (to_str then to_s)
<MrPunkin>
was hoping for something like clazz(obj) but then it throws a missing method error because there is no clazz() method
dalekurt has joined #ruby-lang
krohrbaugh1 has joined #ruby-lang
fayimora has quit [Ping timeout: 246 seconds]
<apeiros_>
MrPunkin: you can use a hash lookup. make the class the key.
heftig has joined #ruby-lang
<apeiros_>
for many conversions, there is no meaningful single way
<drbrain>
^^ yup
<MrPunkin>
Thanks. I'm only really working with arrays right now so rather than code around possible scenarios (internal code only) I'll just assume they are arrays until I need to dig deeper, should I ever need to
<apeiros_>
MrPunkin: also push conversion to the supplier
<apeiros_>
the "be broad in what you accept" idea is IMO utter bullshit. be narrow in what you accept.
<timvdalen>
Hi. I'm a new Ruby user and I'm having some trouble with the socket library. I am trying to listen for HTTP connections, but when I read from the session, I get a 'connection reset by peer'. I posted the code I'm using here: https://gist.github.com/3020595 . I have also tried to use session.read or session.gets in a while loop, with the same results. If I don't read from the session and just print some data to it anyway, the server work
<timvdalen>
So I'm hoping to find someone with socket experience here
<apeiros_>
the only one who really knows how to properly convert his input is the supplier.
krohrbaugh has quit [Ping timeout: 246 seconds]
<drbrain>
oh, I misread rb_Array, it does to_ary then to_a then [arg]
<drbrain>
timvdalen: shoot
rippa has quit [Ping timeout: 245 seconds]
<timvdalen>
drbain: Can you see what's going on in my code?
<drbrain>
timvdalen: why do you write a response before reading the request?
<timvdalen>
drbain: I was following some guide
<timvdalen>
drbain: let me swap those lines
<drbrain>
and, why not WEBrick (or some other ruby web server)?
<timvdalen>
Awesome, it works now
<timvdalen>
Thanks, that was really basic haha
<timvdalen>
I'm writing a little server that listens for POST data, it won't get more complicated that this
<timvdalen>
But I will look into WEBrick
<timvdalen>
Thanks for mentioning it
sepp2k has quit [Remote host closed the connection]
<drbrain>
I just wanted to check
<timvdalen>
It does look a lot easier, but I think I kind of have everything I need with this
<apeiros_>
timvdalen: I'd recommend straight rack
<apeiros_>
it normalizes the webserver interface. meaning you can put it on top of any webserver. or just run it standalone.
<apeiros_>
and it is very easy to use :)
<timvdalen>
Sounds interesting, thanks
sockmonk has quit [Ping timeout: 248 seconds]
hynkle has quit [Quit: Computer has gone to sleep.]
msaffitz has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
Jenny_ has joined #ruby-lang
msaffitz has quit [Quit: Computer has gone to sleep.]
tjadc has joined #ruby-lang
kvirani has quit [Remote host closed the connection]
Dreamer3 has joined #ruby-lang
mrsolo has joined #ruby-lang
<augustl>
drbrain: that makes sense, thanks
carloslopes has quit [Quit: Leaving.]
JustinCampbell has quit [Remote host closed the connection]
butchanton has quit [Ping timeout: 244 seconds]
jperry2 has quit [Ping timeout: 265 seconds]
fayimora has joined #ruby-lang
gregf has joined #ruby-lang
gregf is now known as Guest29213
<MrPunkin>
can someone explain to me a good way to escape quotes used inside strings with Ruby 1.9's encoding?
<apeiros_>
MrPunkin: hu? what's got encodings to do with that?
<apeiros_>
you escape any character with \
<apeiros_>
you can use %{} and friends to reduce the amount of escaping you have to do if your string contains " and '
<MrPunkin>
I'm using the CSV class to parse a csv file, and some of the fields have quotes in them. However… the end result is a string where every double quote is showing up as \\\\ and I'm not even trying to fix anything just yet.
<timvdalen>
Well, I got a HTTP server that can read and echo whatever I POST to it in 20 lines. Thanks for your help
Jenny_ has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0.1/20120614114901]]
Austin__ has left #ruby-lang [#ruby-lang]
imperator has joined #ruby-lang
kain has joined #ruby-lang
<augustl>
MrPunkin: can you elaborate on "showing up as"?
<augustl>
obviously, "p" alters the output a lot, etc
ryanf has quit [Quit: leaving]
virunga has quit [Read error: Connection reset by peer]
<MrPunkin>
augustl: I'm writing exif via exiftool on the command line. I'm guessing something is getting messed up there maybe since the strings appear fine in a print from ruby.
<augustl>
strings are evil.. I wish there was a "chunk of bytes" type in Ruby :)
<augustl>
dumping stuff to file and using a hex editing tool is some times useful when dealing with parsing oddities
<rue>
Where does what show up, and how, and what is the difference with print?
<apeiros_>
augustl: chunk of bytes? that's pretty much what a String with binary encoding is…
<apeiros_>
or what else do you need?
<apeiros_>
(that said, I wished that String inherited from BinaryString or somesuch, so that we could have an encoding-less string class)
yxhuvud has quit [Ping timeout: 252 seconds]
dv310p3r has quit [Ping timeout: 246 seconds]
ttilley is now known as ttilley_off
misham has joined #ruby-lang
<augustl>
apeiros_: yeah true, I'm not yet used to 1.9 encoding stuff..
<augustl>
would be nice with a "safer" object though, something like BinaryString
TheDracle has joined #ruby-lang
<augustl>
I suppose one could argue that it would be useful to allocate raw bytes somewhere, similar to Buffer in node, for building your own data structures and what not
<augustl>
but now I'm just rambling :)
<apeiros_>
augustl: as said, you can that. use a string with binary encoding.
gregmoreno has joined #ruby-lang
<apeiros_>
you can *do* that
<apeiros_>
failday…
gregmore_ has quit [Ping timeout: 246 seconds]
<workmad3>
is the .bytes method not good enough?
<workmad3>
"ï".bytes #> enumerator over the bytes
<augustl>
without knowing what I'm talking about at all, I'm imagining that implementing clojure style persistent data structures in Ruby would be hard without writing C extensions
<augustl>
solely based on the feeling that doing it with strings is probably bad :)
gsav has quit [Ping timeout: 264 seconds]
jondot has quit [Ping timeout: 248 seconds]
<TheDracle>
Do you mean persistent as in immutable?
gsav has joined #ruby-lang
<TheDracle>
In that, modifications to the structure preserves the original immutable instance and creates a new one with the modification?
<apeiros_>
augustl: overcome your fears :-p
<TheDracle>
Or persistent as in marshaled?
<apeiros_>
a binary encoded string is just an array of bytes
<augustl>
TheDracle: yeah, persistent as in immutable
workmad3 has quit [Ping timeout: 264 seconds]
<TheDracle>
augustl, So you'd like to patch existing data structures to behave this way always?
<TheDracle>
augustl, This is sort of how most operations on objects are handled all ready by convention. I.E: 'Test'.gsub('Test', 'Tested') => 'Tested' (But 'Test' is unmodified unless you do .gsub!)
<augustl>
TheDracle: there are some quirks to persistent structures to make them perform well (it's explained in talk I just linked)
<TheDracle>
augustl, Probably compiler level optimizations to make use of the fact that things are immutable.
Axsuul has quit [Read error: Operation timed out]
<augustl>
it's not just about removing mutability methods, it's much more about how you create copies/modified versions
cirenyc has joined #ruby-lang
<TheDracle>
augustl, Like tail recursive functions being able to be flatted out into plain loops.
<TheDracle>
Ahem, flattened.
<augustl>
TheDracle: it's more that when copying a data structure, you only need to copy the parts that changes, since everything is immutable anyways
<TheDracle>
This isn't something ruby is going to be able to do.
<TheDracle>
You could probably implement something similar to that.
<TheDracle>
But you'd basically be making your own collection.
<augustl>
yeah, that's what Clojure does too
jondot has joined #ruby-lang
<TheDracle>
Or maybe modify the standard collections.
<augustl>
could always use JRuby and make clojure data structures from there :)
<TheDracle>
But basically you could make the returned array keep something that links it to the original array, and has sort of a 'patch_set' to modify itself to be the new future array.
<TheDracle>
Or the modified array.
<TheDracle>
And just chain them together.
<TheDracle>
But you'd basically be implementing that yourself.
imperator has quit [Quit: Leaving]
<TheDracle>
Too many basicallys :0 Sorry ;)
<TheDracle>
Brain malfunction.
<drbrain>
ruby arrays and strings are already COW across instances
<TheDracle>
Do they perform the sort of optimization augustl is talking about?
<TheDracle>
Maybe so.
<augustl>
COW is exactly what clojure's data structures isn't
<drbrain>
so s = "s" * 1_000_000; t = s.dup only allocates 1 MB of string (not 2)
<augustl>
hmm I should stop talking, I apparently don't know what copy on write actually is :)
<TheDracle>
s.dup + 'A'?
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
<TheDracle>
Would it describe itself internally by referencing the original and itself as just a modification to it?
<augustl>
that is also bad, afaik, as a lot of "copies" would be a whole lot of links, which causes poor read performance (many pointers to traverse)
Hakon|mbp has joined #ruby-lang
<TheDracle>
I think s.dup + 'A', would create a new string.. But I'm not entirely sure. I'm completely out of touch with Ruby1.9 and whatever the hell is happening with ruby these days.
<TheDracle>
So is that not what Clojure does?
fayimora has joined #ruby-lang
<TheDracle>
Does it produce one actual instance of the original immutable data, and a completely new instance of it on alteration?
<drbrain>
TheDracle: I think that allocates a new string instead of swapping the way the sharing goes
<drbrain>
the closest thing I can imagine to what augustl is describing is a Struct with COW per field
<drbrain>
an object's instance variable table behaves that way on dup
<TheDracle>
Right.. Sort of an interesting concept.
<TheDracle>
Hm, so, it will share all instance variables with objects it was duped from, except ones it has personally altered?
<augustl>
here's a slide from the talk that demonstrates how a copy is made of a persistent structure
<augustl>
the leftmost node in purple with a red border gets an element added to it
<drbrain>
TheDracle: if you alter a field the alteration will be shared
<augustl>
thre tree on the right demonstrates the memory the copy allocates
<drbrain>
TheDracle: you need to replace it in ruby using assignment
cantonic has quit [Quit: cantonic]
<augustl>
in other words, just the changed part, everything else is references to the structure it copies from
<drbrain>
if you ignore mutability in ruby, both behave the same
<drbrain>
but in ruby we don't use dup much
MrPunkin has quit [Quit: MrPunkin]
<TheDracle>
Yeah, clojure I think is optimizing for space versus processing time in a way.
Dreamer3 has quit [Quit: Leaving...]
<TheDracle>
Most functional languages I've used simply copy immutable structures on write.
<drbrain>
TheDracle: there shouldn't be any loss in processing time
<augustl>
clojure doesn't, thankfully :)
<TheDracle>
drbrain, I would think if they're doing something that refers to another data structure, and is just representing a change to that structure, then it will have to link to it somehow.
<zenspider>
augustl: addition for your cheatsheet: cert_store = OpenSSL::X509::Store.new; cert_store.set_default_paths; http.cert_store = cert_store
fayimora_ has joined #ruby-lang
<zenspider>
I hate that shit
<zenspider>
I'm spoiled by osx
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
<drbrain>
TheDracle: the pointers are the same as the original
<TheDracle>
Hm, I'll have to watch their presentation.
<augustl>
zenspider: sounds like a http.rb is a sensible addition to the cheat sheet
<augustl>
how to verify that a server is signed by a CA you manually specify, for example
<zenspider>
that too... but in this case it was an error where everything worked fine locally and failed on CI because that was running freebsd
<augustl>
ah, the default cert store is different across platforms?
<TheDracle>
drbrain, So it has the original pointer, but somehow has the information that lets it walk the tree to reconstruct the finished 'adjusted' data structure?
<zenspider>
apparently (according to drbrain) openssl on osx is "special" and always uses the keychain
<drbrain>
TheDracle: there will be a small cost in implementing COW, but it should be much, much cheaper to allocate memory once a little later than duplicating the entire struct and its contents immediately
<drbrain>
TheDracle: follow the dotted lines down on the graph
<TheDracle>
drbrain, Yeah, my point was I thought COW was a small cost, where Clojure was incurring a processing cost.
<TheDracle>
Ah.
fayimora has quit [Ping timeout: 246 seconds]
<augustl>
I recommend the talk I linked :) Rich Hickey explains this better than most
<TheDracle>
So, with ParseTree no longer viable with ruby1.9.3, what is going to replace it?
<zenspider>
too bad he's a crappy public speaker
<TheDracle>
Or ruby 1.9+
<drbrain>
ruby_parser
<zenspider>
ruby_parser, but that's static parsing only
<TheDracle>
Hm.
<zenspider>
nothing will replace the live ast access
<TheDracle>
What about for dynamic parsing? No options?
<TheDracle>
Well that is disappointing...
<augustl>
zenspider: I love all his talks, very high quality content
<zenspider>
TheDracle: dynamic parsing? I don't know what that means
<zenspider>
augustl: good signal:noise. bad delivery
<TheDracle>
zenspider, Like you said, obtaining the AST of something dynamically.
msaffitz has quit [Quit: Computer has gone to sleep.]
<zenspider>
TheDracle: not parsing. parsetree never parsed anything.
<TheDracle>
Right.. I would say though it is necessary to perform dynamic parsing... Lol, sorry for the confusion.
woollyams has quit [Quit: Computer has gone to sleep.]
BigFatFatty has left #ruby-lang [#ruby-lang]
erics has joined #ruby-lang
<zenspider>
still not sure what you mean by that... but whatever.
<TheDracle>
Although walking the AST it's already been parsed, so I mean, semantic analysis.
<zenspider>
aaaand... semantic analysis has nothing to do with parsing... or ParseTree
<TheDracle>
It has to do with doing anything reasonable with something that has been parsed.
qpingu has quit [Quit: Leaving.]
<TheDracle>
I basically mean, I can't grab some object I've monkey patched to hell, in whatever live state it is, obtain an AST from it to do anything dynamically, it sounds like. I have to provide ruby directly and have it parsed to get an AST, which isn't particularly useful for the problem I was working on.
Skif has quit [Ping timeout: 240 seconds]
<zenspider>
welcome to 1.9
mssola has quit [Quit: Konversation terminated!]
<zenspider>
that's just one of the many ways that 1.9 fucked up
harmless has joined #ruby-lang
carloslopes has joined #ruby-lang
<TheDracle>
Yeah, I've been having a hard time adjusting.
fayimora has joined #ruby-lang
fayimora has quit [Client Quit]
erics has quit [Remote host closed the connection]
<jhuntwork>
hey, got a question about some code in io.c
<jhuntwork>
is this a good place to ask?
<zenspider>
too late. you only get one question
<jhuntwork>
wah wah
qpingu has quit [Quit: Leaving.]
<apeiros_>
well he specified that his one question was about io.c…
<jhuntwork>
just didn't know if this is more for the actual language or the development of it, too
<apeiros_>
so he's still safe :)
<apeiros_>
jhuntwork: yes, this is a good place to ask.
<zenspider>
bzzzzt meta questions are considered question.
<apeiros_>
if nobody can answer it, you can escalate to the mailing list
<jhuntwork>
so there's the rb_f_syscall function in io.c
<jhuntwork>
and there's a block that switches the number of arguments in argc
<jhuntwork>
case 8 evaluates 8 args (one num and then 7 additional arguments to the syscall function)
<jhuntwork>
just wondering on the logic of that there because, for example, IIUC linux only supports 6 syscalls
rmascarenhas has joined #ruby-lang
<jhuntwork>
er, 6 args to syscall
<jhuntwork>
on a libc that sticks strictly to that max, this code breaks
<drbrain>
jhuntwork: when you're making a syscall, I imagine there are lots of ways to do it wrong
<drbrain>
I think ruby doesn't do too much work to prevent you from shooting yourself in the foot here
<zenspider>
/* mainly *BSD */
<zenspider>
doh. ignore me
<zenspider>
#ifdef atarist haha
<zenspider>
awesome
<jhuntwork>
zenspider, yeah I was wondering about that
<jhuntwork>
also wondering what the point is there of using syscalls anyway?
<drbrain>
jhuntwork: so you can do stuff that isn't otherwise bound to ruby easily
<drbrain>
say, reboot(2)
<jhuntwork>
fwiw, the libc I'm using is musl and their syscall functions are rather simple macros
<jhuntwork>
this particular case gets evaluated incorrectly because syscalls with args > 6 aren't accounted for
<jhuntwork>
so the actual result is some odd concatenation
<jhuntwork>
however, they're considering allowing the extra args and just dropping them due to expected convention
<jhuntwork>
not sure what the best solution is
<jhuntwork>
it ends up like this:
<jhuntwork>
io.c: In function ‘rb_f_syscall’:
<jhuntwork>
io.c:8202: error: ‘__syscallarg’ undeclared (first use in this function)
<jhuntwork>
:-)
<jhuntwork>
this is the ruby-1.9.3-p194 version so line 8202 is that case 8
<zenspider>
well, obviously with the atarist line there, it is clear that there's more than just linux out there and as a result, more than just 6... you're probably better off doing some ifdef magic to make it so it doesn't blow up in your specific case
<drbrain>
jhuntwork: what does your .ext/include/<platform>/config.h look like?
<jhuntwork>
yeah, there's plenty of ways to get around it...
<drbrain>
does it have a #define HAVE___SYSCALL 1 line?
mrsolo has quit [Quit: Leaving]
<zenspider>
if you think this is a common enough case (I dunno how popular musl is) then you should submit it back upstream
<jhuntwork>
zenspider, it's young, but gaining ground
<jhuntwork>
also, what other systems have > 6 syscalls?
misham has joined #ruby-lang
jperry2 has joined #ruby-lang
<jhuntwork>
drbrain, #define HAVE___SYSCALL 1
qpingu has joined #ruby-lang
<drbrain>
jhuntwork: it's odd that the compiler can't find __syscall then, it looks like configure should have figured out the right include for you
<jhuntwork>
no, it can find __syscall
<jhuntwork>
it's looking for __syscallarg due to the way that __syscall is implemented in musl
<drbrain>
oh, right
<jhuntwork>
isn't reboot(2) typically provided in libc?
<drbrain>
jhuntwork: ruby doesn't have it wrapped
<drbrain>
looking through the OS X sys/syscall.h, there's a bunch of system calls that aren't a part of libc because they're platform-specific stuff
<jhuntwork>
but surely the libc functions are good enough to handle ruby's needs?
jperry2 has quit [Quit: jperry2]
<drbrain>
looks like IA64 supports eight argument system calls (number + seven arguments, I guess)
<drbrain>
jhuntwork: when ruby provides a binding to them, yes
leafac has joined #ruby-lang
<jhuntwork>
alright, not sure I'm entirely clear on the need for it still, but got to run for the moment, I'll stick around in case you guys have anything additional to add :)
<drbrain>
looks like x86_64 supports it too
leafac has quit [Client Quit]
<drbrain>
not finding __syscallarg is odd, I don't see it mentioned in rb_f_syscall
<drbrain>
nor in 1.9.3 branch
jondot has quit [Ping timeout: 250 seconds]
<drbrain>
I'm thinking that's some kind of configure error
<jhuntwork>
there is no __syscallarg
<jhuntwork>
it's what is returned when musl __syscall gets called with more than 6 args