rbennacer has quit [Remote host closed the connection]
rbennacer has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Ping timeout: 240 seconds]
minimalism has joined #ruby
wethu has quit [Quit: This computer has gone to sleep]
rubie has joined #ruby
Chunlea has joined #ruby
bratchle1 is now known as bratchley
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hahuang61 has quit [Ping timeout: 250 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
mistermocha has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
_kfpratt has quit [Remote host closed the connection]
wethu has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
<Dimik>
is there a way to get around .to_i cutting off decimal points ?
boontdustie has quit [Remote host closed the connection]
<baweaver>
round
<smathy>
Dimik, the i stands for integer.
<Dimik>
that's a very messed up solution
<Dimik>
i'm aware
<Radar>
Dimik: use .to_f
<Radar>
great
<Dimik>
can i do calculations with to_f ?
<smathy>
Dimik, so integers don't have decimal components.
avenj_ is now known as avenj
avenj has quit [Changing host]
avenj has joined #ruby
<baweaver>
?xy
<baweaver>
!xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<smathy>
Dimik, how are you going to make an integer without cutting off .... yeah ^ that actually.
<baweaver>
aha
<Dimik>
<3
<Radar>
?try Dimik
<ruby[bot]>
Dimik: Why don't you try it and see for yourself?
<Dimik>
i am
y2mq37 has quit [Quit: Leaving]
<Dimik>
thank you very much for your help
workmad3 has quit [Ping timeout: 244 seconds]
hotpancakes has quit [Ping timeout: 252 seconds]
<myntcake>
hahaha
djbkd has quit [Read error: Connection reset by peer]
kfpratt has joined #ruby
djbkd has joined #ruby
Suntzu has quit [Read error: Connection reset by peer]
Ropeney has joined #ruby
hxegon has quit [Ping timeout: 252 seconds]
Alayde has quit [Ping timeout: 244 seconds]
Gasher has quit [Quit: Leaving]
<baweaver>
myntcake: ?
rbennacer has quit [Remote host closed the connection]
sorbo_ has quit [Remote host closed the connection]
sgambino has joined #ruby
Devalo has quit [Ping timeout: 240 seconds]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arescorpio has joined #ruby
bronson has quit [Ping timeout: 268 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
Ebok has quit [Quit: This computer has gone to sleep]
sorbo_ has joined #ruby
B1n4r10 has quit [Ping timeout: 248 seconds]
jt__ has joined #ruby
moeabdol2 has joined #ruby
tomatoes has joined #ruby
tomatoes has quit [Client Quit]
rubie has quit [Remote host closed the connection]
hahuang61 has joined #ruby
barajasfab has joined #ruby
GnuYawk has quit [Read error: Connection reset by peer]
xlegoman has quit [Quit: xlegoman]
rubie has joined #ruby
hahuang61 has quit [Ping timeout: 246 seconds]
uglybandersnatch has joined #ruby
brt has quit [Quit: peace]
freerobby has quit [Quit: Leaving.]
braincrash has quit [Quit: bye bye]
kam270 has quit [Ping timeout: 276 seconds]
torandu has quit [Ping timeout: 260 seconds]
Aviio has quit [Quit: Leaving.]
diegoaguilar has quit [Remote host closed the connection]
nanoz has joined #ruby
torandu has joined #ruby
lyoshajapan has quit [Remote host closed the connection]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
tatsuo has joined #ruby
braincrash has joined #ruby
Nawn has joined #ruby
duncannz has joined #ruby
vdamewood has quit [Quit: Life beckons.]
uglybandersnatch has quit [Ping timeout: 244 seconds]
baweaver has joined #ruby
FooMunki has quit [Quit: FooMunki]
zast has joined #ruby
uglybandersnatch has joined #ruby
merida has joined #ruby
sorbo_ has quit [Remote host closed the connection]
darkf has quit [Read error: Connection reset by peer]
baweaver has quit [Ping timeout: 248 seconds]
TheGreatGudsby has joined #ruby
Nawn has quit [Quit: Leaving]
darkf has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
Nawn has joined #ruby
phredus has joined #ruby
helpa has quit [Remote host closed the connection]
astrobunny has joined #ruby
helpa has joined #ruby
blackmesa has joined #ruby
chipotle has quit [Quit: cheerio]
hxegon has quit [Quit: BRB]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
Nawn has quit [Quit: Leaving]
gregf has joined #ruby
baweaver has joined #ruby
bkxd has joined #ruby
tatsuo has quit [Ping timeout: 250 seconds]
hotpancakes has joined #ruby
merida has quit [Remote host closed the connection]
merida has joined #ruby
sudoubuntu has joined #ruby
hxegon has joined #ruby
|gwep has quit [Read error: Connection reset by peer]
blackgoat has quit [Quit: WeeChat 1.4]
blackmesa has quit [Ping timeout: 276 seconds]
gix has quit [Ping timeout: 250 seconds]
rubie has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 252 seconds]
gwep| has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
russt has quit [Remote host closed the connection]
gwep| has quit [Read error: Connection reset by peer]
hotpancakes has quit [Ping timeout: 268 seconds]
tatsuo has joined #ruby
rubie has joined #ruby
gix has joined #ruby
RegulationD has joined #ruby
sgambino has joined #ruby
Chagel has quit [Ping timeout: 252 seconds]
davee_ has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Eiam_ has joined #ruby
RegulationD has quit [Ping timeout: 268 seconds]
BTRE has quit [Ping timeout: 248 seconds]
BTRE has joined #ruby
hk238 has joined #ruby
jdawgaz has joined #ruby
hxegon has quit [Quit: BRB]
<shevy>
does anyone happen to know if one can selectively enable only individual problems for rubocop to check? e. g. "only auto-indent" for the autocorrect option
benlieb has joined #ruby
TheGreatGudsby has quit [Quit: You're gonna carry that weight...]
GitGud has joined #ruby
sudoubuntu has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
agent_white has quit [Quit: brb]
torandu has quit [Ping timeout: 244 seconds]
agent_white has joined #ruby
Chagel has joined #ruby
sudoubuntu has joined #ruby
tatsuo has quit [Ping timeout: 244 seconds]
hotpancakes has joined #ruby
codecop_ has joined #ruby
torandu has joined #ruby
merida_ has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
Es0teric has joined #ruby
lyoshajapan has joined #ruby
chipotle has joined #ruby
merida has quit [Ping timeout: 260 seconds]
hotpancakes has quit [Ping timeout: 240 seconds]
sneakerhax has joined #ruby
lyoshajapan has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
trosborn has joined #ruby
astrobunny has quit [Remote host closed the connection]
Vile` has quit [Ping timeout: 260 seconds]
<brent_>
any specific reason why ruby doesn't throw an error or return extra nil values for when you specify a range beyond an array?
<brent_>
like arr = [0, 1] arr[0..4] => [0, 1]
ivanskie has joined #ruby
r1nuz has quit [Ping timeout: 244 seconds]
trosborn has quit [Quit: trosborn]
<shevy>
returning extra elements would probably be incorrect
merida has quit [Remote host closed the connection]
theRealAlexz has joined #ruby
theRealAlexz has quit [Changing host]
theRealAlexz has joined #ruby
<shevy>
I don't think it can add more nil elements since they were never part of its collection. it's like you have a glass of 5 strawberries, you try to take out 6 but you'll only get five
merida has joined #ruby
solocshaw has joined #ruby
wldcordeiro has quit [Ping timeout: 240 seconds]
<Ox0dea>
brent_: The observed behavior is the "do what I mean" that the majority of users would expect.
hxegon has joined #ruby
<Ox0dea>
It certainly shouldn't throw an error (not very conducive to programmer happiness), and explicitly filling in the `nil`s is wasteful.
eljimmy has quit [Quit: Leaving]
<brent_>
ruby is merciful
d0nn1e has quit [Ping timeout: 244 seconds]
sorbo_ has joined #ruby
merida has quit [Ping timeout: 240 seconds]
merida has joined #ruby
d0nn1e has joined #ruby
blackmesa has joined #ruby
Chagel has quit [Ping timeout: 244 seconds]
Chagel has joined #ruby
mdw has joined #ruby
Aswebb_ has joined #ruby
blackgoat has joined #ruby
<brent_>
Ox0dea: is there a way to find index of element in a 2d-array
trosborn has quit [Quit: trosborn]
Chagel has quit [Ping timeout: 248 seconds]
<Ox0dea>
brent_: y,x-wise, you mean?
<brent_>
yes
<brent_>
not finding anything specific
<brent_>
sounds like i just need to iterate through the 2d and call .index on each sub array
<Ox0dea>
There's nothing tailor-made, but you've got all the bricks you need. :)
rubie has quit [Remote host closed the connection]
<Radar>
Ox0dea: it's a kiwiirc user, on a name that we haven't seen before.
blackmesa has quit [Ping timeout: 268 seconds]
<Radar>
Ox0dea: Most likely a trol
<Radar>
troll*
<Radar>
they can plead their case in #ruby-banned.
<wool>
isn't it dangerous to have a bot ban/kick people on request?
<wool>
!kick wool
<wool>
nvm
<Ropeney>
lol'd
<baweaver>
PM'd me
<baweaver>
was warning ##javascript
merida has quit [Ping timeout: 268 seconds]
<havenwood>
there's usually a backstory
bronson has joined #ruby
hays has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
<havenwood>
wool: The bot knows best.
hotpancakes has quit [Ping timeout: 276 seconds]
lyoshajapan has joined #ruby
jenrzzz has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
<Ox0dea>
brent_: This seems to be the cleanest way to do it without "checking it twice": https://eval.in/544683
<Ox0dea>
As soon as you find the sub-array that contains the target element, you've got both coordinates, but there's no way to get both of 'em back out from an #index call without introducing some state. :/
Suntzu has quit [Read error: Connection reset by peer]
x77686d has joined #ruby
niceperl has joined #ruby
<wool>
I was wondering
* baweaver
stares intently
<wool>
wait I don't want to start a war
<wool>
can I mention a certain competitor scripting language?
<Ox0dea>
Nah.
<Radar>
competitor
<Radar>
what
<baweaver>
Never
<baweaver>
blasphemy
<baweaver>
go for it
<wool>
lol
<havenwood>
I don't accept the premise of your question.
<baweaver>
It's a trap!
<Ox0dea>
brent_: Strings essentially behave like character arrays, so that could really just be `@maze = File.readlines(@file)`.
astrobunny has joined #ruby
sorbo_ has quit [Remote host closed the connection]
<wool>
anyway I was thinking
<wool>
I noticed that ruby is.. well.. superior, to python
* wool
takes cover
<wool>
why is python then way more mainstream?
benlieb has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
<baweaver>
Probably Google
<brent_>
Ox0dea: yeah, i thought about that, can you make those []/[]= methods though?
<Radar>
SciPy, NumPy, taught in universities more, etc.
<Ox0dea>
brent_: Oui.
<baweaver>
Anything Google does is programming law
<wool>
Radar: oh yes that makes sense
<havenwood>
Again, I don't accept the premise of your question.
<wool>
google uses python?
<wool>
I thought they'd use Go
<baweaver>
they use both
<wool>
I see
<havenwood>
wool: Ruby is roughly as popular as Python. Pick your metric.
howdoi has joined #ruby
<wool>
well.. I've met dozens of people who know python but have just heard about ruby
<Ox0dea>
And you can't fathom that the inverse might also be true?
<wool>
sure, I just haven't met them
<baweaver>
Go to San Francisco
<baweaver>
they're everywhere.
<wool>
oh I see
<wool>
of course.. rails
<wool>
rails and SV
solocshaw has quit [Ping timeout: 252 seconds]
astrobunny has quit [Ping timeout: 264 seconds]
<baweaver>
That and Chef
<wool>
Chef?
astrobunny has joined #ruby
<brent_>
Ox0dea, if i saved every position that CPU touched a cpu instance variable, does it make sense to have Maze check player.touched_pos or does it make more sense to mark touched positions and have Maze check if it's been marked?
<baweaver>
In the SysAdmin / DevOps world it's the most widely used tool for deploying and provisioning servers
<brent_>
so, pass the player object to Maze methods or just have Maze check itself for marked spots?
<baweaver>
well, one of if not the largest rather
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
brent_: It certainly makes more sense for the Maze to know that about itself.
spuk has quit [Ping timeout: 240 seconds]
uglybandersnatch has quit [Ping timeout: 268 seconds]
mistermocha has joined #ruby
<brent_>
okay, so for valid_pos? have it check if it's been marked
<brent_>
and for cpu moving logic, have it use it's touched positions
jkahn has quit [Ping timeout: 260 seconds]
arescorpio has quit [Remote host closed the connection]
bronson has quit [Remote host closed the connection]
User458764 has joined #ruby
Chagel has joined #ruby
IvanSuftin has quit [Ping timeout: 276 seconds]
wool has quit [Read error: Connection reset by peer]
Suntzu has joined #ruby
LoneHerm_ has joined #ruby
julieeharshaw has quit [Ping timeout: 246 seconds]
uglybandersnatch has joined #ruby
krz has joined #ruby
tenderlove has joined #ruby
tenderlove has quit [Remote host closed the connection]
jkahn has joined #ruby
Chagel has quit [Ping timeout: 244 seconds]
hotpancakes has joined #ruby
merida has joined #ruby
avenj has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
bronson has joined #ruby
Devalo has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
avenj has joined #ruby
agent_white has quit [Quit: brb]
hotpancakes has quit [Ping timeout: 240 seconds]
merida_ has quit [Ping timeout: 276 seconds]
merida_ has joined #ruby
sp4rrow has joined #ruby
Macaveli has joined #ruby
Jameser has joined #ruby
merida has quit [Ping timeout: 252 seconds]
agent_white has joined #ruby
hinbody has joined #ruby
lyoshajapan has quit [Remote host closed the connection]
mistermocha has quit [Remote host closed the connection]
julieeharshaw has joined #ruby
y2mq37 has joined #ruby
ramfjord has joined #ruby
y2mq37 has quit [Quit: Leaving]
jorum has joined #ruby
uglybandersnatch has quit [Ping timeout: 248 seconds]
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skade has quit [Quit: Computer has gone to sleep.]
uglybandersnatch has joined #ruby
merida has joined #ruby
Chagel has joined #ruby
x77686d has quit [Quit: x77686d]
merida_ has quit [Ping timeout: 252 seconds]
minimalism has quit [Quit: minimalism]
twistedpixels_ is now known as twistedpixels
blackmesa has joined #ruby
the_drow has joined #ruby
pawnbox has quit [Remote host closed the connection]
clyster has joined #ruby
f4cl3y has joined #ruby
e4xit has quit [Quit: e4xit]
Don_John has quit [Read error: Connection reset by peer]
LaT0rtue has quit [Ping timeout: 248 seconds]
blackmesa has quit [Ping timeout: 276 seconds]
LoneHerm_ has quit [Read error: Connection reset by peer]
benlieb has quit [Quit: benlieb]
jaruga has joined #ruby
scepticulous has joined #ruby
ur5us has quit [Remote host closed the connection]
Jameser has quit [Remote host closed the connection]
niceperl has quit []
quazimodo has quit [Ping timeout: 260 seconds]
benlieb has joined #ruby
merida__ has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
nando293921 has quit [Ping timeout: 276 seconds]
merida has quit [Ping timeout: 244 seconds]
LoneHerm_ has joined #ruby
hotpancakes has joined #ruby
blackgoat has quit [Ping timeout: 248 seconds]
LaT0rtue has joined #ruby
Cohedrin has joined #ruby
hotpancakes has quit [Ping timeout: 240 seconds]
lyoshajapan has joined #ruby
pawnbox has joined #ruby
Timba-as_ has joined #ruby
minimalism has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
drewo has quit [Ping timeout: 268 seconds]
yfeldblum has joined #ruby
aufi has joined #ruby
symm- has joined #ruby
Aswebb_ has joined #ruby
elifoster has quit [Remote host closed the connection]
User458764 has joined #ruby
andikr has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
solars has joined #ruby
skade has joined #ruby
jt__ has quit [Remote host closed the connection]
bronson has quit [Remote host closed the connection]
aganov has joined #ruby
Aswebb_ has quit [Ping timeout: 260 seconds]
amclain_ has quit [Quit: Leaving]
edwinvdg_ has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
pawnbox has quit [Remote host closed the connection]
haraoka has joined #ruby
vale_tudo has joined #ruby
astrobunny has quit [Remote host closed the connection]
the_drow has joined #ruby
agent_white has quit [Ping timeout: 264 seconds]
futilegames has joined #ruby
AlexJakeGreen has joined #ruby
domaldel has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
sandstrom has joined #ruby
pawnbox has joined #ruby
sandstrom has quit [Client Quit]
wethu has quit [Quit: This computer has gone to sleep]
Guest32 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mrgrieves has joined #ruby
davee_ has quit [Quit: Leaving]
pawnbox has quit [Remote host closed the connection]
Xeago has joined #ruby
dede has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
LaT0rtue has quit [Ping timeout: 244 seconds]
DoubleMalt has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
agit0 has quit [Quit: zzzZZZ….]
hotpancakes has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
Xeago has quit [Ping timeout: 246 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
Chagel has quit [Ping timeout: 264 seconds]
anisha has joined #ruby
pawnbox has quit [Remote host closed the connection]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
davee_ has joined #ruby
pawnbox has joined #ruby
biberu has joined #ruby
jt__ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
David27 has joined #ruby
David27 has quit [Client Quit]
kies has quit [Ping timeout: 260 seconds]
Chagel has joined #ruby
neanderslob has joined #ruby
LaT0rtue has joined #ruby
ur5us has joined #ruby
drewo has joined #ruby
djellemah_ has quit [Remote host closed the connection]
sandstrom has joined #ruby
quazimodo has joined #ruby
drewo has quit [Ping timeout: 250 seconds]
Chagel has quit [Ping timeout: 250 seconds]
Xeago has joined #ruby
dc2 has quit [Ping timeout: 276 seconds]
uglybandersnatch has quit [Ping timeout: 264 seconds]
benlieb has quit [Quit: benlieb]
Couch has joined #ruby
quazimodo has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
hotpancakes has joined #ruby
araujo__ has quit [Read error: Connection timed out]
Dimik has joined #ruby
agit0 has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
araujo__ has joined #ruby
hotpancakes has quit [Ping timeout: 248 seconds]
merida_ has joined #ruby
Chagel has joined #ruby
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
symm- has quit [Ping timeout: 240 seconds]
baweaver has quit [Remote host closed the connection]
domaldel has quit [Quit: Leaving]
robbyoconnor has joined #ruby
htmldrum has quit [Quit: Lost terminal]
htmldrum_ has quit [Quit: Lost terminal]
merida has quit [Ping timeout: 276 seconds]
skade has quit [Quit: Computer has gone to sleep.]
Guest32 has joined #ruby
AnoHito has quit [Read error: Connection reset by peer]
AnoHito has joined #ruby
CustosLimen has quit [Ping timeout: 260 seconds]
monoprotic has quit [Read error: Connection reset by peer]
monoprotic has joined #ruby
lyoshajapan has quit [Remote host closed the connection]
SenpaiSilver has quit [Read error: Connection reset by peer]
moeabdol2 has joined #ruby
M-mistake has quit [Ping timeout: 260 seconds]
SenpaiSilver has joined #ruby
CustosLimen has joined #ruby
jt__ has quit [Remote host closed the connection]
Snowy has joined #ruby
SenpaiSilver has quit [Max SendQ exceeded]
bronson has joined #ruby
SenpaiSilver has joined #ruby
futilegames has left #ruby [#ruby]
RegulationD has joined #ruby
SenpaiSilver has quit [Max SendQ exceeded]
Xeago_ has quit [Read error: Connection reset by peer]
SenpaiSilver has joined #ruby
SenpaiSilver has quit [Max SendQ exceeded]
bronson has quit [Ping timeout: 252 seconds]
SenpaiSilver has joined #ruby
jt__ has joined #ruby
User458764 has joined #ruby
mikecmpbll has joined #ruby
M-mistake has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
LaT0rtue has quit [Ping timeout: 244 seconds]
mark2 has joined #ruby
lyoshajapan has joined #ruby
merida_ has quit [Remote host closed the connection]
merida has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
LaT0rtue has joined #ruby
hotpancakes has joined #ruby
kam270 has joined #ruby
b|ackwolf has quit [Ping timeout: 260 seconds]
kam270 has quit [Max SendQ exceeded]
kam270 has joined #ruby
hotpancakes has quit [Ping timeout: 260 seconds]
kam270 has quit [Max SendQ exceeded]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kam270 has joined #ruby
Xeago has joined #ruby
blackmesa has joined #ruby
marr has joined #ruby
weaksauce has quit [Ping timeout: 260 seconds]
brent_ has quit [Quit: Connection closed for inactivity]
Moosashi has joined #ruby
kam270 has quit [Max SendQ exceeded]
kam270 has joined #ruby
dc2 has joined #ruby
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Chagel has quit [Ping timeout: 268 seconds]
Ishido has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
minimalism has quit [Quit: minimalism]
harryk has joined #ruby
TheHodge has joined #ruby
mikecmpbll has joined #ruby
Chagel has joined #ruby
vikas027 has joined #ruby
Dimik has quit [Ping timeout: 240 seconds]
vikas027 has left #ruby [#ruby]
<harryk>
Hello! I have a strange issue for me. I have some module which I include to different classes, and when I include it more than once in one application - the self.included(subclass) method of module receives wrong (first) including class as an argument. Can anyone tell me what's wrong?
joonty has joined #ruby
skade has joined #ruby
zenergi has quit [Remote host closed the connection]
binaryplease1 has joined #ruby
binaryplease has quit [Ping timeout: 248 seconds]
pawnbox_ has joined #ruby
pawnbox has quit [Ping timeout: 252 seconds]
<apeiros>
?code harryk
<ruby[bot]>
harryk: We can't help you without your code, please post it to https://gist.github.com
jt__ has quit [Remote host closed the connection]
ferr has joined #ruby
<harryk>
oh, looks I've found the problem, I use self.module_eval method inside this module and methods created by first inclusion remain unchanged during next inclusions
<apeiros>
specifically - try to create a minimal reproducible example.
ferr has quit [Client Quit]
elaptics`away is now known as elaptics
the_drow has joined #ruby
dionysus69 has joined #ruby
ferr has joined #ruby
<harryk>
apeiros: ok, thanks ;)
al2o3-cr has quit [Ping timeout: 246 seconds]
LaT0rtue has quit [Ping timeout: 252 seconds]
tvw has joined #ruby
hotpancakes has joined #ruby
Moosashi has quit [Quit: Moosashi]
benlovell has joined #ruby
ur5us has quit [Remote host closed the connection]
krz has quit [Ping timeout: 244 seconds]
Moosashi has joined #ruby
al2o3-cr has joined #ruby
baweaver has joined #ruby
hotpancakes has quit [Ping timeout: 240 seconds]
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #ruby
Aswebb_ has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
vircung has joined #ruby
krz has joined #ruby
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
Aswebb_ has quit [Ping timeout: 260 seconds]
ferr has quit [Ping timeout: 268 seconds]
ferr has joined #ruby
blackgoat has joined #ruby
zeroDivisible has joined #ruby
Ropeney has joined #ruby
CloCkWeRX has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
djbkd has quit [Quit: My people need me...]
tvw has quit []
blackgoat has quit [Read error: Connection timed out]
blackgoat has joined #ruby
moeabdol2 has quit [Quit: WeeChat 1.4]
kbni has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
NightMonkey has quit [Ping timeout: 244 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
<kbni>
Can anyone here recommend libraries similar to her that offer the ability to make working with REST APIs simpler?
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<kbni>
apeiros, well, mainly hoping for feedback about this or similar libraries - I can't seem to find anything similar
<apeiros>
boy are you lucky that irc filters passwords and all we saw was "/msg NickServ VERIFY REGISTER karioleez *****"
<kbni>
figured asking migth result in finding something possibly better
<karioleez>
apeiros: lol
<gregf_>
apeiros: haha
lyoshajapan has quit [Remote host closed the connection]
<karioleez>
shit happens
<kbni>
-NickServ- Invalid password for karioleez.
<gregf_>
humans...
blackmesa has quit [Ping timeout: 250 seconds]
<kbni>
I must commend you on quick reaction to that..
<apeiros>
meatbags
drewo has joined #ruby
<karioleez>
what 's the worst that could happen ?
<karioleez>
:P lol
hotpancakes has quit [Ping timeout: 268 seconds]
<karioleez>
I made me laugh sometimes
<apeiros>
somebody taking over your identity, I'd guess
<gregf_>
identity theft is so widespread
<apeiros>
irc-identity only if you use different passwords on different services
<kbni>
A cheeky GHOST would have been amusing. :P
moeabdol has joined #ruby
<karioleez>
kbni: kbni!~kbni@192.184.95.245 failed to login to karioleez. There has been 1 failed login attempt since your last successful login.
<karioleez>
one already
<gregf_>
karioleez: we now know your bank login password as well.... is it ********?
<kbni>
Nah, I only tried to GHOST.
<karioleez>
good to know
<kbni>
Because I'd need to remove you before assuming your identity.
<apeiros>
kbni: I see :) (your answer to my question)
<karioleez>
yep I was quick
<karioleez>
well the bank account's password doesn't need the same kind of security
<gregf_>
karioleez: btw, you were registering, not identifying yourself :P
<karioleez>
no I haven't entered 12341234 as a password to irc
<karioleez>
no problem
<karioleez>
it's good to know that I've burnt out myself
<karioleez>
but I am not married to my nick
<gregf_>
karioleez: no need to worry, i've accidentally chatted my password too... i've lost count :|
<karioleez>
:D
drewo has quit [Ping timeout: 264 seconds]
<karioleez>
btw are the connections encrypted ?
<karioleez>
I mean "can" they be ?
<kbni>
for IRC? sure
<karioleez>
ssl maybe ? freenode
<kbni>
it's not forced, and you may not be using it yourself
<kbni>
You are not.
<canton7>
freenode has some ssl ports, and some non-ssl ports
<karioleez>
:)
<karioleez>
ha ok
<karioleez>
I could try I guess
<canton7>
make sure you're connecting to an ssl port, and tell your client to use ssl
<canton7>
... also look at sasl to identify with servies, rather than typing your nickserv password manually
<canton7>
saves telling it to everyone :)
bkxd has quit [Ping timeout: 260 seconds]
karioleez has quit []
<apeiros>
iirc all ports of freenode are ssl capable
<apeiros>
but iirc 7000 requires ssl (i.e. is not non-ssl capable)
<apeiros>
not sure, though. check with freenode docs :)
bkxd has joined #ruby
djellemah has quit [Quit: Leaving]
karioleez has joined #ruby
djellemah has joined #ruby
<apeiros>
sasl auth also has the benefit of being guaranteed to be before channel join
<karioleez>
hell yeah
<apeiros>
which has benefits
<karioleez>
I am in my SSLed version
<canton7>
I thought irc didn't support something STARTSSL-like - a connection was either initiated as ssl, or not? Could be wrong.
* apeiros
remembers railsconf where you could see everybody's irc passwords in plaintext
djbkd has joined #ruby
lyoshajapan has joined #ruby
<apeiros>
canton7: could be. but I think you don't need to have the ports separate. fuzzy on that :)
al2o3-cr has quit [Read error: Connection reset by peer]
al2o3-cr has joined #ruby
<A124>
Heya! I would like to do range expansion of expressions, example: Number [1:9] goes into box [1:20]. Which way would be good to implement this? Given there might be more then one expansion and range could be up to million. Recursion does not seem to me feasible.
<kbni>
canton7, it might also be a non-standard add-on to the irc daemon
Spami has joined #ruby
<apeiros>
A124: I don't follow
workmad3 has joined #ruby
hotpancakes has joined #ruby
djbkd has quit []
Olipro has quit [Ping timeout: 260 seconds]
hotpancakes has quit [Ping timeout: 240 seconds]
Olipro has joined #ruby
wethu has joined #ruby
pandaant has joined #ruby
lyoshajapan has quit [Remote host closed the connection]
Begi has joined #ruby
Ebok has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
Ebok has quit [Client Quit]
bronson has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
bronson has quit [Ping timeout: 252 seconds]
sgambino has joined #ruby
benlovell has quit [Ping timeout: 248 seconds]
n008f4g_ has quit [Ping timeout: 244 seconds]
DarthGandalf has quit [Ping timeout: 276 seconds]
Begi1 has joined #ruby
LaT0rtue has joined #ruby
Ebok has joined #ruby
Begi has quit [Ping timeout: 250 seconds]
Begi1 is now known as Begi
mosez has quit [Quit: Switching back to real life]
quazimodo has joined #ruby
svisjm has joined #ruby
pawnbox has quit [Ping timeout: 252 seconds]
benlovell has joined #ruby
hotpancakes has joined #ruby
astrobunny has quit [Remote host closed the connection]
<A124>
apeiros Ups, late reaction it should expand into multiple lines, with those ranges.
nanoz] has joined #ruby
<A124>
Number 1 goes into box 1.
<A124>
Number 1 goes into box 2. ... etcetera
Xeago has quit [Remote host closed the connection]
devyn has quit [Ping timeout: 276 seconds]
skade has quit [Quit: Computer has gone to sleep.]
DTZUZU has joined #ruby
<djellemah>
A124: do you mean a cross-product?
benlovell has quit [Ping timeout: 264 seconds]
<apeiros>
A124: what's a box? why does no. 1 go into box 1 AND 2?
nanoz has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
hotpancakes has quit [Ping timeout: 260 seconds]
<apeiros>
A124: you probably should make a (small) complete example and put it on gist.github.com
benlovell has joined #ruby
Xeago has joined #ruby
skade has joined #ruby
skade has quit [Client Quit]
<A124>
Yeah, well its a generic text, its a string input from user.
<A124>
I need to make the expansion, and there may be 0 to n expansions in the string. In real life just a few max usually, though.
Chagel_ has joined #ruby
araujo__ has quit [Quit: Leaving]
MrSamuel has joined #ruby
<A124>
I am sorry to not describe the problem well, I hope its clear now.
Ebok has quit [Quit: Leaving]
<apeiros>
not really, no. you're still leaving out massive amounts of context.
<apeiros>
ping me when you've got a proper example on gist.
Moosashi has quit [Quit: Moosashi]
Chagel has quit [Ping timeout: 248 seconds]
<apeiros>
the example should include at least one input with a complete output/result.
<A124>
That's impossible as I am not sure what example I shuld make.
<A124>
It eats a lot of memory though, as it does first make the result then iterates.
joonty has quit [Ping timeout: 248 seconds]
<apeiros>
define "lot of memory". but even if you happen to have large ranges - if you care to read the documentation of Array#product, you'll see that it takes a block.
dvinciguerra__ has joined #ruby
<A124>
800MB for few millions. Also have no idea how to use that in case I have more then two ranges.
<A124>
Actually, I did use a block, but maybe in wrong way, will read on.
pawnbox has joined #ruby
hotpancakes has quit [Ping timeout: 248 seconds]
<apeiros>
for numeric cartesian products, you can also simply use a nested loop:
<apeiros>
>> result = []; 1.upto(2) do |x| 1.upto(3) do |y| result << [x, y] end; end; result
<A124>
apeiros My goal is both to be able iterate web links, pages, and at the same time generate arbitrary lists for simple input to other sequential programs. So millions was a strech. When I use the block correctly it works grat.
baweaver has quit [Ping timeout: 250 seconds]
Aswebb_ has joined #ruby
<A124>
al2o3-cr It is! I missed the notation, I think I use other, which did work, but took again a lot of memory as I had to convert to array.
LHdez has quit [Ping timeout: 250 seconds]
<A124>
I was using (1..10).step(2)
<al2o3-cr>
ah, i ok
lxsameer has joined #ruby
<al2o3-cr>
easy mistake to make
<A124>
But it still converts to array, doesn't? by using [] parenteses
<apeiros>
(1..10).step(2) does the same as 1.step(10, 2)
<apeiros>
and neither of those uses an array
Moosashi has joined #ruby
<A124>
No, its does not, but product expects array.
<apeiros>
you can create an array from both by appending .to_a
uglybandersnatch has quit [Ping timeout: 246 seconds]
<apeiros>
if you want to avoid even the input arrays, then you'll have to implement your own logic to build the product. it's not that difficult.
<A124>
Which leads to the memory growth. ... Anyway I think I can live by that for now. .. I still have problems of GCing the unused stuff sometimes.
yfeldblum has quit [Ping timeout: 250 seconds]
Aswebb_ has quit [Ping timeout: 260 seconds]
<A124>
Yes, logic. Which is back to original question, how would I implement such logic efficiently?
solars has joined #ruby
siaw has left #ruby [#ruby]
<A124>
And efficiency in this case refers to memory, not speed.
<apeiros>
either have a single integer from 0 to max-combinations and calculate from it
pawnbox_ has quit [Remote host closed the connection]
<apeiros>
or have an Enumerator for each "digit" of your product and handle overflow
sandstrom has joined #ruby
Azure has quit [Remote host closed the connection]
LaT0rtue has quit [Ping timeout: 252 seconds]
sdothum has joined #ruby
uglybandersnatch has joined #ruby
<apeiros>
i.e. digits = [(1..10).step(2), (5..15).step(3)]; in your loop: digits[0].next on each iteration
pawnbox has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
<apeiros>
if it raises a StopIteration, rewind it and call .next on the next digit
Azure has joined #ruby
<A124>
Love you. Not a way I imagined, but a way to go. Very much appreciated.
duncannz has quit [Remote host closed the connection]
<djellemah>
A124: lazy enumerators are good for memory efficiency when you have large sets
davee_ has quit [Ping timeout: 276 seconds]
quazimodo has quit [Read error: Connection reset by peer]
impi0us has joined #ruby
Azure has quit [Remote host closed the connection]
millerti has joined #ruby
<apeiros>
as for the single integer solution: it works the same as you count and get the individual digits of a number
vasilakisfil has joined #ruby
<apeiros>
i.e. 000-999 is the cartesian product of the digits 0-9 on 3 positions. and you get all numbers by counting from 0 to 999, and the individual digits by `a,b,c = num/10*2 % 10, num/10*1 % 10, num/10*0 % 10`
<vasilakisfil>
is it possible to create another object and behave like Proc ? for instance f = Foobar.new{ puts 'hey!' };
wedgwood has joined #ruby
<apeiros>
vasilakisfil: any method can take a block and you can store it. so can initialize.
<apeiros>
class Foobar; def initialize(&block); @block = block; end; end # then call the block whenever you want.
<apeiros>
for ruby to treat it like a proc, you should implement to_proc, call and []
MrSamuel has quit [Remote host closed the connection]
<A124>
apeiros Oh, yes. I got the modulo idea. But that would first mean having to exctract that somhow, and enumerators should be efficient enough. Thank you for examples.
<A124>
Yeah, I am kind of noob. Started with Ruby 1.8, but since I had life difficulties that had effect on my brain and memory. So everything is hard for me now. Trying to live by.
drewo has joined #ruby
roelof has joined #ruby
skade has joined #ruby
yaewa has joined #ruby
<roelof>
Hello, for learning to programm I have to sort a array but I m not allowed to use sort. Must I then write my own sort method ?
lxsameer has joined #ruby
<apeiros>
roelof: that's probably the idea, yes
hotpancakes has joined #ruby
<n1colas>
Hello
<roelof>
apeiros: Oke I always thought that writing sorting algoritmes is hard to do
<apeiros>
roelof: many sorting algorithms are trivial
<apeiros>
roelof: the hard things is to come up yourself with a good one
drewo has quit [Ping timeout: 244 seconds]
Moosashi has quit [Quit: Moosashi]
<djellemah>
vasilakisfil: looks like you want to have your initialize method work with a block argument. There are several other ways to make object instances behave like procs.
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<vasilakisfil>
basically what I want is something else: I want a proc to always set as the referencing environment, the environment that is called from (using some magic + instance_exec) and not the environment that was defined. But I doubt I can do it.
vale_tudo has joined #ruby
spiman has joined #ruby
platzhirsch has joined #ruby
<djellemah>
vasilakisfil: Not sure I understand what you're after, but you might be able to call binding, and pass the result of that to a method. OTOH, there's probably a better way to do what you want.
GodFather has joined #ruby
<ferr>
How would I make this line of code work? array << obj.empty? ? '' : "#{object},"
andywojo has joined #ruby
<vasilakisfil>
djellemah I want to define a proc in point A: proc{ return params[:foo]} and use it in point B where params variable has changed and be able to return the new params value
<vasilakisfil>
how would you do that ?
mtkd has quit [Ping timeout: 276 seconds]
<djellemah>
ferr: try Array#select and Array#join
yfeldblum has joined #ruby
mtkd has joined #ruby
roelof has quit [Quit: Page closed]
bkxd has quit [Ping timeout: 260 seconds]
Moosashi has joined #ruby
impi0us has quit [Ping timeout: 250 seconds]
<ferr>
thanks djellemah
bkxd has joined #ruby
uglybandersnatch has quit [Ping timeout: 244 seconds]
<djellemah>
>> a = 1; l = ->{a}; a = 2; l.call # vasilakisfil
<djellemah>
vasilakisfil: in other words, a proc/lambda binds the variable, not the value of the variable. Unless A and B are in different methods/classes where you could define params as a method differently for A and B
benlovell has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
rodfersou has joined #ruby
<apeiros>
s/binds/closes over/
siaw has joined #ruby
araujo has joined #ruby
araujo has quit [Max SendQ exceeded]
* djellemah
can rely on apeiros to tighten up imprecision ;-)
<apeiros>
always
araujo has joined #ruby
* apeiros
has "master pedant" on his business card
<apeiros>
not sure people spot it besides all the other titles, though.
Rickmasta has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
benlovell has joined #ruby
sgambino has joined #ruby
johnmilton has joined #ruby
hotpancakes has joined #ruby
<adaedra>
You're trying to over-pedant Ox0dea?
<djellemah>
collective nouns: school of fish, pod of whales, giggle of teenage girls, wunch of bankers, actually of pedants.
skade has joined #ruby
<jhass>
Ox0dea: yup, you remembered right about playpen
yfeldblum has quit [Ping timeout: 248 seconds]
benlovell has quit [Ping timeout: 240 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
dvinciguerra__ has quit [Ping timeout: 248 seconds]
ELCALOR_ is now known as ELCALOR
benlovell has quit [Ping timeout: 252 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
al2o3-cr has quit [Ping timeout: 248 seconds]
GitGud has quit [Quit: You're gonna carry that weight...]
madgen_ has joined #ruby
al2o3-cr has joined #ruby
benlovell has joined #ruby
sdothum has joined #ruby
bronson has joined #ruby
Moosashi has quit [Quit: Moosashi]
skade has quit [Read error: Connection reset by peer]
haraoka has quit [Ping timeout: 240 seconds]
LaT0rtue has joined #ruby
RegulationD has joined #ruby
ldnunes has joined #ruby
skade has joined #ruby
vikas027 has joined #ruby
drewo has joined #ruby
joonty has quit [Ping timeout: 244 seconds]
rodferso1 has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
rodferso1 has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 276 seconds]
rodferso1 has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
Xeago has joined #ruby
rodfersou has quit [Ping timeout: 260 seconds]
wethu has quit [Quit: This computer has gone to sleep]
spiman has quit [Ping timeout: 264 seconds]
drewo has quit [Ping timeout: 246 seconds]
spiman has joined #ruby
hotpancakes has joined #ruby
benlovel1 has joined #ruby
but3k4 has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
Vile` has joined #ruby
krz has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Read error: Connection reset by peer]
benlovell has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
roelof has joined #ruby
jdawgaz has quit [Client Quit]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
myntcake has quit [Ping timeout: 264 seconds]
hotpancakes has quit [Ping timeout: 276 seconds]
dc2 has quit [Ping timeout: 244 seconds]
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
<roelof>
somone who can help me with this problem :https://gist.github.com/rwobben/7149ccb9a0a0da9e24edf3b1e0a3d3ea
freerobby has joined #ruby
<scepticulous>
is there a way to get the number of currently allocated objects in jruby ?
<scepticulous>
just interactively and without starting sample code with the profiler
GodFather has quit [Ping timeout: 260 seconds]
nanoz] has quit [Read error: Connection reset by peer]
benlovel1 has quit [Ping timeout: 264 seconds]
<guardian>
hello, I added require 'pry' ; binding.pry inside an "it" block in rspec, but when I execute bundle exec rspec then it doesn't stop
<guardian>
how can I debug rspec tests?
<apeiros>
scepticulous: check ObjectSpace docs
vasilakisfil has quit [Ping timeout: 250 seconds]
<apeiros>
roelof: please set the filename to anything with .rb as suffix for proper highlight. you can gist the plaintext explanation in a separate file in the same gist.
itgoner has joined #ruby
<roelof>
apeiros:
<apeiros>
roelof: also since line 25 in your gist (which the exception refers to) is an empty line, please provide information for how to map the line number.
<roelof>
sorry, I will repaste it again
<apeiros>
you can update the gist
sgambino has joined #ruby
<apeiros>
no need to make a new one
sgambino has quit [Client Quit]
<roelof>
apeiros: gists updated
getbrandao has joined #ruby
<roelof>
I think there is a bug on the code in the book. Also when I copy the original I see a error message
<apeiros>
your method does `puts numString` in the end. i.e. your englishNumber method always returns nil
<apeiros>
(because puts returns nil)
<roelof>
I do not see it. I just copied the code from the learning programming book
spiman has quit []
<apeiros>
hard copy or ebook?
tvw has joined #ruby
<roelof>
ebook
<apeiros>
though, I'd check for errata in both cases
SCHAAP137 has quit [Read error: Connection reset by peer]
hotpancakes has joined #ruby
LaT0rtue has quit [Ping timeout: 244 seconds]
<apeiros>
roelof: you understood what you have to change?
<roelof>
yep. the code is working , thanks
freerobby has quit [Quit: Leaving.]
jorum has quit [Ping timeout: 244 seconds]
hotpancakes has quit [Ping timeout: 252 seconds]
roelof has quit [Quit: Page closed]
vasilakisfil has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
aryaching has joined #ruby
j3r0 has joined #ruby
Dysp has joined #ruby
joonty has joined #ruby
aryaching has quit [Client Quit]
aupadhye has joined #ruby
hotpancakes has joined #ruby
stannard has quit [Remote host closed the connection]
stan has quit [Quit: Leaving]
stan has joined #ruby
<Dysp>
I have a hard time understanding array creation. I am creating a hash with an already existing array (volt-array). It should be "time" => "volt-array". I therefore need to create the time-array based on the size of the existing array. I cannot wrap my head around how to do this.
<Dysp>
hash = Array.new(volt.size){|x| x * 1}.zip(volt).to_h
<Dysp>
This is what I have so far.
pandaant has quit [Remote host closed the connection]
<Dysp>
I creates the array alright; it just starts at the array.size and counts up from there.
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
sandelius has joined #ruby
tildes has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
LaT0rtue has joined #ruby
baweaver has joined #ruby
senayar has joined #ruby
senayar was kicked from #ruby by ruby[bot] [was banned before]
<Dysp>
Actually, that is not true. It counts up from zero, but it always adds one. Should only add 0.001:
<Dysp>
hash = Array.new(volt.size){|x| x + 0.001}.zip(volt).to_h
<Dysp>
apeiros: My savior. My mentor. The legend.
baweaver has quit [Ping timeout: 250 seconds]
BTRE has quit [Ping timeout: 264 seconds]
rodferso1 has quit [Ping timeout: 250 seconds]
drewo has joined #ruby
rodfersou has joined #ruby
dvinciguerra__ has joined #ruby
zzz__ has joined #ruby
<Dysp>
Anyone? :( Im so stuck.
Suntzu has quit [Read error: Connection reset by peer]
barajasfab has quit [Ping timeout: 260 seconds]
<shevy>
I did not even understand the problem description but from the code above, I am absolutely sure there is a simpler way!
Vile` has quit [Ping timeout: 244 seconds]
drewo has quit [Ping timeout: 260 seconds]
jmgxgc has joined #ruby
rbennacer has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
dubek has left #ruby ["Leaving"]
<Dysp>
shevy: Probably. This is the first time ever I am coding in anything. So help is appreciated.
Chagel has joined #ruby
pawnbox has quit [Remote host closed the connection]
jorum has joined #ruby
svisjm has quit [Ping timeout: 246 seconds]
<Dysp>
Basicly, what I wanna do is take predefined array (volt) and turn it into a hash that says "time" => "volt". Time should be 0.001, 0.002 and so forth. Basicly adding 0.001 each count. The size of the "time" array should be equal to the size of "volt".
<guardian>
I'm a rspec/ruby beginner. Rspec tells me I can't use allow() in a describe group. I would like to have allow(Digest::SHA1).to_receive(:file).with(foo).and_return('xxx') for all "it" blocks
<guardian>
is this possible?
benlovell has joined #ruby
<shevy>
Dysp well build up the two arrays first, then merge/zip them into the hash? if you have them as: [1,2,3] and [0.001,0.002,0.003] that's proper right?
<Dysp>
Yes. But the volt array changes size
jorum has quit [Ping timeout: 260 seconds]
BTRE has joined #ruby
<Dysp>
So I cannot predefine what it should contain, only that it should count from 0 to whatever size the other array is, adding 0.001 pr step.
<Dysp>
It's easy to do I am sure. I just can't wrap my head around how :P
quazimodo has joined #ruby
quazimodo has quit [Read error: Connection reset by peer]
<Dysp>
hash = Array.new(volt.size){|x| x + 0.001}.zip(volt).to_h - And this works. It just doesn't count properly. It says 1.001, 2.001 etc.
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
benlovell has quit [Ping timeout: 250 seconds]
hiyosi has joined #ruby
madgen_ has quit [Ping timeout: 244 seconds]
<shevy>
I have no idea why you must do this all in one line
<shevy>
if the sole problem is that 1.001 should be 0.001 then simply apply a .map or .map! on the Array before .zipping
swills has quit [Quit: Leaving]
jdawgaz has joined #ruby
<canton7>
how do you turn 0 into 0.001, 1 into 0.002, 2 into 0.003, etc? ;)
<canton7>
(simple primary-school-style series stuff)
sudoubuntu has joined #ruby
vondruch has joined #ruby
sudoubuntu has quit [Client Quit]
zzz__ has quit [Quit: Leaving...]
benlovell has joined #ruby
sdothum has joined #ruby
nfk|laptop has joined #ruby
pawnbox has joined #ruby
<Dysp>
canton7: Sure it is. But I am a medical professional working with research about statins. I haven't worked with basic maths/calculations for many years ;)
fexilal has joined #ruby
<canton7>
you know how to turn 0 into 1 though, and you know how to turn 1 into 0.001
<canton7>
likewise you know how to turn 1 into 2, and you know how to turn 2 into 0.002
ssiris has quit [Remote host closed the connection]
<Dysp>
canton7: That actually works perfectly. Hm.
<Dysp>
I thought I already tried that
andywojo_ has joined #ruby
oz` has joined #ruby
benlovell has quit [Ping timeout: 248 seconds]
plonk has quit [Read error: Connection reset by peer]
oz has quit [Read error: Connection reset by peer]
oz` is now known as oz
plonk has joined #ruby
plonk has joined #ruby
<Dysp>
canton7: Thank you. And also thx to anyone else who helped.
shadoi1 has joined #ruby
<canton7>
like I said... turn 0 into 1, turn 1 into 0.0001. primary school stuff :P
ledestin has quit [Read error: Connection reset by peer]
gix has quit [Ping timeout: 248 seconds]
shadoi has quit [Ping timeout: 248 seconds]
atmosx has quit [Ping timeout: 248 seconds]
_dev has quit [Ping timeout: 248 seconds]
redondos has quit [Ping timeout: 248 seconds]
adgtl has quit [Ping timeout: 248 seconds]
<Dysp>
If you work every day with codes and math, then yes.
<Dysp>
But I guess you don't know how to draw blood? ;)
<adaedra>
o.O
<Dysp>
Or take muscle biopsies
kies has joined #ruby
duoi has quit [Excess Flood]
<adaedra>
What does it have to do with current discussion?
madgen_ has quit [Ping timeout: 248 seconds]
vcoinminer has quit [Ping timeout: 248 seconds]
c355e3b has quit [Ping timeout: 248 seconds]
Ikzi has quit [Quit: No Ping reply in 180 seconds.]
rolha has joined #ruby
duoi has joined #ruby
<canton7>
no, but I write the software which controls the machine which analyses the blood sample in the lab :P
andywojo has quit [Ping timeout: 248 seconds]
_blizzy_ has quit [Ping timeout: 248 seconds]
adgtl has joined #ruby
Xeago has quit [Remote host closed the connection]
Ikri has joined #ruby
<Dysp>
canton7: And that is so cool :D
redondos has joined #ruby
sgambino has joined #ruby
_blizzy_ has joined #ruby
atmosx has joined #ruby
<Dysp>
adaedra: It's conversation. He implied I couldn't do simple math and I agreed; because my focus is elsewhere.
felltir has joined #ruby
_dev has joined #ruby
<djellemah>
Dysp is less interested in learning to code and more interested in getting the data into the shape needed.
<canton7>
I'm saying that I think you're overcomplicating it in your head
myntcake has joined #ruby
roshanavand has joined #ruby
<Dysp>
canton7: I probably am. There are many new things to learn when beginning to code. Especially if you start from scratch.
jimeh has quit [Ping timeout: 248 seconds]
codepete has quit [Ping timeout: 248 seconds]
<adaedra>
First one is that very often, most simple solution is the best.
vcoinminer has joined #ruby
ChiefAlexander has joined #ruby
<Dysp>
djellemah: Yes and no. It's a learning experience. I have learned tonnes already; but when I get really stuck, I like getting help. Because I also have a boss to answer to. I were to do the data calculations manually with copy/pasting in Excel.
c355e3b has joined #ruby
codecop_ has quit [Remote host closed the connection]
roshanavand has quit [Client Quit]
gix has joined #ruby
<Dysp>
And I thought.. Well, that's an opportunity to learn how to code! But if it takes waaaaaaaaaaay longer than it would have doing it manually, then it's harder for me to defend spending the time on it.
codepete has joined #ruby
jimeh has joined #ruby
quinnie has joined #ruby
<workmad3>
Dysp: how often do you do similar calculations?
astrobunny has joined #ruby
<Dysp>
What do you exactly mean?
<Dysp>
How often the same calculations should be done?
<workmad3>
Dysp: yeah... how often do you run the same (or similar) calculations by copy-pasting data into excel
nando293921 has quit [Ping timeout: 268 seconds]
<Dysp>
A lot. A very much lot. But I am assessing a problem they do not consider a problem. It is simply how it is done.
hotpancakes has quit [Remote host closed the connection]
mostlybadfly has quit [Quit: Connection closed for inactivity]
<workmad3>
Dysp: yeah, it's always 'simply how it is done' until someone automates it :)
<Dysp>
I am slowly trying to introduce optimizations. But you must understand that I work with doctors and professors in exercise physiology; they don't know anything of this world.
benlovell has joined #ruby
vasilakisfil has quit [Ping timeout: 268 seconds]
<workmad3>
Dysp: but if you're doing it a lot, that means you can also timebox a certain amount of time with automation for each time you have to do this task
<Dysp>
Exactly. But if I spend a year learning basic Ruby before I can produce anything that can prove that it is a better solution, then I'll probably not be able to do it.
Ropeney has quit [Ping timeout: 244 seconds]
quazimodo has joined #ruby
IrishGringo has joined #ruby
<djellemah>
It's fairly common in research environments. Researchers need the data, but they're not programmers. Sometimes researchers learn a little coding to help their job. But it's a different focus from learning to be a developer.
<adaedra>
But look at all the things you'll be able to automate!
<Dysp>
There are tonnes of different calculations that could so easily be done with code, but I kinda need to show them and convince them to let me learn it.
Ropeney has joined #ruby
<Dysp>
And that is what I am doing with this problem. And I am still learning a lot, I just must also focus a bit on getting shit done too ;) My actual job.
hostess has quit [Quit: No Ping reply in 180 seconds.]
<Dysp>
djellemah: Indeed it is. And that is actually also one of the reasons why I wanna learn how to code - so I can become a developer that can help research labs optimize their data handling. There is a huge marked for it, I believe. Problem is, though..
<adaedra>
If I may, it may be something you want to experiment for yourself for a while, if it's not your primary job.
<workmad3>
^ kinda what I was hinting at
skade has quit [Quit: Computer has gone to sleep.]
<Dysp>
Developers don't no shit about health science and health science professionals don't no shit about developing. So there is a connection that must be done first; and that connection is me - knowing both worlds (in the future)
benlovell has quit [Read error: Connection reset by peer]
<Dysp>
In my lab, there has been maaaaaaaaany projects throughout the decades. Basicly they are doing the same tests on different subjects. But ALL the data is put into individual excel sheets for their individual projects.
skade has joined #ruby
<Dysp>
But because it is the same test, then it would be absolutely wonderful to compare test results between different projects.
kp666 has quit [Remote host closed the connection]
sudoubuntu has joined #ruby
<Dysp>
And there is no way of doing that, unless you wanna go all manual on even more excel sheets. And every project does their own excel sheets - the data handling is not standardized.
<Dysp>
And that is just my lab.
<adaedra>
I'm not denying your goal or anything; just, maybe not try to merge it right now if you're starting development. Do it for yourself, as an extra activity, then, once you're good enough, you can try bring it with way better efficiency
<Dysp>
Oh yes indeed. This little project is simply to teach me how to code.
<Dysp>
And teach me how to handle data.
<Dysp>
I am not bringing out the big guns when I have absolutely nothing to show and no skills to back it up.
<adaedra>
You have many places online with exercices to help you grasp on things, if you want.
hotpancakes has joined #ruby
drewo has joined #ruby
shakes has joined #ruby
<Dysp>
I've tried several resources and learned basic stuff from them. But in the end I just sit there staring at the screen, because I am not motivated to create a "text editor". I need a specific goal and teach my way through it.
cdg has joined #ruby
<Dysp>
And getting help from skilled programmers when I get stuck is sufficient. It has worked so far.
kp666 has joined #ruby
<adaedra>
Becoming a skilled developer is way better.
<Dysp>
I mean. I have created a tool that automatically searched the directory for excel files, pulls data out and creates a graph and outputs it as an excel sheet. I have figured pretty much everything out on my own and have required help twice, I believe.
<Dysp>
So it's not like I just come here asking for help for every step :P
LaT0rtue has quit [Ping timeout: 244 seconds]
<Dysp>
outputs as PDF. my bad.
<adaedra>
right
<Dysp>
It's just when I can't get it right after several tries that I seek out help.
<Dysp>
And google doesn't help me.
whippythellama has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
sudoubuntu has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drewo has quit [Ping timeout: 252 seconds]
zadrot_ebaniy has quit [Ping timeout: 240 seconds]
astrobunny has quit [Remote host closed the connection]
freerobby has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
freerobby has quit [Client Quit]
kobain has joined #ruby
floatingpoint has joined #ruby
vikas027 has quit [Read error: Connection reset by peer]
krz has joined #ruby
bronson has joined #ruby
saneax is now known as saneax_AFK
stannard has joined #ruby
stannard has quit [Remote host closed the connection]
freerobby has joined #ruby
stannard has joined #ruby
solars has quit [Quit: WeeChat 0.4.2]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tvw has quit [Ping timeout: 252 seconds]
jdawgaz has joined #ruby
gevans has joined #ruby
stannard has quit [Remote host closed the connection]
stannard has joined #ruby
synthroid has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
TvL2386 has joined #ruby
vasilakisfil has joined #ruby
synthroid has quit [Client Quit]
malconis has joined #ruby
scepticulous has quit [Ping timeout: 264 seconds]
bkxd has joined #ruby
roshanavand has joined #ruby
AckZ has joined #ruby
axl_ has joined #ruby
tvw has joined #ruby
bkxd has quit [Ping timeout: 248 seconds]
<myntcake>
what exactly is enum/enumerator? does it do something? is it useful? ._.
User458764 has joined #ruby
<havenwood>
myntcake: Enumerable and Enumerator both do things!
Chagel has quit [Ping timeout: 246 seconds]
LoneHerm_ has joined #ruby
schemanic has joined #ruby
<myntcake>
havenwood: like i've kind of skimmed through the Enum method in Ruby doc, but i'm unsure of what it does
<gevans>
myntcake: Enumerator/Enumerable is what lets you iterate (loop) over collections like Hash and Array.
<myntcake>
Like, yesterday i was looking through arrays i think, and somewhere in there( I forgot..) it said that if i don't specify the default will be an Enum.
<havenwood>
myntcake: Enumerable is mixed into a bunch of Classes, like Array, Range, Hash, Struct and even Enumerator. See this object model: https://www.gliffy.com/go/publish/5152080
voodo has joined #ruby
LaT0rtue has joined #ruby
<havenwood>
myntcake: So the Enumerable methods are available from all these classes.
hotpancakes has quit [Remote host closed the connection]
malconis has quit [Remote host closed the connection]
<gevans>
havenwood: That Stream#interval method is pretty awesome.
frozen3 has joined #ruby
<myntcake>
hmm, so it's a class?
<havenwood>
gevans: :D
LoneHerm_ has quit [Ping timeout: 268 seconds]
<havenwood>
myntcake: Enumerator is a class like Hash or Array. Enumerable is a module that's mixed into some widely-used core classes and you can mix-it-in yourself.
voodo has quit [Client Quit]
hotpancakes has quit [Remote host closed the connection]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<myntcake>
havenwood: i don't know what a module is yet :D, I guess my program will teach me about it sooner or later haha
<shevy>
a module is: module Foo; end
solocshaw has joined #ruby
<shevy>
so Enumerable is: module Enumerable; end
malconis has joined #ruby
<myntcake>
shevy: that just looks like a method but just changing def with module haha
<apeiros>
well, 1.9 already supported inject(:+), and 1.9 is *old*
<Dysp>
So ultimately, what do you suggest me doing?
davedev24 has joined #ruby
<Dysp>
Currently doing this. array.inject(0) { |sum, x| sum += x } / array.size.to_f
mtkd has joined #ruby
<apeiros>
depends. what do you want for `mean([])`? nil or Float::NaN?
<Dysp>
Not of much relevance, as the array is never gonna be empty.
<apeiros>
haha, spoken like a true newbie ;-p
<Dysp>
But I sure do get that it would be optimal to provide solution that wouldn't break the program if that would be the case.
ChiefAlexander has quit [Remote host closed the connection]
<Dysp>
Haha, indeed. But I am the one making all the input files, so I know they won't be empty ^^
<apeiros>
IME, if your method expects a non-empty array of integers or floats, you'll get an empty array, an array of strings, a hash, nil, anything else
<Dysp>
IME?
<apeiros>
in my experience
<Dysp>
Kay
bogn has joined #ruby
vasilakisfil has quit [Ping timeout: 276 seconds]
<apeiros>
but there's something to be said for not actively asserting correctness
fmcgeough has joined #ruby
<apeiros>
well, in that case: array.inject(:+).quo(array.size)
haylon has joined #ruby
<haylon>
ruby-offtopic
<apeiros>
aaaactually since "array" is a horrible variable name:
karioleez has quit [Remote host closed the connection]
sdwrage has quit [Quit: Leaving]
jmignault has joined #ruby
<apeiros>
if you know how to look up .quo, you're already ahead of so many people visiting this channel
<Dysp>
Now, apeiros - if I were to only find the mean of the first, say, 100 elements in the Array, could I still use the same method as you just described? I'll do with a yes or no and then figure it out myself.
<Dysp>
I just did ^_^
benlovell has joined #ruby
<Dysp>
And added at comment to the code explaining it
<apeiros>
yes, with a piece of code added either when calling the method, or in the method
Ropeney has quit [Quit: Leaving]
<apeiros>
the first 100 elements in an array are an array themselves ;-)
<Dysp>
Okay, Ill have a go at it tomorrow! Time to go home. Thank you so much for your help. I sincerely appreciate it.
<Dysp>
Oh the hints!
drewo has joined #ruby
stunder has joined #ruby
Emmanuel_Chanel has joined #ruby
Dysp has quit [Quit: Page closed]
drewo has quit [Ping timeout: 244 seconds]
Guest36566 is now known as Cyrus
lyoshajapan has joined #ruby
Cyrus has quit [Changing host]
Cyrus has joined #ruby
frem has joined #ruby
jdawgaz has joined #ruby
madgen__ has quit [Quit: leaving]
wldcordeiro has joined #ruby
baweaver has joined #ruby
madgen_ has joined #ruby
madgen_ has quit [Client Quit]
rubie has quit [Remote host closed the connection]
bry4n_ has joined #ruby
lyoshajapan has quit [Ping timeout: 248 seconds]
madgen_ has joined #ruby
aganov has quit [Remote host closed the connection]
<roelof>
I now see something like ; 1552315789.689355
rippa has joined #ruby
<apeiros>
roelof: a) use Time.now, not Time.new (even if it works now), Time#- returns seconds, so the question is - how many seconds are in a year? :)
RegulationD has joined #ruby
<roelof>
apeiros: oke, so the answer is in seconds
<roelof>
that problem I can solve
rubie has quit [Remote host closed the connection]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 244 seconds]
<gregf_>
roelof: what about validations and exceptions?
whippythellama has quit [Ping timeout: 246 seconds]
andikr has quit [Remote host closed the connection]
<gregf_>
bah , no wonder i has to type h(ie)(sr) name :/
<gregf_>
would've been better writing er/sie/es :(
timeout has joined #ruby
rubie has joined #ruby
x77686d has joined #ruby
nfk|laptop has quit [Ping timeout: 244 seconds]
Spami has quit [Ping timeout: 250 seconds]
n008f4g_ has joined #ruby
bdilly has joined #ruby
uglybandersnatch has quit [Ping timeout: 276 seconds]
rubie has quit [Read error: Connection reset by peer]
hotpancakes has quit []
rubie has joined #ruby
machinewar has joined #ruby
saneax_AFK is now known as saneax
Xeago has joined #ruby
<djellemah>
timeout: Process.waitpid and friends, but I've only used that for child processes and I'm not sure that applies in your situation.
DroidBurgundy has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
angrywombat has joined #ruby
bdilly has left #ruby [#ruby]
<machinewar>
How to require all ruby files nested under two directories w/ possible subdirectories This works for every ruby file starting in current directory Dir["**", "*.rb"]. but i want to start from something like Dir["directory1**", "directory2**", "*.rb"]
angrywombat has left #ruby [#ruby]
angrywombat has joined #ruby
angrywombat has left #ruby [#ruby]
angrywombat has joined #ruby
<eam>
machinewar: call it twice
angrywombat has left #ruby [#ruby]
angrywombat has joined #ruby
<adaedra>
Dir["directory{1,2}/**/*.rb"] may work
dc2 has joined #ruby
bkxd has joined #ruby
<machinewar>
Dir["{dir_1,dir_2}/**/*.rb"]
<machinewar>
seems to work!
angrywombat has left #ruby [#ruby]
puddy1 has joined #ruby
elifoster has joined #ruby
benlovell has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Ping timeout: 276 seconds]
skweek has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby
LaT0rtue has quit [Read error: Connection reset by peer]
diegoaguilar has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
bkxd has joined #ruby
kies has joined #ruby
<apeiros>
gregf_: that's only an approximation, though (that's what I wanted to get at, but had to go afk, and now roelof is offline)
benlovell has quit [Ping timeout: 268 seconds]
cwenner has joined #ruby
poguez_ has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
Guest32 has joined #ruby
infernix has quit [Ping timeout: 264 seconds]
davedev2_ has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
davedev24 has quit [Ping timeout: 248 seconds]
_stu_ has quit [Read error: Connection reset by peer]
kt2 has joined #ruby
nugit has quit [Read error: Connection reset by peer]
brendan- has quit [Read error: Connection reset by peer]
elifoster has quit [Read error: Connection reset by peer]
elifoster has joined #ruby
monoprotic has quit [Read error: Connection reset by peer]
monoprotic has joined #ruby
pietr0 has quit [Read error: Connection reset by peer]
brendan- has joined #ruby
nugit has joined #ruby
solocshaw has quit [Remote host closed the connection]
dc2 has quit [Read error: Connection reset by peer]
pietr0 has joined #ruby
fmcgeough has quit [Read error: Connection reset by peer]
_stu_ has joined #ruby
dc2 has joined #ruby
x77686d has quit [Read error: Connection reset by peer]
solocshaw has joined #ruby
tvw has quit [Remote host closed the connection]
zast has quit [Ping timeout: 244 seconds]
x77686d has joined #ruby
pandaant has joined #ruby
KensoDev has joined #ruby
fmcgeough has joined #ruby
Snowy has quit [Quit: ragequit]
hays_ has joined #ruby
AlexJakeGreen has quit [Remote host closed the connection]
maletor has joined #ruby
hays has quit [Ping timeout: 276 seconds]
skade has joined #ruby
merida has joined #ruby
kt2 has quit [Quit: ...]
ChiefAlexander has quit [Remote host closed the connection]
zast has joined #ruby
mtkd has quit [Ping timeout: 252 seconds]
ChiefAlexander has joined #ruby
Xeago has quit [Remote host closed the connection]
saneax is now known as saneax_AFK
GnuYawk has joined #ruby
GnuYawk has joined #ruby
bronson has joined #ruby
<manveru>
what do you guys use for domain validation these days?
GnuYawk has quit [Client Quit]
<manveru>
addressable still says 'something,co|uk' is a valid url, and URI.parse is fine with 'something,co,uk'
puddy1 has left #ruby [#ruby]
mtkd has joined #ruby
pandaant has quit [Remote host closed the connection]
<apeiros>
simpleidn (iirc) + a custom expression if I don't want to perform a dns lookup
<apeiros>
I can gist the relevant code
LoneHermit has joined #ruby
freerobby has quit [Quit: Leaving.]
Guest32 has quit [Ping timeout: 246 seconds]
<manveru>
ah, that's a good idea :)
nando293921 has joined #ruby
<manveru>
at least for serverside validation
benlovell has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
<manveru>
we already depend on addressable indirectly, so i wanted to use that for the IDN transformations
bogn has quit [Quit: Leaving.]
User458764 has joined #ruby
StyXman has joined #ruby
aufi has quit [Ping timeout: 264 seconds]
<apeiros>
haha, ok, it does look awkward when a window "unslurps" from the dock on your rightmost screen onto your leftmost screen
peteykun has joined #ruby
LoneHermit has quit [Ping timeout: 244 seconds]
<StyXman>
I'm thinking of extending rdoc to handle chef repositories, so it recognizes roles, recipies and other stuff. does noybody know any docs about extending rdoc?
s00pcan has quit [Ping timeout: 244 seconds]
benlovell has quit [Ping timeout: 260 seconds]
jaruga has quit [Quit: jaruga]
amclain has joined #ruby
mistermocha has joined #ruby
<apeiros>
manveru: https://gist.github.com/apeiros/1282959a5b3754f9a53ad4183540e371 - this part isn't yet in production, though. so if I'm doing something wrong, please tell :) Idn.to_ascii is just a wrapper around simpleidn which performs some additional checks related to encoding.
agent_white has joined #ruby
agit0 has joined #ruby
sorbo_ has joined #ruby
s00pcan has joined #ruby
Spami has joined #ruby
agit0 has quit [Client Quit]
marxarelli has joined #ruby
<darix>
StyXman: drbrain could give you some pointers, but he isnt here atm.
SCHAAP137 has quit [Remote host closed the connection]
brent_ has joined #ruby
wilbert has joined #ruby
<manveru>
apeiros: thanks, gonna see how it goes :)
timeout has quit [Quit: leaving]
<manveru>
we shouldn't get too wild domains, but i'd love to have not to fix this every month
<darix>
manveru: dont worry. you will. wait until people just allow more crazy things
bollullera has quit [Excess Flood]
<apeiros>
manveru: I want to add stuff like multi-plane detection for idn
<darix>
people still sometimes think you can validate a TLD with [A-Z]{2,3} :p
<apeiros>
errr, rather multi-script
pawnbox has quit [Remote host closed the connection]
<apeiros>
i.e. mixing of greek and latin letters to deceive people
<apeiros>
s/i.e./e.g./
<manveru>
awesome.みんな
* darix
thinks apeiros could just roll his code into a gem
<darix>
:p
<apeiros>
darix: it is
<apeiros>
just not released yet since there's still some kinks and I didn't have time
davedev24 has joined #ruby
symm- has joined #ruby
B1n4r10 has joined #ruby
<apeiros>
it's a complete value validation and adaptation gem
<manveru>
doing your job title full justice
davedev2_ has quit [Ping timeout: 244 seconds]
<apeiros>
how is that related to my master pedant title? :-O
edwinvdgraaf has quit [Ping timeout: 250 seconds]
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
stunder has quit [Ping timeout: 268 seconds]
<guardian>
hello, I added require 'pry' then binding.pry inside a spec test. Then when I run bundle exec rspec it doesn't stop to let me debug
<guardian>
any idea please?
crazydiamond has joined #ruby
vasilakisfil_ has quit [Quit: Konversation terminated!]
Jardayn has joined #ruby
<apeiros>
guardian: probably just means that the code isn't executed
machinewar has quit [Remote host closed the connection]
dikaio has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mrgrieves has quit [Ping timeout: 252 seconds]
benlovell has joined #ruby
Jardayn has quit [Read error: Connection reset by peer]
joonty has quit [Ping timeout: 264 seconds]
stunder has joined #ruby
baweaver has joined #ruby
s00pcan has quit [Ping timeout: 248 seconds]
_blizzy_ has quit [Quit: Leaving]
<guardian>
hmm looking more into it
agit0 has joined #ruby
agit0 has quit [Client Quit]
s00pcan has joined #ruby
alvin_ has joined #ruby
Couch has quit [Ping timeout: 268 seconds]
fedexo has quit [Ping timeout: 250 seconds]
sp4rrow has joined #ruby
Cohedrin has joined #ruby
syner2 has joined #ruby
sorbo_ has quit [Remote host closed the connection]
sneakerhax has quit [Ping timeout: 260 seconds]
infernix has joined #ruby
anisha has quit [Quit: Leaving]
weemsledeux has joined #ruby
drewo has joined #ruby
f4cl3y has quit [Ping timeout: 244 seconds]
rehat has quit [Remote host closed the connection]
sandstrom has quit [Quit: My computer has gone to sleep.]
mistermo_ has joined #ruby
blackmesa has joined #ruby
sandstrom has joined #ruby
rodfersou is now known as rodfersou|lunch
CausaMortis has quit [Ping timeout: 248 seconds]
Spami_ has joined #ruby
mistermocha has quit [Ping timeout: 244 seconds]
Alayde has joined #ruby
getbrandao has quit [Quit: Leaving]
Spami has quit [Ping timeout: 244 seconds]
mistermo_ has quit [Ping timeout: 250 seconds]
BSaboia has joined #ruby
jkahn has quit [Ping timeout: 276 seconds]
IrishGringo has quit [Ping timeout: 248 seconds]
dionysus69 has joined #ruby
alvin_ has quit [Ping timeout: 250 seconds]
hightower3 has joined #ruby
agit0 has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
weemsledeux has joined #ruby
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
benlieb has joined #ruby
hightower2 has quit [Ping timeout: 244 seconds]
weemsledeux has quit [Max SendQ exceeded]
jorum has joined #ruby
GnuYawk has joined #ruby
BSaboia has quit [Ping timeout: 252 seconds]
syner2 has quit [Read error: Connection reset by peer]
syner2 has joined #ruby
ixti has quit [Ping timeout: 260 seconds]
Tisho has joined #ruby
Tisho has left #ruby [#ruby]
roshanavand has quit [Quit: This computer has gone to sleep]
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
GnuYawk has quit [Quit: WeeChat 0.4.2]
freerobby has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
GodFodder has quit [Ping timeout: 268 seconds]
mistermocha has joined #ruby
BSaboia has joined #ruby
codecop has joined #ruby
polyidus has joined #ruby
Emmanuel_Chanel has quit [Remote host closed the connection]
mistermo_ has joined #ruby
mistermocha has quit [Ping timeout: 268 seconds]
Devalo has joined #ruby
benlovell has quit [Ping timeout: 248 seconds]
baweaver has quit [Remote host closed the connection]
mark2 has quit [Remote host closed the connection]
skade has quit [Read error: Connection reset by peer]
TheMoonMaster has quit [Ping timeout: 244 seconds]
skade has joined #ruby
sgambino has joined #ruby
CausaMortis has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
syner2 has quit [Quit: Konversation terminated!]
weckl has quit [Quit: Leaving]
symm- has quit [Ping timeout: 264 seconds]
syner2 has joined #ruby
shinnya has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
TheMoonMaster has joined #ruby
SCHAAP137 has joined #ruby
frozen3_ has joined #ruby
frozen3 has quit [Read error: Connection reset by peer]
Balzrael has joined #ruby
polyidus has quit [Quit: Later]
mikecmpbll has joined #ruby
felltir has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 260 seconds]
LaT0rtue has joined #ruby
sneakerhax has joined #ruby
frozen3 has joined #ruby
frozen3_ has quit [Read error: Connection reset by peer]
zast has quit [Remote host closed the connection]
IrishGringo has joined #ruby
dhollinger has quit [Quit: WeeChat 1.4]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
madgen has quit [Ping timeout: 246 seconds]
jdawgaz has joined #ruby
cpup has quit [Ping timeout: 264 seconds]
y2mq37 has joined #ruby
binaryplease1 has quit [Quit: Goodbye cruel world]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
symm- has joined #ruby
holmser has joined #ruby
<holmser>
I'm working on a script that needs unique filenames
cpup has joined #ruby
binaryplease has joined #ruby
sandelius has joined #ruby
choke has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
Es0teric has joined #ruby
<holmser>
Basically I'm checking against a hash of existing filenames, and if it exists I'm incrementing a serial value in the filename
<holmser>
I have a sneaking suspicion that there is a much more "rubyish" way to accomplish what I'm doing, but I can't quite figure it out
pfg__ has quit []
<workmad3>
holmser: you could try `Dir["prefix*"].sort[-1].succ` if there's no extension on the filename
pfg has joined #ruby
<holmser>
workmad3: I'm actually pulling the filenames (actually object names) from Swift in openstack, so it's just a hash
frozen3 has quit [Read error: Connection reset by peer]
jmgxgc has quit [Remote host closed the connection]
zacts has quit [Remote host closed the connection]
skweek has quit [Ping timeout: 276 seconds]
<holmser>
I'm going to sanitize the code and throw it in a gist
<workmad3>
holmser: ok, so hsh.values.sort[-1].succ then :)
frozen3 has joined #ruby
wilbert has quit [Ping timeout: 246 seconds]
<workmad3>
holmser: essentially, I'm pointing you at String#succ, which will take a string like "foobar1" and turn it into "foobar2" (although it can have some issues at "foobar9", so maybe it's no good for your situation)
bronson has joined #ruby
merida has quit [Remote host closed the connection]
merida has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
<holmser>
apeiros: I just want it to be clear when the backup was taken by the filename
jdawgaz has joined #ruby
<apeiros>
if your OS is decent, a file can have 255 chars
<apeiros>
so that shouldn't stop you
blandflakes has joined #ruby
SCHAAP137 has quit [Ping timeout: 276 seconds]
sepp2k has quit [Quit: Leaving.]
Emmanuel_Chanel has joined #ruby
d0nn1e has quit [Ping timeout: 246 seconds]
Dimik has joined #ruby
wilbert has joined #ruby
dfockler has joined #ruby
yuung has joined #ruby
d0nn1e has joined #ruby
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bronson has quit [Remote host closed the connection]
duckpuppy has joined #ruby
<schemanic>
Hi everyone
schemanic has quit [Quit: Leaving]
schemanic has joined #ruby
djbkd has joined #ruby
<adaedra>
Hi
<schemanic>
Can anyone tell me why in irb Date/Time/DateTime gives me NameError: uninitialized constant DateTime
platzhirsch has left #ruby [#ruby]
<apeiros>
schemanic: because you forgot to require 'date'?
SCHAAP137 has joined #ruby
<apeiros>
though, Time in that list won't give you a NameError
<schemanic>
sigh. Okay. I'm sorry - the Ruby doc code example didn't have the requirement statement so I didn't understand that it wasn't standard
DoubleMalt has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
GodFather is now known as rccie
<apeiros>
it is standard, but not core ;-)
stannard has quit [Remote host closed the connection]
<apeiros>
(core = loaded with the interpreter, standard = comes with ruby but must be required to use)
stannard has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
GodFather has joined #ruby
GodFather has quit [Max SendQ exceeded]
GnuYawk has joined #ruby
GodFather has joined #ruby
vF3hNGxc47h8 has joined #ruby
noway has quit [Ping timeout: 246 seconds]
vF3hNGxc47h8 has quit [Client Quit]
vF3hNGxc47h8 has joined #ruby
GodFather has quit [Disconnected by services]
GodFather has joined #ruby
GodFather has quit [Max SendQ exceeded]
sandelius has joined #ruby
rccie is now known as GodFoddar
GodFoddar is now known as rccie
bkxd has joined #ruby
hahuang61 has joined #ruby
wilbert has quit [Ping timeout: 248 seconds]
phaza has quit [Ping timeout: 260 seconds]
dmr8 has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
blackmesa has joined #ruby
bronson has joined #ruby
rccie is now known as GodFodder
<shevy>
schemanic huh you are right ruby-doc.org/stdlib/libdoc/date/rdoc/DateTime.html
<shevy>
I'll file an issue request
sepp2k has joined #ruby
Devalo has joined #ruby
GodFodder is now known as GodFoddar
GodFoddar is now known as GodFodder
bkxd has quit [Ping timeout: 276 seconds]
GnuYawk` has joined #ruby
GnuYawk has quit [Quit: WeeChat 0.4.2]
GnuYawk` has quit [Remote host closed the connection]
jt__ has joined #ruby
duckpuppy has quit [Quit: WeeChat 1.4]
<schemanic>
thanks for the confirm shevy
ChiefAlexander has joined #ruby
GodFoddar has joined #ruby
GodFoddar has quit [Max SendQ exceeded]
GodFodder has quit [Quit: Leaving]
yaewa has quit [Quit: Leaving...]
<Zarthus>
neat
GodFather has joined #ruby
moei has joined #ruby
<Zarthus>
i never knew the differences between datetime/time
* Zarthus
has been using Time successfully without knowing \o/!
Devalo has quit [Ping timeout: 250 seconds]
<shevy>
I still don't know it either!
baweaver has joined #ruby
duckpuppy has joined #ruby
<shevy>
I know I can't rely on the docs so I must tinker :D
edwinvdgraaf has joined #ruby
<apeiros>
it's less relevant now
<Zarthus>
the docs for datetime paint a funny picture regardless
<Zarthus>
the introduction at least
<Zarthus>
the rest of it was nerdy programmer talk
<shevy>
ah
GnuYawk has joined #ruby
<shevy>
I just skip the part above and look for examples
<Zarthus>
i read the first line and was interested enough to keep reading
<Zarthus>
i like how they're basically saying "you're in need of timezones? well good luck!"
<shevy>
but it's indeed not always trivial... I have a namespace DateTime... but I pull it in via requiring 'date' ... or optionparser... OptionParser but you need to require 'optparse' ... well at least optionparser page shows the require line http://ruby-doc.org/stdlib-2.3.0/libdoc/optparse/rdoc/OptionParser.html
<Zarthus>
yeah i have no idea why some requires differ from their class names
<Zarthus>
openstruct is ostruct as well, really annoying
vF3hNGxc47h8 has quit [Ping timeout: 268 seconds]
moos3 has joined #ruby
<shevy>
I think there even used to be or still are ways to require with capitalized letters... but I can't remember right now
sauvin has quit [Read error: Connection reset by peer]
agit0 has quit [Client Quit]
Jeff_D has joined #ruby
Gasher has joined #ruby
y2mq37 has quit [Ping timeout: 246 seconds]
dionysus69 has quit [Ping timeout: 248 seconds]
merida_ has joined #ruby
symm- has joined #ruby
baweaver has quit [Remote host closed the connection]
hunter42 has joined #ruby
merida has quit [Ping timeout: 276 seconds]
<hunter42>
i'm trying to use "flash" and am getting this error: undefined local variable or method `flash' for SessionsController:Class ---- anyone know why?
<apeiros>
?rails hunter42
<ruby[bot]>
hunter42: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
hunter42 is now known as hunter99
ferr has quit [Quit: WeeChat 1.4]
<Jeff_D>
Regexp question: say I have content like `<p>This is <a id="note-27-begin"></a><a id="note-9-begin"></a>sample<a id="note-27-end"></a> content.<a id="note-9-end"></a></p>`; is it possible to craft a Regexp that will correctly match/extract the overlapping “node” pairs, or do I have to break out Nokogiri or equivalent?
_stu_ has quit [Quit: _stu_]
<apeiros>
hm, what was the factoid again?
<apeiros>
?regexxml
<ruby[bot]>
apeiros: I don't know anything about regexxml
<Jeff_D>
I’ve tried /<a id="note-(\d+)-begin"><\/a>(.+)<a id="note-\1-end"><\/a>/ — which picks up only the first item
<apeiros>
Jeff_D: ^
<Jeff_D>
OK; thanks; that makes perfect sense
<Jeff_D>
sorry, my eyes aren’t as young as I used to be; hard to read and type at the same time. Thanks, all, and calling it a night at 0230 here :P
<apeiros>
you can extract it with a regex, but it'll break for all kinds of changes which don't change anything semantically about the xml
Jeff_D has quit [Quit: JMP $]
GnuYawk has quit [Changing host]
GnuYawk has joined #ruby
mistermocha has quit [Remote host closed the connection]
hunter99 has quit [Client Quit]
polyidus has joined #ruby
dc2 has quit [Ping timeout: 260 seconds]
skade has quit [Quit: Computer has gone to sleep.]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
skade has joined #ruby
skade has quit [Read error: Connection reset by peer]
tomchapin has joined #ruby
skade has joined #ruby
mistermocha has joined #ruby
tomchapin has quit [Client Quit]
_djbkd has joined #ruby
skade has quit [Client Quit]
CausaMortis has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
LoneHermit has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
dhollinger has joined #ruby
djbkd has quit [Ping timeout: 248 seconds]
elaptics is now known as elaptics`away
mistermo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
the_drow has joined #ruby
solars has joined #ruby
dionysus69 has joined #ruby
cdg has quit [Remote host closed the connection]
kloeri has quit [Remote host closed the connection]
LoneHermit has quit [Ping timeout: 264 seconds]
kloeri has joined #ruby
<atmosx>
Hello! Do we have any ruby-ML moderator hanging out here? My email apparently was "too long" and went to moderation queue :-/
yuung has quit [Quit: leaving]
mistermo_ has quit [Remote host closed the connection]
mistermocha has joined #ruby
sandelius has joined #ruby
ljames has quit []
jackjackdripper has joined #ruby
<adaedra>
tl;dr
<shevy>
hah
jorum has quit [Ping timeout: 268 seconds]
<shevy>
you must use short words!
<shevy>
"money ??? profit"
agit0 has joined #ruby
Eiam_ has joined #ruby
zens has joined #ruby
<atmosx>
adaedra: ... lol ... I thought my problem understood but apparently wasn't, so I had to write a paragraph or two :-P
infernix has joined #ruby
blackmesa has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
zens has left #ruby [#ruby]
ramfjord has joined #ruby
LHdez has quit [Ping timeout: 264 seconds]
mjuszczak has joined #ruby
nachoman has joined #ruby
<ramfjord>
What's up guys? Does anyone know a clean way of converting a Date to a Time at midnight in UTC regardless of the system time? I'm messing around with using a ActiveSupport::TimeZone.parse and converting the date to a String, but it looks pretty ugly
mjuszczak has quit [Client Quit]
<shevy>
most active* gem users are on #rubyonrails, in the event that nobody here can answer the question (I know I can't because I know next to nothing about the various active* gems)
<ramfjord>
I'm not wedded to ActiveSupport/rails, but I don't know of any other gems that handle timezones well
<atmosx>
Date.parse('2015-01-01').to_time ?
Eiam_ has quit [Ping timeout: 260 seconds]
DTZUZU has quit [Ping timeout: 276 seconds]
<apeiros>
ramfjord: you're talking of code in rails?
<shevy>
hmm there were some other gems... can't recall right now... chronos or something
<ramfjord>
I'm not using rails, I'm just using activesupport
<apeiros>
ok, I'd still go to #rubyonrails then, since those additions come from there
<atmosx>
shevy: tbh there are more time related-rails gems (some do very trivial staff) than I can count
<ramfjord>
ok, I'll give it a shot
<shevy>
atmosx yeah
<ramfjord>
atmosx: I'm pretty sure that uses the system timezone, which is exactly what I'm trying to avoid
<Ox0dea>
atmosx: Chronic is pretty nifty, though.
<atmosx>
ramfjord: I used tzinfo in the past to avoid the system's timezone.
Es0teric has quit [Quit: Computer has gone to sleep.]
sp4rrow has quit [Ping timeout: 276 seconds]
centrx has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
kobain has quit [Ping timeout: 260 seconds]
SCHAAP137 has quit [Quit: Leaving]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
uglybandersnatch has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
ChiefAlexander has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
sp4rrow has joined #ruby
IntoTheWild27 has joined #ruby
<IntoTheWild27>
ciao
<IntoTheWild27>
!lista
IntoTheWild27 has left #ruby [#ruby]
polyidus has quit [Quit: Later]
uglybandersnatch has quit [Ping timeout: 244 seconds]
p0wn3d has joined #ruby
stunder has quit [Ping timeout: 248 seconds]
skade has joined #ruby
polyidus has joined #ruby
dionysus69 has quit [Remote host closed the connection]
<adaedra>
...of course?
dionysus69 has joined #ruby
ChiefAlexander has joined #ruby
karioleez has joined #ruby
rbennacer has quit [Remote host closed the connection]
_stu_ has joined #ruby
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
Macaveli has joined #ruby
centrx has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
<shevy>
!siesta
mistermocha has quit [Ping timeout: 260 seconds]
theery has joined #ruby
hxegon is now known as hxegon_AFK
GodFather has joined #ruby
jt__ has quit [Remote host closed the connection]
p0wn3d has quit [Quit: WeeChat 1.2]
stannard has quit [Remote host closed the connection]
ixti has joined #ruby
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
baweaver has joined #ruby
ur5us has joined #ruby
mistermocha has joined #ruby
jenrzzz has joined #ruby
stannard has joined #ruby
ur5us_ has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
krz has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
ur5us has quit [Ping timeout: 276 seconds]
ChiefAlexander has quit [Remote host closed the connection]
tvw has joined #ruby
sandstrom has joined #ruby
polyidus has quit [Quit: Later]
BSaboia has quit [Quit: Leaving]
the_drow has quit [Quit: This computer has gone to sleep]
polyidus has joined #ruby
Gooer has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
ekinmur has joined #ruby
jdawgaz has joined #ruby
hostess has quit [Quit: No Ping reply in 180 seconds.]
baweaver has joined #ruby
hostess has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Sonja has joined #ruby
ChiefAlexander has joined #ruby
<Sonja>
hello
merida_ has quit [Remote host closed the connection]
uglybandersnatch has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
uglybandersnatch has quit [Read error: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac]
uglybandersnatch has joined #ruby
syner2 has quit [Quit: Konversation terminated!]
hxegon_AFK is now known as hxegon
drewo has quit [Ping timeout: 250 seconds]
skade has quit [Quit: Computer has gone to sleep.]
theery has quit []
dionysus69 has quit [Ping timeout: 244 seconds]
codecop has quit [Remote host closed the connection]
skade has joined #ruby
yfeldblum has joined #ruby
<itaipu>
how to force a gem to be installed ? I'm trying to install sup (gem install sup) but it failed to install ruby-xapian, but I installed xapian (gem install xapian) and I don't want to install ruby-xapian because is somehow broken in debian sid
dfockler has quit [Ping timeout: 264 seconds]
mistermocha has quit [Remote host closed the connection]
skade has quit [Client Quit]
<apeiros>
itaipu: -y, or --no-dependencies iirc
<apeiros>
see `gem help install`
<itaipu>
apeiros: thks
<fexilal>
what is rubinius trying to accomplish? good idea but poor execution?
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<chrisseaton>
fexilal: PyPy is written almost entirely in Python (actually RPython, but it's almost the same), Rubinius' JIT and VM internals and things like that are mostly C++, so it's not quite the same thing as what PyPy are trying
frozen3 has quit [Read error: Connection reset by peer]
<shevy>
itaipu if it would be pure ruby you could just install it and put it into the right places; but for compiling something, on linux at least you need some generated .so file
cout has quit [Ping timeout: 240 seconds]
ceej has joined #ruby
Apocalypse has joined #ruby
<shevy>
you need to find out what failed exactly, usually it is some missing .h header file
jenrzzz_ has joined #ruby
cout has joined #ruby
polyidus has quit [Ping timeout: 276 seconds]
ta__ has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
frozen3_ has joined #ruby
Sonja has quit [Ping timeout: 248 seconds]
frozen3 has quit [Read error: Connection reset by peer]
chouhoulis has quit [Remote host closed the connection]
Ikri has quit [Quit: No Ping reply in 180 seconds.]
ta_ has quit [Ping timeout: 246 seconds]
yatish27 has joined #ruby
sp4rrow has quit [Ping timeout: 276 seconds]
Ikri has joined #ruby
<itaipu>
shevy: that is a bit odd, since I successfuly installed the xapian 1.2.18 and the dependencie described is for at least 1.2.15
vikaton has joined #ruby
cdg has joined #ruby
<itaipu>
I'm not ruby dev, but I could read the rake file
<shevy>
itaipu there is no other possibility than to find out what exactly failed
aldodelgado has quit [Quit: aldodelgado]
<shevy>
this does not say the compile error
<itaipu>
yeah it doesn't, but that was wall that was logged in .log file
blackmesa has quit [Ping timeout: 276 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nfk|laptop has joined #ruby
blackmesa has joined #ruby
<shevy>
the .log file is often useless, I always extract the gem, then work in the directory itself
<shevy>
you can extract via "gem unpack"
<StyXman>
darix: ack
abyx has joined #ruby
frozen3_ has quit [Ping timeout: 264 seconds]
<shevy>
inside there, should be a file called extconf.rb usually which you can run; sometimes rake is used but it never works for me
<abyx>
Does anyone have recommendations for upgrading from Ruby 1.9.3 to Ruby 2.3?
<shevy>
once you compile, you will quickly see the specific error
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
abyx depends on how much you must change. do you have legacy code? the biggest problems I had was with encoding; smaller issues were psych, and some syntax changes like the : notation for hash
frozen3 has joined #ruby
rodfersou|afk is now known as rodfersou
ur5us_ has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
rideh has quit [Ping timeout: 244 seconds]
tvw has quit []
DarkBushido_ has quit [Ping timeout: 248 seconds]
<abyx>
oh i'm not doing any ruby dev myself, i just need to upgrade to make use of compass
<abyx>
shevy,
Ikri has quit [Quit: No Ping reply in 180 seconds.]
Aswebb_ has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
Ikri has joined #ruby
<abyx>
also do you guys recommend installing RVM?
Bounga` has quit [Remote host closed the connection]
<adaedra>
chruby!
nfk|laptop has quit [Ping timeout: 260 seconds]
rideh has joined #ruby
* havenwood
beats the chruby war drums
<adaedra>
favorited by both guys and gals!
<apeiros>
apeirae still use rvm
<apeiros>
but then again, apeirae are older than time itself
<benlieb>
it looks like it cleaned the chars instead of removedthem
lxsameer has joined #ruby
<slash_nick>
what a cute method name
<smathy>
apeiros, yeah, I misread it initially. All good.
ssiris has joined #ruby
<apeiros>
smathy: hm, what? I think you misunderstood me :)
<benlieb>
Or actually no, the city went from G\xF6teborg to Gteborg
<apeiros>
I view using utf8-cleaner as doing it quickly (and wrong)
<smathy>
apeiros, sorry, meant for benlieb
<apeiros>
whereas I view your approach as correct
<smathy>
Looks like I didn't misread afterall :)
bollullera has joined #ruby
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benlieb>
Street from to Kung\xE4lvsgatan Kunglvsgatan
<smathy>
benlieb, right, it's just stripping them.
<benlieb>
ug
<apeiros>
of course. it's not magic.
<smathy>
Should have gone to Kungälvsgatan
<apeiros>
welcome to the world of encodings.
<benlieb>
yeah, well it's better than choking
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benlieb>
i guess
<apeiros>
if you don't know the source encoding, you're fucked.
<smathy>
apeiros, no, if it used tidy_bytes on everything then it would ahve worked.
jdawgaz has joined #ruby
kobain has quit [Ping timeout: 260 seconds]
<apeiros>
smathy: haha, yeah, because it *guesses windows-1252*
<apeiros>
always
<benlieb>
paypal actually provides the encoding in the params,
<apeiros>
how very western-euro-centric
<apeiros>
def tidy_bytes(string, force = false); return string if string.empty?; return recode_windows1252_chars(string) if force; string.scrub { |bad| recode_windows1252_chars(bad) }; end
<smathy>
apeiros, right, but if you know that's what your incoming strings are, then it would have worked.
<apeiros>
if you know your incoming encoding, you can just straight do the right thing and set the e/i encoding of the IO
Aviio has joined #ruby
<apeiros>
I'm amazed how many programmers cling to guess-working solutions over solid solutions. makes me kinda sad.
<benlieb>
but if this is choking inside of rails while trying to parse params, it's not easy to clean it myself
<smathy>
benlieb, yep, that's using basically the same code I showed you.
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ChiefAlexander has quit [Quit: Leaving...]
<smathy>
benlieb, just be aware, it's middleware, so it's going to process everything.
bollullera has left #ruby [#ruby]
<rik>
i had to def (Sequel::Model.db).connection_pragmas the other day. I don't understand the brackets there. Can anyone help me with the language part of that? why did I need those brackets, and how should I fugure out next time that I do?
symm- has joined #ruby
<benlieb>
smathy: I know, scary, but it's either that or write the middleware myself.
<smathy>
apeiros, the "IO" is just arriving in a http callback, can't set it on the IO object itself.
<smathy>
benlieb, umm, no, just put the code I showed you in your model.
aupadhye has quit [Quit: Leaving]
<benlieb>
smathy: but that only solves the problem for that model...
<smathy>
...or controller might be better.
sp4rrow has joined #ruby
<apeiros>
smathy: if your IO is used for multiple encodings, the proper source encoding is binary, using .force_encoding on substrings of a known encoding.
<smathy>
benlieb, how many callbacks from Paypal are you processing?
<apeiros>
scrubbing is a fallback for scenarios where specifications are bad
<apeiros>
or for actually invalid input - though then I prefer using a bat on the supplier.
gregf has quit [Quit: WeeChat 1.4]
<benlieb>
smathy: just that one, but the problem is that any user can submit funky encodings
<smathy>
apeiros, the supplier is PayPal, good luck with that.
<benlieb>
I'm not an encoding expert by any means
<smathy>
benlieb, how?
lxsameer has quit [Quit: WeeChat 1.4]
<smathy>
benlieb, where else are you getting input strings from?
lxsameer has joined #ruby
<apeiros>
smathy: it's not unlikely that they give the proper encoding. http has an encoding header after all.
<benlieb>
smathy: various services (stripe etc)
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
bkxd has joined #ruby
lxsameer has quit [Client Quit]
<smathy>
apeiros, not a request header (AFAIK), servers just infer the type from the accept-encoding or accept-charset, whatever it is, AFAIK.
skweek has joined #ruby
lxsameer has joined #ruby
<smathy>
benlieb, and they're sending non-UTF8 as well?
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
smathy: content-type usually contains the encoding
<smathy>
apeiros, that's a response header, not a request header.
<smathy>
These are callbacks coming into the server.
<apeiros>
smathy: um, yes, if you have a body, there's content-type
<apeiros>
in the request too
<apeiros>
because - surprise - you can have different types of content in a body
<smathy>
apeiros, oh cool, TIL.
<apeiros>
it *might* be differently named
jenrzzz_ has quit [Ping timeout: 268 seconds]
<apeiros>
but iirc it was just content-type too
B1n4r10 has quit [Ping timeout: 264 seconds]
<smathy>
Seems sensible.
<apeiros>
without a body it makes no sense of course and therefore isn't present. so good luck on url params :-/
<smathy>
Well, they should be URI encoded right?
<apeiros>
again, iirc. it's been a while since I worked through that swamp
<smathy>
...oh, but to what :)
<apeiros>
yes, but that means it's just bytes
<apeiros>
and you don't know how those bytes are supposed to be mapped to characters
<smathy>
Yeah.
<apeiros>
which is what an encoding does :)
<smathy>
Fun.
<smathy>
Unless URI encoding has a set charset.
<apeiros>
ask me again in ~6 months
<apeiros>
in the hopes that I've written those parts of my webframework until then. because I'll have to get up to speed with the current situation for that.
bkxd has quit [Ping timeout: 276 seconds]
drewo has quit [Ping timeout: 276 seconds]
<apeiros>
smathy: re content-type in requests - the most fun I have so far is multipart with xml+pdf :) (part of a soap api we use)
kobain has joined #ruby
<smathy>
apeiros, heh, I'm sure.
haylon has quit [Quit: WeeChat 1.4]
andywojo has joined #ruby
Madplatypus has joined #ruby
<apeiros>
the most common is probably www-url-form-encoded or whatever the precise spelling was
dangeranger has joined #ruby
<apeiros>
second most common is probably either json or xml
<Madplatypus>
Hello everyone
polysics has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
polysics has joined #ruby
abyx has quit [Quit: This computer has gone to sleep]
frozen3_ has joined #ruby
Aswebb_ has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
karioleez has quit [Remote host closed the connection]
lemur has joined #ruby
itaipu has quit [Ping timeout: 276 seconds]
prodigel has joined #ruby
f3ttX] has quit [Remote host closed the connection]
f3ttX] has joined #ruby
<prodigel>
Hey all. Ruby noob here, trying to use mina to make a deploy and I get an error I'm not sure I understand: Errno::ENOENT: No such file or directory @ rb_sysopen - /usr/lib/ruby/data/deploy.sh.erb. Am I missing an app/gem/etc? Is the deploy task broken? So many questions ... :D
uglybandersnatch has joined #ruby
lkba has joined #ruby
marxarelli has joined #ruby
f3ttX] has quit [Remote host closed the connection]
agit0 has quit [Read error: Connection reset by peer]
decoponio has quit [Quit: Leaving...]
edwinvdgraaf has quit [Remote host closed the connection]
phpwebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
IrishGringo has joined #ruby
russt has joined #ruby
LaT0rtue has quit [Read error: Connection reset by peer]
idletask has quit [Ping timeout: 248 seconds]
Xeago has quit [Ping timeout: 240 seconds]
whippythellama has joined #ruby
itaipu has quit [Ping timeout: 260 seconds]
<smathy>
ruby-lang930, a subject in rspec doesn't maintain state between `it` blocks you know.
tzhuang has joined #ruby
<smathy>
ruby-lang930, ie. it's really just the same as: def setup; @subject = something; end in xunit.
bronson has joined #ruby
xlegoman has joined #ruby
<ruby-lang930>
smathy: I dont think that's really what I'm looking for then. I think what I need is something akin to fixtures in Rails (but in my case I don't need to deal with a database).
<bodgix>
hey everyone. this question has been bothering me for some time now. are there any reasons for using polymorphism in ruby or more generally dynamically typed languages? I mean unless there's common functionality which can be extracted into the base class, I don't see many reasons to create class hierarchies, duck typing could be used instead? Anyone has any ideas why class hierarchies would be better besides the organization of code?
DTZUZU has quit [Ping timeout: 260 seconds]
<baweaver>
!poodr
<baweaver>
no? Ah well
<smathy>
ruby-lang930, so just write it.
<baweaver>
Practical Object Oriented Design in Ruby is a good read on that bodgix
<bodgix>
I've read it iirc. There's an example with bicycles?
<baweaver>
yeah
<baweaver>
normally ruby uses module inclusion though
<ruby-lang930>
smathy: I mean that I don't want to write the same setup for several tests.
<baweaver>
kinda akin to interfaces in other languages.
<bodgix>
I think I'll read this chapter again
gix has quit [Quit: Client exiting]
<bodgix>
the thing is that technically it's not needed in ruby as opposed to java for example
<smathy>
ruby-lang930, right, of course not. Write it in one place and use it wherever you need to.
<ruby-lang930>
smathy: Sorry I'm not sure I understand. You mean write a module and include the require the code into my tests?
idletask has joined #ruby
<Ox0dea>
ruby-lang930: Sounds like you want a before block.
goglosh has joined #ruby
<smathy>
ruby-lang930, yes, could be a module that you include, some methods in your test_helper.rb, or a class you call from your tests. Whatever you want.
maletor has quit [Quit: Computer has gone to sleep.]
<smathy>
You could write a base class for all your tests with the methods in it if you wanted. This is ruby, there are many ways of using the same functionality in multiple places.
sepp2k has quit [Read error: Connection reset by peer]
russt has quit [Quit: That's all, folks!]
Aswebb_ has quit [Ping timeout: 260 seconds]
dfockler has quit [Quit: Leaving]
DLSteve has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
teej has joined #ruby
russt has joined #ruby
chouhoulis has joined #ruby
lemur has joined #ruby
<riceandbeans>
what's a safe way to check if a variable exists?
spuk has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
millerti has joined #ruby
millerti has quit [Client Quit]
<apeiros>
read your code. and if that's not sufficient, you probably are doing something wrong.
QualityAddict has joined #ruby
<riceandbeans>
no that ain't it
<riceandbeans>
I think I want if defined?(foo)
<baweaver>
!xy
<baweaver>
?xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<baweaver>
aha
<apeiros>
and I think if you want that, you do indeed something quite wrong
<Radar>
baweaver: apeiros and I conspired to ensure maximum factoid prefix confusion
<riceandbeans>
well, basically I have an ERB file, I just want some chunks of template to exist if a variable is set, if the variable isn't set to anything I don't care and it doesn't need to go in the template
<baweaver>
>> v = nil; if v then 'foo' else 'bar' end