<happytux>
This will change the default task to :help
<happytux>
really, I tried it
benzrf is now known as benzrf|offline
zz_karupa is now known as karupa
kireevco has quit [Quit: Leaving.]
tyfighter has quit [Quit: <3]
terrellt has quit [Quit: Leaving...]
b1205 has quit [Ping timeout: 252 seconds]
Deele has joined #ruby
benzrf|offline is now known as benzrf
b1205 has joined #ruby
gkra has joined #ruby
hermanmunster has quit [Remote host closed the connection]
endash has quit [Quit: endash]
hermanmunster has joined #ruby
binaryhat has quit [Quit: Leaving]
Asher has quit [Ping timeout: 260 seconds]
Asher has joined #ruby
i_s has quit [Remote host closed the connection]
testcore has quit [Quit: [BX] Occifer, I'm not as think as you stoned I am!]
EminenceHC has quit [Remote host closed the connection]
linojon has quit [Quit: linojon]
ddv has quit [Ping timeout: 245 seconds]
Ankhers has joined #ruby
chipotle has quit [Quit: cya]
linojon has joined #ruby
toastynerd has quit [Remote host closed the connection]
Slavox is now known as Slavox|AFK
codydh has quit [Quit: Computer has gone to sleep.]
codydh has joined #ruby
kireevco has joined #ruby
chipotle has joined #ruby
ddv has joined #ruby
djbkd has quit [Remote host closed the connection]
nanoyak has quit [Quit: Computer has gone to sleep.]
djbkd has joined #ruby
bradhe has joined #ruby
slacko60671 has quit [Remote host closed the connection]
mercwith1mouth has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 245 seconds]
mikepack has joined #ruby
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has joined #ruby
ahofmann has joined #ruby
bradhe has quit [Ping timeout: 265 seconds]
JoshGlzBrk has joined #ruby
cpruitt has joined #ruby
hpoydar has quit [Remote host closed the connection]
nyamx2 has joined #ruby
cpruitt has left #ruby [#ruby]
mikepack has quit [Ping timeout: 265 seconds]
sevenseacat has joined #ruby
krz has quit [Quit: WeeChat 0.4.3]
brain_shim has joined #ruby
GriffinHeart has joined #ruby
ecksit has joined #ruby
mitt3ns has quit [Read error: Connection reset by peer]
mitt3ns has joined #ruby
mitt3ns has quit [Client Quit]
jeregrine has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
chipotle has quit [Quit: cya]
Hobogrammer has quit [Ping timeout: 260 seconds]
Takle has quit [Remote host closed the connection]
blackgoat has quit [Quit: WeeChat 0.3.8]
teddyp1cker has joined #ruby
Guest95638 has joined #ruby
Guest95638 has left #ruby [#ruby]
parduse has quit [Killed (rajaniemi.freenode.net (Nickname regained by services))]
parduse has joined #ruby
GriffinHeart has quit [Ping timeout: 260 seconds]
parduse is now known as Guest3484
charliesome has joined #ruby
Valesk_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
northfurr has quit [Quit: northfurr]
yubrew has joined #ruby
benzrf is now known as benzrf|offline
ixti has quit [Ping timeout: 252 seconds]
teddyp1cker has quit [Ping timeout: 245 seconds]
benzrf|offline is now known as benzrf
PanPan has joined #ruby
Valesk_ has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
redondos has quit [Excess Flood]
havenwood has quit [Remote host closed the connection]
redondos has joined #ruby
amargherio has joined #ruby
meatherly has joined #ruby
meatherly has quit [Client Quit]
yubrew has quit [Ping timeout: 245 seconds]
aantix has joined #ruby
graspee has quit [Quit: Leaving]
pietr0 has joined #ruby
jottr_ has quit [Ping timeout: 260 seconds]
aantix has quit [Client Quit]
ahofmann has quit [Quit: Computer has gone to sleep.]
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
foobarbaz_ has joined #ruby
<foobarbaz_>
Hi guys, just a quick question
<foobarbaz_>
I've learning ruby and I noticed there's active record
<foobarbaz_>
If i do things like model.all.map { |model| model.property }.sum
cashnguns has joined #ruby
<foobarbaz_>
Is that lazily evaluated to know that I'm basically doing `select count(property) from model`
<Soliah>
foobarbaz_ you're iterating over the array in memory there.
<foobarbaz_>
or is it doing `select * from model`
<sevenseacat>
no, it isnt
<foobarbaz_>
then in memory
<foobarbaz_>
yeahh
<foobarbaz_>
Is there a way to stop that?
robbyoconnor has quit [Excess Flood]
<foobarbaz_>
I come from a background like C# where LINQ would give a good query for that
sputnik13 has joined #ruby
ecksit has quit [Quit: Computer has gone to sleep.]
<Soliah>
model.sum(:property)
<sevenseacat>
if you're using AR i would just do model.select('sum(property)').all or something similar
robbyoconnor has joined #ruby
<sevenseacat>
or that
blackgoat has joined #ruby
robbyoconnor has quit [Remote host closed the connection]
Asher has quit [Quit: Leaving.]
<foobarbaz_>
is it normal to be using active record like that?
<foobarbaz_>
I don't know how to write idiomatic ruby unfortunately :P
<Soliah>
foobarbaz_ just keep going at it. Maybe look at some open source projects to see idoimatic code.
<Soliah>
foobarbaz_ also read the docs. The AR API is pretty large so chances are there's an API for the common cases.
tkuchiki has joined #ruby
sputnik13 has quit [Client Quit]
<Soliah>
foobarbaz_ actually with LINQ i recall there being cases where if you used an expression instead of a lambda you might get undesired behaviour with EF. Though my memory is hazy.
<codydh>
Hello! Question, if I currently have a view that currently prints <%= @user.name %>, but my model actually has like 15 variables, is there a way to programmatically just loop through and print all items in @user?
zombie__ has joined #ruby
<foobarbaz_>
Soliah: Yeah there's a bunch of edge cases, but pretty solid
<foobarbaz_>
Scala's doing similiar thing stoo
<foobarbaz_>
things too*
<foobarbaz_>
Obviously i'm in the wrong channel to ask this; But is Ruby worth learning? :)
<Soliah>
codydh you could iterate over the @user.attributes hash.
Dekade has quit [Read error: Connection reset by peer]
<foobarbaz_>
Will give map = { "a" => {"foo" => 2 } }
<Soliah>
calling the variable map makes it confusing.
lw has joined #ruby
lw has quit [Max SendQ exceeded]
lw has joined #ruby
<codydh>
Another question, what's the easiest way to get the ZURB Foundation framework (or Bootstrap) in Rails? Should I just include the assets where I need them, or is there a "better" way?
<foobarbaz_>
or would you have to say, if !map.key? "a" then map["a"] = map["a"] end
<benlieb>
I could use aws sdk, but is there some kind of network ping or head request I could use?
<pontiki>
i use s3cmd from the command line, would that be what you need?
<atmosx>
benlieb: depends on what you wanna do
fabrice31 has joined #ruby
<atmosx>
benlieb: IMHO an http request might faster/more reliable. Ping requests might be blocked, etc.
sdouglas has joined #ruby
kireevco has quit [Quit: Leaving.]
<benlieb>
pontiki: I'm writing an "integrity" checker for my web app, which checks for the integrity of the database, relationships, and the existence of certain resources, in this case thousands of video in multiple formats, thumbnails images, and other related resources.
C0deMaver1ck has quit [Ping timeout: 252 seconds]
gbchaosmaster has quit [Ping timeout: 265 seconds]
<benlieb>
I upload new content periodically and the files are big, the batches take overnight to upload and things get wonky with network hiccups
<benlieb>
Some resources slip through the cracks
<pontiki>
maybe look at the fog gem?
Takle has joined #ruby
<benlieb>
I also want to verify that certain resources are public, others are private. It's a bit of a headache.
<pontiki>
i'm assuming you build manifests so you can verify things are where they should be?
<benlieb>
pontiki: how so?
andikr has joined #ruby
C0deMaver1ck has joined #ruby
C0deMaver1ck is now known as Guest88881
<atmosx>
benlieb: how do you upload the content? what protocol? http, ftp, rsync?
blaxter has quit [Ping timeout: 265 seconds]
zorak has quit [Read error: Connection reset by peer]
<pontiki>
you know what files should be where, and what permissions they should have; this should be capturable in a manifest, possibly in json or such, which you can run through to ensure everything is in order
<benlieb>
atmosx: I'm using a gui: S3hub
<pontiki>
chef uses something similar to that
sdouglas has quit [Ping timeout: 240 seconds]
<benlieb>
I tried via a rake task once and that was a disaster...
<pontiki>
you could also keep the manifest in a table in your app
<atmosx>
benlieb: I don't now but your problem seems possible to tackle at a lower level. But since I don't know the specific, I can't really guess. There are many protocols that are extremely tolerant to network deficiencies (rsync, bittorent, etc.).
<pontiki>
or pull it from other tables if need be
Xeago has quit [Read error: Connection reset by peer]
<atmosx>
anyway I'm off to the library, cya later
zorak has joined #ruby
Xeago has joined #ruby
<riceandbeans>
I think I'm going to use camping
Xeago has quit [Read error: Connection reset by peer]
Asher2 has joined #ruby
Asher has quit [Read error: Connection reset by peer]
<DEA7TH>
Is it conventional to use """[text]""" for comments in Ruby, like I do in Python?
newUser1234 has joined #ruby
<canton7>
no
<flops>
DEA7TH: use # text
<DEA7TH>
flops: but I need multi-line
<flops>
there is none
phansch has joined #ruby
<flops>
just start every line with #
<DEA7TH>
hm ok
<canton7>
there =begin and =end, but they're ultra-rare
<canton7>
just use #'s
jottr_ has joined #ruby
AlHafoudh has left #ruby ["Leaving"]
vinleod has joined #ruby
mikepack has quit [Ping timeout: 276 seconds]
newUser1234 has quit [Ping timeout: 252 seconds]
tobago has quit [Remote host closed the connection]
aagdbl has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
yubrew has joined #ruby
jottr_ has quit [Ping timeout: 240 seconds]
emsilva has joined #ruby
AlHafoudh has joined #ruby
<AlHafoudh>
hi
<AlHafoudh>
rubyists, how do you monitor wal-e archiving?
riotjones has quit [Ping timeout: 245 seconds]
predator117 has quit [Ping timeout: 265 seconds]
predator117 has joined #ruby
yubrew has quit [Ping timeout: 265 seconds]
ItsYoda has quit [Ping timeout: 265 seconds]
ohcibi has quit [Ping timeout: 265 seconds]
Yoda- has joined #ruby
ohcibi has joined #ruby
Takle has quit [Remote host closed the connection]
sdouglas has joined #ruby
ohcibi has quit [Excess Flood]
morinap has joined #ruby
kaspergrubbe has quit [Ping timeout: 265 seconds]
forcefsck has quit [Ping timeout: 265 seconds]
oo_ has quit [Remote host closed the connection]
sdouglas has quit [Ping timeout: 260 seconds]
holmser_ has joined #ruby
mumblet has joined #ruby
postmodern has quit [Quit: Leaving]
oo_ has joined #ruby
Photism_ has joined #ruby
gazarsgo_ has joined #ruby
ClarusCogitatio_ has joined #ruby
andikr has joined #ruby
SegFaultAX_ has joined #ruby
mahlon_ has joined #ruby
cnj has quit [Quit: Quit]
haroldwu_ has joined #ruby
qpok_ has joined #ruby
Yoda- has quit [Ping timeout: 265 seconds]
mumblerit has quit [Ping timeout: 265 seconds]
holmser has quit [Ping timeout: 265 seconds]
phrozen77 has quit [Ping timeout: 265 seconds]
tiguser has quit [Ping timeout: 265 seconds]
ClarusCogitatio has quit [Ping timeout: 265 seconds]
gazarsgo has quit [Ping timeout: 265 seconds]
Yoda- has joined #ruby
Photism has quit [Ping timeout: 265 seconds]
haroldwu has quit [Ping timeout: 265 seconds]
SegFaultAX has quit [Ping timeout: 265 seconds]
tiguser has joined #ruby
DefV has quit [Ping timeout: 265 seconds]
qpok has quit [Ping timeout: 265 seconds]
DefV has joined #ruby
mahlon has quit [Ping timeout: 265 seconds]
boris has quit [Ping timeout: 265 seconds]
Rickmasta has quit [Ping timeout: 265 seconds]
vlad_starkov has quit [Ping timeout: 265 seconds]
Rylee_ has quit [Ping timeout: 265 seconds]
SegFaultAX_ is now known as SegFaultAX
MindfulMonk has quit [Ping timeout: 265 seconds]
phrozen77 has joined #ruby
Striki has quit [Ping timeout: 265 seconds]
sumark has quit [Ping timeout: 265 seconds]
LostDatagram has quit [Ping timeout: 265 seconds]
oddalot has quit [Ping timeout: 265 seconds]
supermat has quit [Ping timeout: 265 seconds]
mumblet is now known as mumblerit
ohcibi_ has joined #ruby
gazarsgo_ is now known as gazarsgo
GoodTimes has joined #ruby
sumark has joined #ruby
eguim_ has quit [Ping timeout: 265 seconds]
knigitz has quit [Ping timeout: 265 seconds]
Rylee_ has joined #ruby
mumblerit is now known as Guest79836
phoo1234567 has joined #ruby
LostDatagram has joined #ruby
Striki has joined #ruby
vlad_starkov has joined #ruby
eguim has joined #ruby
telling has quit [Ping timeout: 265 seconds]
dioms_ has quit [Ping timeout: 265 seconds]
knigitz has joined #ruby
dioms_ has joined #ruby
GreekFreak has joined #ruby
<GreekFreak>
hi all
boris has joined #ruby
thesheff17 has quit [Ping timeout: 265 seconds]
LiquidInsect has quit [Ping timeout: 265 seconds]
LiquidInsect has joined #ruby
DouweM has joined #ruby
Yoda- has quit [Ping timeout: 265 seconds]
<matti>
Hi
telling has joined #ruby
Rickmasta has joined #ruby
MindfulMonk has joined #ruby
ohcibi_ is now known as ohcibi
<GreekFreak>
I have the following line: ["bob", "jump"].any? { |term| "jump is high".downcase.include?(term) } This returns TRUE. .any? does an OR operation. Is there an equivalent method that does an AND operation so that my statement returns FALSE?
WillAmes has quit [Ping timeout: 265 seconds]
lele has quit [Ping timeout: 265 seconds]
DefV has quit [Ping timeout: 265 seconds]
[42] has quit [Ping timeout: 265 seconds]
jxport has quit [Ping timeout: 265 seconds]
DefV has joined #ruby
Yoda- has joined #ruby
toordog has quit [Ping timeout: 265 seconds]
jxport has joined #ruby
cnj has joined #ruby
antonishen has quit [Ping timeout: 265 seconds]
Dr3amc0dz has quit [Ping timeout: 252 seconds]
toordog has joined #ruby
forcefsck has joined #ruby
jinie has quit [Ping timeout: 265 seconds]
antonishen has joined #ruby
BizarreCake has quit [Ping timeout: 276 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<Hanmac1>
GreekFreak: "all?"
[42] has joined #ruby
Hanmac1 is now known as Hanmac
<DouweM>
GreekFreak: if the .any? method checks if the block is true for any element, what method would check if the block is true for all elements?
axilla has quit [Ping timeout: 265 seconds]
shenk has quit [Ping timeout: 265 seconds]
synfin has quit [Ping timeout: 265 seconds]
ejnahc has quit [Ping timeout: 265 seconds]
ejnahc has joined #ruby
synfin has joined #ruby
shvelo has joined #ruby
<GreekFreak>
Hanmac, oh wow!! I didn't even think of guessing that.
shvelo has quit [Changing host]
shvelo has joined #ruby
<GreekFreak>
Now I really feel small lol
axilla has joined #ruby
<GreekFreak>
thanks
benzrf|offline is now known as benzrf
shenk has joined #ruby
<GreekFreak>
DouweM, ya well. clearly I had a dumb moment and I obviously missed it in the API
Dr3amc0d3r|away has joined #ruby
<DouweM>
:)
Lingo__ has joined #ruby
charliesome has quit [Ping timeout: 265 seconds]
cout has quit [Ping timeout: 265 seconds]
jinie has joined #ruby
monkegjinni has joined #ruby
tiguser has quit [Ping timeout: 265 seconds]
lele has joined #ruby
cout has joined #ruby
bean has quit [Ping timeout: 265 seconds]
jtz has quit [Ping timeout: 265 seconds]
<GreekFreak>
DouweM, I'll console myself knowing that it happens to us all every once in a while lol
Xuerian has quit [Quit: No Ping reply in 180 seconds.]
LostDatagram has joined #ruby
csfrancis has quit [Ping timeout: 265 seconds]
aagdbl has joined #ruby
canton7 has quit [Ping timeout: 265 seconds]
aagdbl has quit [Changing host]
aagdbl has joined #ruby
ryotarai has quit [Ping timeout: 265 seconds]
canton7 has joined #ruby
ryotarai has joined #ruby
Xuerian has joined #ruby
phutchins has joined #ruby
krz has quit [Remote host closed the connection]
yubrew has quit [Ping timeout: 276 seconds]
riotjones has quit [Read error: Connection reset by peer]
riotjones has joined #ruby
lkba has quit [Ping timeout: 265 seconds]
mary5030 has joined #ruby
lkba has joined #ruby
<tobiasvl>
ignorant how?
<Hanmac>
adammcarth: hm it could be written better but what do you mean with "ignorant" ?
anaeem1_ has quit [Ping timeout: 265 seconds]
supermat has quit [Ping timeout: 265 seconds]
phrozen77 has joined #ruby
<adammcarth>
tobiasvl: Hanmac: It just seems like it's written poorly (like I'm not going about it the best way).
thesheff17 has quit [Ping timeout: 260 seconds]
phansch has quit [Quit: WeeChat 0.4.3]
LostDatagram has quit [Ping timeout: 265 seconds]
<adammcarth>
tobiasvl: Hanmac: Checking if `id`.is_a?(Integer), (Array), (Hash) or (Symbol) get's a bit ridiculous when it's repeated in up to 5 or 6 files... could something be put in a function to prevent code duplication?
banister has joined #ruby
banister has quit [Max SendQ exceeded]
tobago has joined #ruby
<Hanmac>
adammcarth: the " if id.is_a?(Hash)" should be replaced with a "case ... when ... ", and some ".each" methods should be replaced with ".map"
<adammcarth>
Is the purpose of using `case`...`when` to improve readability or are there some performance benefits?
<Hanmac>
both
SubSignal has joined #ruby
supermat has joined #ruby
sdouglas has joined #ruby
<adammcarth>
I need to read into cases more - I haven't really had much to do with it in the past
MissionCritical has joined #ruby
spider-mario has joined #ruby
cqql has quit [Ping timeout: 276 seconds]
<Hanmac>
adammcarth: and "method.to_sym == :first" might a problem when method is user-input
LostDatagram has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
whyy has quit [Ping timeout: 276 seconds]
SubSignal has quit [Ping timeout: 252 seconds]
sdouglas has quit [Ping timeout: 252 seconds]
mary5030 has quit [Ping timeout: 265 seconds]
paulfm has quit []
<adammcarth>
Hanmac: Why's that?
tobago has quit [Ping timeout: 265 seconds]
tobago has joined #ruby
kartouch has quit [Ping timeout: 265 seconds]
kartouch has joined #ruby
paulfm has joined #ruby
LostDatagram has quit [Ping timeout: 265 seconds]
lkba has quit [Ping timeout: 265 seconds]
fumduq has quit [Ping timeout: 265 seconds]
lkba has joined #ruby
supermat has quit [Ping timeout: 265 seconds]
monkegjinni has quit [Remote host closed the connection]
fumduq has joined #ruby
<Hanmac>
adammcarth: symbols cant be deleted ...
davidask has joined #ruby
tesuji has quit [Ping timeout: 240 seconds]
<DouweM>
adammcarth: meaning users can completely fill up your machine's memory by getting you to allocate as many symbols as they like, if you call user_input.to_sym
<adammcarth>
headius: DouweM: Woah.
<DouweM>
yeah
predator117 has quit [Ping timeout: 240 seconds]
predator117 has joined #ruby
Avahey_ has joined #ruby
banister has joined #ruby
phrozen77 has quit [Ping timeout: 265 seconds]
jcarouth has joined #ruby
Darryl has joined #ruby
<DouweM>
do you understand why this is the case, from what you know of symbols? it helps to understand a danger rather than just be aware of it
Zebroid has quit [Remote host closed the connection]
<adammcarth>
DouweM: Sorry I was just talking in the rails irc and got sidetracked
<DouweM>
np
<adammcarth>
DouweM: No I actually don't, why is it?
<adammcarth>
I'm a little shocked actually
Yoda- has quit [Ping timeout: 265 seconds]
himsin has quit [Quit: himsin]
canton7 has quit [Read error: Connection reset by peer]
Yoda- has joined #ruby
canton7 has joined #ruby
<DouweM>
well, the point of symbols is that a symbol by a specific name is only once in memory, so :whatever now and :whatever at any point in the future refer to the same memory, for the singleton :whatever. strings "whatever" and "whatever" *are* different objects, because they are mutable etc. This means that when a string is no longer needed, because (say) the method it's used in is finished, the string can just be removed from memory.
<DouweM>
but because the memory for symbol :whatever may be needed at any point in the future to be used when :whatever is used again, symbols can *never be deleted from memory*
Mattias has quit [Ping timeout: 245 seconds]
M-Technic has quit [Ping timeout: 265 seconds]
<DouweM>
so every symbol you use gets put into memory and will stay there for the duration of the program. so if your users can get you to build an infinite (or very large) number of symbols, by "a".to_sym, "b".to_sym etc, they can completely fill up your memory because all of those symbols need to be stored and can never be deleted
newUser1234 has joined #ruby
phrozen77 has joined #ruby
M-Technic has joined #ruby
<adammcarth>
DouweM: Nice explanation, thank you very much.
<adammcarth>
That's really interesting
<benzrf>
DouweM: not to mention, if you go over INT_MAX symbols, your program expload
<DouweM>
so what you should take away from this is that you should never make symbols out of user input
<DouweM>
benzrf: interesting didn't know that!
<benzrf>
well
<benzrf>
iirc
<DouweM>
benzrf: makes sense, and makes this even more dangerous
<adammcarth>
I only called .to_sym incase they specified the hash as a string "first" => 5 instead of :first => 5
<adammcarth>
so the better way to go about that would just be to use .to_s?
<DouweM>
yup. if you want to support both on the input side, use to_s and compare to a string
<DouweM>
but if you're sure it's only ever gonna be called by you, #to_sym can be fine too. just beware of the danger
<DouweM>
(called by you with your :first or "first", of course, not with any user's method)
GriffinH_ has joined #ruby
supermat has quit [Ping timeout: 265 seconds]
<adammcarth>
Yeah cool, gotcha
<adammcarth>
I take it you've been a rubyist a long time?
supermat has joined #ruby
bmurt has joined #ruby
<DouweM>
about 3 years now
newUser1234 has quit [Ping timeout: 240 seconds]
jrhe has joined #ruby
<DouweM>
but this is something you pick up pretty soon when you're in channels like these :P
GriffinHeart has quit [Ping timeout: 276 seconds]
hermanmunster has joined #ruby
Su7 has quit [Read error: Connection reset by peer]
Su7 has joined #ruby
<adammcarth>
Oh nice. I'm sure the intellect is very high here... I've only been programming for the better part of 3 months so I tend to shy away from this hahaha
merceris_ has quit [Read error: Connection reset by peer]
garndt has joined #ruby
mercerist has joined #ruby
<bmurt>
morning
<DouweM>
experience and knowledge more than intellect probably :P but by all means, stay around and you'll learn stuff like this
gregf has quit [Ping timeout: 265 seconds]
teddyp1cker has joined #ruby
<benzrf>
adammcarth: no worries m8
<benzrf>
adammcarth: its a question of experience far more than inherent knowledge
<benzrf>
assuming you have programming aptitude to begin with ;p
Asher has joined #ruby
yubrew has joined #ruby
<adammcarth>
html css and js got boring, what can I say
schaary has quit [Ping timeout: 260 seconds]
olleromo_ has quit [Ping timeout: 260 seconds]
merceris_ has joined #ruby
<benzrf>
adammcarth: ;)
<adammcarth>
off to computer science at uni next year though, should be fun
<benzrf>
coo
<DouweM>
if JS gets boring you're doing JS wrong, but for HTML and CSS and can see what you mean :P
<DouweM>
nice
<DouweM>
where are you goin?
mikepack has joined #ruby
<benzrf>
DouweM: if js gets boring it means that youre doing js
<benzrf>
oh snap
<adammcarth>
Trying for Melbourne University
<DouweM>
shad ahp benzrf, JS is not that bad :P
SubSignal has joined #ruby
<adammcarth>
hahaa - correction - JS got too messy and I couldn't be bothered learning backbone
mercerist has quit [Ping timeout: 240 seconds]
<benzrf>
adammcarth: anyway if u get overwhelmed by the seeming expertise of other programmers, just remember that you too could be there and the only difference is TIME
schaary|afk has joined #ruby
<DouweM>
hehe, JS without a framework isn't much
olleromo_ has joined #ruby
<benzrf>
adammcarth: i was violently reminded of this fact a while back when i started doing haskell
timonv_ has joined #ruby
<benzrf>
but now i too can figure out ELEGANT MONADIC SOLUTIONS
<benzrf>
:^D
Asher2 has quit [Ping timeout: 265 seconds]
phrozen77 has quit [Ping timeout: 265 seconds]
<benzrf>
adammcarth: it's all practice
<adammcarth>
benzrf: Got no idea what that means, but it sounds badass. Slap those solutions right on your resume
kalleth has quit [Ping timeout: 265 seconds]
timonv has quit [Remote host closed the connection]
kalleth has joined #ruby
jinie has quit [Ping timeout: 265 seconds]
LostDatagram has quit [Ping timeout: 265 seconds]
<DouweM>
benzrf is like the religious guy on the market place yelling about repentence. but with haskell
<ddv>
compare a backbone model with a ruby model, js is very verbose
<benzrf>
;)
<adammcarth>
verbose, anyone?
LostDatagram has joined #ruby
jinie has joined #ruby
yalue has joined #ruby
noocode has quit [Ping timeout: 265 seconds]
jrhe has quit [Ping timeout: 265 seconds]
ocher has quit [Ping timeout: 260 seconds]
mikepack has quit [Ping timeout: 245 seconds]
<DouweM>
adammcarth: either way, Ruby is good choice for a language to learn after basic web dev :)
yubrew has quit [Ping timeout: 264 seconds]
<DouweM>
wish I'd started with Ruby rather than PHP
Darryl has quit [Ping timeout: 260 seconds]
mostlybadfly has quit [Ping timeout: 260 seconds]
dioms_ has quit [Ping timeout: 260 seconds]
SegFaultAX has quit [Ping timeout: 260 seconds]
dnyy has quit [Ping timeout: 245 seconds]
im0b has quit [Ping timeout: 245 seconds]
Liothen has quit [Ping timeout: 245 seconds]
relix has joined #ruby
<adammcarth>
I tried php for a month
Yoda- has quit [Ping timeout: 265 seconds]
metadave has quit [Ping timeout: 245 seconds]
<adammcarth>
hated sql
<adammcarth>
so I moved onto cakephp
<adammcarth>
which wasn't actually that bad
<DouweM>
that's hardly PHP's fault
dioms_ has joined #ruby
<adammcarth>
CakePHP is strikingly similar to rails
timonv_ has quit [Ping timeout: 245 seconds]
<adammcarth>
but I fell in love with Sinatra
sambao21 has joined #ruby
mostlybadfly has joined #ruby
im0b has joined #ruby
Darryl has joined #ruby
metadave has joined #ruby
blaxter has quit [Ping timeout: 276 seconds]
dnyy has joined #ruby
<adammcarth>
(the dsl not the actual guy, although I hear he has a nice voice)
<DouweM>
hehe
Takle has quit [Remote host closed the connection]
SegFaultAX has joined #ruby
Liothen has joined #ruby
noocode has joined #ruby
alex88 has joined #ruby
Yoda- has joined #ruby
jinie has quit [Ping timeout: 265 seconds]
jrhe has joined #ruby
<benzrf>
php is a clusterfuck of awful
teddyp1cker has quit []
LostDatagram has quit [Ping timeout: 265 seconds]
catepillar has quit [Ping timeout: 265 seconds]
<benzrf>
centrx is not here q.q
jinie has joined #ruby
<bmurt>
if you guys are loading a yaml into a ruby CLI for configuration settings, would you put that into its own method?
anaeem1_ has quit [Remote host closed the connection]
<DouweM>
bmurt: sure
<bmurt>
i think im running into a scope issue, but i haven't found a complete walkthrough online covering that aspect
wald0 has joined #ruby
catepillar has joined #ruby
<adammcarth>
I hear charlie somerville gives a good talk on why php sucks so bad
<adammcarth>
ironic how he made his website favicon the php logo
emsilva has quit [Quit: Keep Walking (Computer Slept!)]
Zenigor has joined #ruby
sinkensa_ has joined #ruby
<benzrf>
horrror: you want ``
amargherio has joined #ruby
<benzrf>
but use a ruby library!
sinkensabe has quit [Remote host closed the connection]
<benzrf>
shelling out is for perlists
sk87 has quit [Client Quit]
<GeorgesLeYeti>
Ok but still same problem. i made text.each_line{ |line| line.lstrip! }
<GeorgesLeYeti>
seam to work when i print each line but text stay the same
<horrror>
benzrf: where to put `` ?
chipotle has quit [Ping timeout: 240 seconds]
ehc has joined #ruby
<benzrf>
horrror: don't
<benzrf>
use a reaaalll library
<GeorgesLeYeti>
horrror: i'm using Faraday
<horrror>
i tried but i have trouble setting header 'Content-Type: audio/x-flac; rate=16000;'
hermanmunster has quit [Remote host closed the connection]
oo_ has joined #ruby
hermanmunster has joined #ruby
sinkensa_ has quit [Ping timeout: 264 seconds]
<horrror>
and post audio file
TheKruex has quit []
chipotle has joined #ruby
cocotton has quit [Remote host closed the connection]
metasyntax has joined #ruby
tkuchiki has joined #ruby
hermanmunster has quit [Read error: No route to host]
hermanmunster has joined #ruby
Zenigor_ has joined #ruby
Rahul_Roy has quit [Quit: Connection closed for inactivity]
enebo has joined #ruby
sdouglas has joined #ruby
Zenigor has quit [Ping timeout: 245 seconds]
beef-wellington has joined #ruby
cpruitt has joined #ruby
kaspergrubbe has joined #ruby
Zebroid has quit [Remote host closed the connection]
krz has joined #ruby
sdouglas has quit [Ping timeout: 240 seconds]
taybin has quit [Quit: This computer has gone to sleep]
yacks has quit [Ping timeout: 276 seconds]
<jheg>
o/
<jheg>
struggling to understand the logic of this ...
freerobby has joined #ruby
Alina-malina has quit [Read error: Connection reset by peer]
<jheg>
arr = [["b", 1],["c", 2],["d", 3]]
asteve has joined #ruby
<jheg>
and I want to delete 1 from the first array
<jheg>
I'd do this
Alina-malina has joined #ruby
<jheg>
arr.first.delete(arr.first.last)
<jheg>
right?
<horrror>
this is weird. i'm posting to http and first i receive {results: []} and after few seconds i get another { results: ["boa blablbal", "lblablbla"] }. the http response catches only the first one. How can I handle the second one?
<jheg>
what I don't understand is that the first part of that selects the first array in arr so why in the delete argument am I having to select the first array in are again?
<DouweM>
horrror: what do you mean your first receive X and then Y? you send one request and the server sends two responses?
sinkensabe has joined #ruby
<jheg>
arr.first.delete selects the array ["b",1]
<horrror>
DouweM: yes , so it seems
yfeldblum has joined #ruby
lemur has joined #ruby
<DouweM>
horrror: that makes no sense. what URL is this you're posting to?
<DouweM>
jheg: right
Takle has quit [Remote host closed the connection]
<jheg>
so I would have though that I then only need to select the element index as the argument like are.last
marr has joined #ruby
bradhe has joined #ruby
<jheg>
but I need to select that element by arr.first.last
<DouweM>
jheg: you can do arr.first.pop
<DouweM>
jheg: why would arr.last be enough? arr.last is ["c",3]
<DouweM>
jheg: you don't want to delete _that_ from arr.first which is ["a",1]
<jheg>
but as the argument of arr.first.delete() I am in the first array right?
cocotton has joined #ruby
<DouweM>
you want to get at the last item in ["a",1] so arr.first.last
cocotton has quit [Remote host closed the connection]
<DouweM>
jheg: you're not suddenly anywhere, you're still in the same scope you were before
<DouweM>
you're just calling a method on arr.first
cocotton has joined #ruby
mikesplain has joined #ruby
<jheg>
yeah so arr.first.delete(arr.first.last) is correct?
<DouweM>
would work, but arr.first.pop is probably better
<jheg>
but am I right in thinking arr.delete(arr.first.last) would make more sense than arr.first.delete(are.first.last)?
tobago has quit [Remote host closed the connection]
<jheg>
it just seems to me that the first method on the first part of that is redundant
oponder has joined #ruby
hakunin_ is now known as hakunin
yfeldblum has quit [Ping timeout: 240 seconds]
Squarepy has joined #ruby
diegoviola has quit [Remote host closed the connection]
<DouweM>
you're wrong, you want to delete something from ["a",1], not from the entire arr. so of course you need arr.first to get at that ["a", 1] at all
Takle has joined #ruby
<DouweM>
then you can do with that array whatever you want, which is delete the 1
<DouweM>
how to get at the 1? first get at the ["a", 1], then get at the 1, so arr.first and then arr.first.last
bradhe has quit [Ping timeout: 245 seconds]
<DouweM>
the way it works makes perfect sense, I think you misunderstand scope
RaCx has joined #ruby
<jheg>
yes I think I have misunderstood something because its seems to me that I am twice selecting the first array
s3ri0us has joined #ruby
xjiujiu has joined #ruby
<DouweM>
of course you are
<jheg>
in part one arr.first and in part two arr.first.la.......
<DouweM>
right
Alina-malina has quit [Ping timeout: 240 seconds]
GoodTimes has quit [Ping timeout: 252 seconds]
Rollabunna has joined #ruby
<DouweM>
you need to get at the first array twice, once because you need to get the entire thing, and then again when you want to get its last element
<DouweM>
would it make more sense to you if you assigned arr.first to a variable firs?
failshell has joined #ruby
<DouweM>
like first_array = arr.first, and then first_array.delete(first_array.last0
LnL_ is now known as LnL
<jheg>
See what you mean yes it would :)
bluOxigen has joined #ruby
yubrew has joined #ruby
<DouweM>
arr.first and first_array are equivalent, so they should make equal sense to you :)
<jheg>
I suppose that I just thought that once you have selected the array you want to manipulate arr.first.delete then you would just be able to specify the index of the element to be deleted
<jheg>
know what I mean?
<DouweM>
oh you definitely can, but that's not what you were doing with #delete ;)
taybin has joined #ruby
<jheg>
oh dear i sense a whole new level of confusion coming up
<DouweM>
right now you're specifying the element you want to destroy, not its index. to get at the index you need arr.first.last
jobewan has joined #ruby
<DouweM>
if you know it's at index 1, you can do arr.first.delete_at(1)
freezey has joined #ruby
<jheg>
oh good :)
Avahey_ has quit [Quit: Connection closed for inactivity]
<jheg>
thank you DouweM
jprovazn is now known as jprovazn_afk
Burgestrand has quit [Quit: Burgestrand]
Jalada has joined #ruby
tagrudev has quit [Remote host closed the connection]
freezey has quit [Read error: Connection reset by peer]
<Jalada>
Is it possible for an exception's backtrace to be nil?
freezey has joined #ruby
eka has joined #ruby
JBreit has left #ruby ["Leaving"]
RaCx has quit [Read error: Connection reset by peer]
gruz0[russia] has quit [Quit: This computer has gone to sleep]
pietr0 has joined #ruby
originalpete__ has joined #ruby
<Mon_Ouie>
Yes, but raising the exception will set its backtrace to an actual array of strings
<Jalada>
ok
ahofmann has joined #ruby
<Jalada>
makes sense
VinceThePrince has quit [Ping timeout: 252 seconds]
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
poguez_ has joined #ruby
xjiujiu has joined #ruby
chipotle has quit [Ping timeout: 240 seconds]
RaCx has joined #ruby
Bira has joined #ruby
panzi has joined #ruby
panzi has quit [Client Quit]
chipotle has joined #ruby
cina has quit [Ping timeout: 245 seconds]
ari-_-e has quit [Quit: Leaving]
b1205 has joined #ruby
benzrf is now known as benzrf|offline
robertodecurnex has quit [Excess Flood]
rippa has joined #ruby
Yoda- has quit [Quit: Bouncer either died or restarting.]
blinkdesign has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
blinkdesign has joined #ruby
robertodecurnex has joined #ruby
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
scx_ is now known as scx
Takle has quit [Remote host closed the connection]
xjiujiu has joined #ruby
blinkdes_ has joined #ruby
shredding has joined #ruby
blinkdesign has quit [Read error: Connection reset by peer]
Zenigor_ has quit [Remote host closed the connection]
arrubin has joined #ruby
Zenigor has joined #ruby
monkegjinni has joined #ruby
shime has quit [Ping timeout: 252 seconds]
Eyes has quit [Quit: Leaving]
Eyes has joined #ruby
mikepack has joined #ruby
taybin has quit [Quit: This computer has gone to sleep]
codabrin_ has joined #ruby
SCommette has joined #ruby
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
codabrink has quit [Ping timeout: 260 seconds]
xjiujiu has joined #ruby
tungd has joined #ruby
blackmesa has joined #ruby
pietr0 has quit [Quit: pietr0]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cpruitt has quit [Quit: cpruitt]
treehug88 has joined #ruby
cephalostrum has quit [Ping timeout: 252 seconds]
larsam has joined #ruby
sk87 has joined #ruby
mikepack has quit [Ping timeout: 264 seconds]
ahofmann has quit [Quit: Computer has gone to sleep.]
tier has joined #ruby
ixti has joined #ruby
cephalostrum has joined #ruby
whyy has joined #ruby
Ningen_UA has quit [Ping timeout: 276 seconds]
cpruitt has joined #ruby
Guest88881 is now known as C0deMaver1ck
dik_dak has joined #ruby
kies has quit [Ping timeout: 245 seconds]
<hfp>
Hey guys, I'm trying to write a snippet that would take today's date and calculate when was 100 days ago. But I would like to skip weekends in my count. How would you go about it?
<arrubin>
How accurate must it be?
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
kies has joined #ruby
<Sigma00>
multiply the number your user gives you by 7/5 then substract that from the date
xjiujiu has joined #ruby
<olivier_bK>
i try to parse a html file with nokogiri i can get the tite of file but i cant rescue any data i try to parse a multiple div
<bmurt>
i have my config.yaml that gets loaded to a variable called 'config'. so i have: configatron.configure_from_hash(config) but im unsure how to reference using configatron's syntax
mikepack has joined #ruby
<bmurt>
the output from 'puts configatron.inspect' is: configatron.mail = [{"smtp_server"=>"mail.domain.us"}, {"username"=>"brendan@domain.us"}, {"password"=>"password123"}, {"port"=>25}, {"use_ttls"=>false}, {"use_ssl"=>false}, {"enable_auto_ttls"=>false}, {"openssl_verify_mode"=>"none"}]
<bmurt>
i was really trying to find out in the example on the github page, how they had the hash/yaml formatted
ffranz has joined #ruby
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
stantona has joined #ruby
<Sigma00>
!gist
<helpa>
http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
<Sigma00>
and this is why native ruby image gems don't usually make it: OilyPNG is a drop in mixin module that implements some of the ChunkyPNG algorithms in C, which provides a massive speed boost to encoding and decoding.
* Sigma00
chuckles
<banister>
Sigma00 how does that follow
subraminion has joined #ruby
Alina-malina has joined #ruby
<Sigma00>
"here, have a native gem that's slow, and a module to make it non-native but much faster"
<banister>
Sigma00 well of course ruby would be bad at something like image manip :)
freerobby has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
Takle has joined #ruby
chipotle has quit [Ping timeout: 272 seconds]
<Sigma00>
yes, that's exactly what I'm saying
b00stfr3ak has joined #ruby
diegoviola has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
paulfm has joined #ruby
Tuor has quit [Quit: Leaving]
maestrojed has joined #ruby
mania has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
binaryhat has joined #ruby
b1205 has quit [Ping timeout: 272 seconds]
sambao21 has joined #ruby
happytux has quit [Read error: Connection reset by peer]
mordof has left #ruby [#ruby]
yacks has joined #ruby
Takle has quit [Remote host closed the connection]
happytux_ has joined #ruby
RaCx has quit [Ping timeout: 245 seconds]
zarubin has quit []
RaCx has joined #ruby
mania has quit [Ping timeout: 264 seconds]
lewix has joined #ruby
Takle has joined #ruby
happytux_ is now known as happytux
havenwood has quit [Remote host closed the connection]
niharvey is now known as niharvey|out
forcefsck has quit [Ping timeout: 252 seconds]
georgschlenkhoff has left #ruby ["Bye, bye"]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
karmatr0_ has quit [Remote host closed the connection]
wldcordeiro has quit [Read error: Connection reset by peer]
georgschlenkhoff has joined #ruby
noop has quit [Ping timeout: 276 seconds]
norm has joined #ruby
georgschlenkhoff has left #ruby ["Bye, bye"]
norm has left #ruby [#ruby]
dawkirst has joined #ruby
b1205 has joined #ruby
yubrew_ has joined #ruby
almostwhitehat has quit [Quit: almostwhitehat]
sdouglas has joined #ruby
snath has joined #ruby
kireevco has joined #ruby
yubrew__ has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
benzrf|offline is now known as benzrf
qba73 has quit [Remote host closed the connection]
lolmaus has quit [Ping timeout: 245 seconds]
yubrew_ has quit [Ping timeout: 272 seconds]
lolmaus has joined #ruby
binaryhat has quit [Quit: Leaving]
GoodTimes has joined #ruby
havenwood has joined #ruby
Wolland has joined #ruby
railzFor_ has quit [Ping timeout: 260 seconds]
lord4163 has left #ruby [#ruby]
sambao21 has quit [Quit: Computer has gone to sleep.]
newUser1234 has joined #ruby
Valesk has joined #ruby
sambao21 has joined #ruby
railzForDaiz has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
havenwood has quit [Remote host closed the connection]
bradhe has joined #ruby
Valesk has quit [Client Quit]
Spami has quit [Quit: This computer has gone to sleep]
jxf has joined #ruby
JohnBat26 has quit [Ping timeout: 276 seconds]
horrror has quit [Quit: horrror]
RaCx has quit [Ping timeout: 240 seconds]
havenwood has joined #ruby
codeurge has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
timonv has quit [Remote host closed the connection]
RaCx has joined #ruby
larsam has quit [Quit: larsam]
bradhe has quit [Ping timeout: 245 seconds]
sputnik13 has joined #ruby
cocotton has quit [Remote host closed the connection]
bluenemo has quit [Remote host closed the connection]
cocotton has joined #ruby
freezey has quit [Remote host closed the connection]
cocotton has quit [Remote host closed the connection]
jheg has quit [Quit: jheg]
<happytux>
I solved the rspec issue by downgrading. I hope they will solve the issue with the next release.
<happytux>
I hate those nasty suprises.
yfeldblum has joined #ruby
cocotton has joined #ruby
Morkel has quit [Quit: Morkel]
Alina-malina has quit [Ping timeout: 272 seconds]
i_s has joined #ruby
marr has quit [Ping timeout: 264 seconds]
forcefsck has joined #ruby
mania has joined #ruby
aspires has joined #ruby
wldcordeiro has joined #ruby
forcefsck is now known as chth0n
benzrf is now known as benzrf|offline
wallerdev has joined #ruby
deric_skibotn has joined #ruby
sailias has quit [Quit: Leaving.]
zB0hs has joined #ruby
redondos has quit [Excess Flood]
redondos has joined #ruby
redondos has joined #ruby
redondos has quit [Changing host]
tungd has quit [Ping timeout: 240 seconds]
troyready has joined #ruby
alex88 has quit [Quit: Leaving...]
arya_ has joined #ruby
taybin has joined #ruby
vaicine has left #ruby [#ruby]
marr has joined #ruby
lyanchih has quit [Ping timeout: 240 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
wjimenez5271 has joined #ruby
originalpete__ has left #ruby [#ruby]
sski has quit [Remote host closed the connection]
lkba has joined #ruby
sski has joined #ruby
IcyDragon has joined #ruby
Atrumx has joined #ruby
IceDragon has quit [Ping timeout: 240 seconds]
tacit7 has joined #ruby
stantona has quit [Remote host closed the connection]
hpoydar has quit [Remote host closed the connection]
yetanotherdave has joined #ruby
Zenigor has quit [Remote host closed the connection]
<bmurt>
i wish there was more detail as to why the connection was refused
<canton7>
the other side wasn't listening - you tried to connect to a port, and there wasn't anything to accept the connection
<canton7>
that's literally that ruby knows - it's all that TCP will tell you
<canton7>
*all that ruby knows
bthesorceror has quit [Quit: bthesorceror]
bthesorceror has joined #ruby
<bmurt>
i think its a bug with the mail gem and instance variables. if i hard code the values, boom roasted & we're good. i'm even outputitng the variables prior to being used the Mail's code block and they're present
hpoydar has joined #ruby
stantona has joined #ruby
<bmurt>
its using my smtp server on my 2nd vps, but the request doesn't get that far
<bmurt>
i can telnet from the origination point via 25 as well without issue
<bmurt>
canton7: in 5mins, alerady fixed using pony
<canton7>
bmurt, good good!
<bmurt>
not changing the instance variables ,etc
<bmurt>
that gem has some issues :/
klaut has quit [Remote host closed the connection]
bradleyprice has joined #ruby
<canton7>
:P
<mozzarella>
so, is there a lib for that?
<jhass>
mozzarella: didn't I just show you?
SCommette has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
mikecmpbll has joined #ruby
obs_ has quit [Remote host closed the connection]
<canton7>
mozzarella, a double will give you about 13 decimal places. you can convert that to a string, and specify exactly how many digits you want to display, using methods like the one jhass showed
RaCx has joined #ruby
krz has joined #ruby
<canton7>
if you want more than 13 digits, BigDecimal is your friend
<mozzarella>
no I want high precision
<canton7>
(or Rational)
<mozzarella>
you're just displaying garbage after the 333's
fresham has joined #ruby
jheg has joined #ruby
<mozzarella>
canton7: can you show me how to do it?
hpoydar has quit [Remote host closed the connection]
combusean has joined #ruby
<canton7>
anyway, I am off. you'll have to read the docs from now on yourself ;)
<mozzarella>
no, it doesn't work
tkuchiki has quit [Remote host closed the connection]
<mozzarella>
only the .div does
ffranz has quit [Ping timeout: 245 seconds]
<canton7>
oh for fuck's sake. #div DOES work. I just showed you
<mozzarella>
yeah
<canton7>
#/ does do arbitrary precision, I JUST told you
<canton7>
*doesn't, sorry
<mozzarella>
oh
Avahey_ has joined #ruby
<canton7>
<canton7> yes. '/ 3' is the same as .div(3,
blackmesa has joined #ruby
<mozzarella>
what an ill-conceived library
centrx has joined #ruby
<canton7>
complain to the devs if you want
<canton7>
I'm sure they had their reasons
benzrf|offline is now known as benzrf
<mozzarella>
I will
<canton7>
please let me know how it goes :D
<mozzarella>
thank you
<mozzarella>
for the help
fauzanqadri has quit [Remote host closed the connection]
SCommette has quit [Quit: SCommette]
<benzrf>
RubyPanther: somebody with that name commented on a post saying that their friend described FP as 'an unnatural act'
anarang has quit [Quit: Leaving]
monkegjinni has quit [Ping timeout: 252 seconds]
Eiam has quit [Ping timeout: 260 seconds]
sambao21 has joined #ruby
<centrx>
PHP is an unnatural act
treehug88 has quit [Ping timeout: 240 seconds]
fauzanqadri has joined #ruby
mercerist has joined #ruby
Rollabunna has quit [Remote host closed the connection]
combusean has quit [Quit: Leaving.]
andrewjanssen has quit [Quit: Leaving...]
acrussell has left #ruby [#ruby]
lw has joined #ruby
blackmesa has quit [Ping timeout: 245 seconds]
Uranio has joined #ruby
sambao21 has quit [Ping timeout: 252 seconds]
mu5k17u has joined #ruby
djbkd has quit [Remote host closed the connection]
combusean has joined #ruby
mijicd has joined #ruby
codeurge has joined #ruby
lkba has quit [Ping timeout: 245 seconds]
combusean has quit [Client Quit]
oo_ has quit [Remote host closed the connection]
ndrei has joined #ruby
sambao21 has joined #ruby
andrewjanssen has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
CodeBunny has quit [Ping timeout: 245 seconds]
ffranz has joined #ruby
hpoydar has joined #ruby
fauzanqadri has quit [Remote host closed the connection]
taybin has quit [Quit: This computer has gone to sleep]
nmokru has joined #ruby
hpoydar has quit [Remote host closed the connection]
<shevy>
IT IS SO DAMN HOT
Uranio has quit [Ping timeout: 264 seconds]
<centrx>
saucy
* mozzarella
licks his own nipple
hpoydar has joined #ruby
<mozzarella>
I know, right?
enebo has joined #ruby
Gil_ has quit [Remote host closed the connection]
freezey has joined #ruby
jheg has quit [Quit: jheg]
djbkd has joined #ruby
kidoz has joined #ruby
joaoh82 has joined #ruby
<happytux>
shevy: The link I gave you?
chth0n has quit [Ping timeout: 272 seconds]
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
<DouweM>
mozzarella: :|
Squarepy has quit [Quit: Leaving]
aspires has quit []
andrewjanssen has quit [Remote host closed the connection]
pvb has joined #ruby
ixti has quit [Ping timeout: 264 seconds]
postmodern has joined #ruby
ringarin has joined #ruby
BizarreCake has joined #ruby
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
almostwhitehat has quit [Quit: almostwhitehat]
<gomikemike>
[A
<Sigma00>
[B
<gomikemike>
oops
cjsarette has quit [Remote host closed the connection]
<gomikemike>
so, i asked a question and had to go to a meeting... will re-ask it
<gomikemike>
hello, is there a way to check the value of the env variable http_proxy from a ruby script?
cjsarette has joined #ruby
Squarepy has joined #ruby
<gomikemike>
i have a script that needs the proxy, so i set the env variable in the script and un-set it on the last line of the script but some servers already have the env variable set, so i would be leaving it unset
<gomikemike>
I would like to check what the value is and if empty, set it and un-set it after the script is done
<gomikemike>
if its set, then leave it as is
djbkd has quit [Remote host closed the connection]
<centrx>
ENV has environment vars
<centrx>
it acts like a hash
glenfe has joined #ruby
glenfe has left #ruby ["Leaving"]
tier has quit [Remote host closed the connection]
<pvb>
ENV["HTTP_PROXY"] ?
<centrx>
yes
b1205 has quit [Ping timeout: 240 seconds]
<centrx>
something like that
Azulinho has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
<bmurt>
canton7: another funny regarding pony & mail... pony has a dependency on mail :/
<happytux>
shevy: it can pull and package all dependency gems
sputnik13 has quit [Client Quit]
<shevy>
happytux for bundler as far as I know, they remain separate projects and you need to write a file
b1205 has joined #ruby
sputnik13 has joined #ruby
skaflem has joined #ruby
<happytux>
shevy: hm, you want to kind link the dependencies?
<happytux>
shevy: bundler will put them into vendor directory
nanoyak has joined #ruby
<shevy>
happytux can I bundle without having to write anything? such as "bundle remote project foo for me"?
cocotton has joined #ruby
cocotton has quit [Remote host closed the connection]
SBoolean has joined #ruby
nanoyak has quit [Client Quit]
MZAWeb has quit [Ping timeout: 264 seconds]
cocotton has joined #ruby
codeurge has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
noop has joined #ruby
Mattias has joined #ruby
<shevy>
the whole point is to end up with a single .gem with everything inside and without having to write anything other than the command to give the URL
bradhe has joined #ruby
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<happytux>
shevy: hm, you want to package your project as gem anyway. So you could add vendor/ to it.
codeurge has joined #ruby
tsunamie has quit [Ping timeout: 260 seconds]
minecoins has quit [Ping timeout: 264 seconds]
<shevy>
well a .gem is like most other archives
cwc has quit [Ping timeout: 240 seconds]
rs0 has quit [Ping timeout: 264 seconds]
mozzarella has quit [Ping timeout: 240 seconds]
<shevy>
I need to ensure that a given snapshot works and that a user won't have to download anything else other than that single archive ever
momomomomo has joined #ruby
sdouglas has quit [Remote host closed the connection]
<happytux>
shevy: bundler can also store the cache locally in project directory
cwc has joined #ruby
zB0hs has joined #ruby
nanoyak has joined #ruby
<shevy>
and you then end up with a single .gem that has all dependencies inside?
rs0 has joined #ruby
<benzrf>
> It's a mindset change. I wish I'd known this earlier as it would've saved me frustration and doubt, but you kind of need to unlearn what you think you know about coding, then go back to the basics. Imagine you've driven trains for decades, and spontaneously decide you want to be a pilot. No, you can't just read a plane manual in the morning and be in Tokyo in the afternoon. No, if you grab a
<benzrf>
beer with experienced pilots you won't be able to talk about aviation at their level. It's normal, right? Be patient, learn the basics, have fun, you'll get there.
<benzrf>
i like this metaphor
<happytux>
shevy: yes
minecoins has joined #ruby
dawkirst has joined #ruby
<happytux>
shevy: either by dumping the bundler cache or the vendor gems directly
<shevy>
hmm
Neomex has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
mjsmith2 has quit []
Zenigor has quit [Ping timeout: 272 seconds]
<shevy>
I hate this heat wave :(
kaspergrubbe has quit [Remote host closed the connection]
<happytux>
shevy: yes
Takle has quit [Remote host closed the connection]
MZAWeb has joined #ruby
<happytux>
shevy: you are in europe, too?
<shevy>
yeah
<shevy>
happytux what is the peak temperature currently at your place?
<shevy>
we have been at +35°C already
<wallerdev>
brr
<shevy>
although the forecast says it'll cool down slowly in the coming days
tsunamie has joined #ruby
kirun has joined #ruby
Gil_ has joined #ruby
mjsmith2 has joined #ruby
tier has joined #ruby
<happytux>
shevy: well, I am lucky :) Today it heavily rained. Yesterday it was about 38°C, yes
<shevy>
ack
kenneth has joined #ruby
<shevy>
how can you even sit before a computer with such a temperature
<hoelzro>
benzrf: I'm saying that the presence of prototypical OOP doesn't imply functional programming facilities in a language
<hoelzro>
and the converse as well
<Rubyist>
shevy: ^
<shevy>
hmm
<benzrf>
hoelzro: oops mistabbed
<RubyPanther>
happytux: It means breaking down everything into formulas that carry their state around. so you have no variables, or methods. Instead of a method that can be called by name, you have to bundle the method into each call
<benzrf>
i meant that @ happytux
<shevy>
well you'll have to catch the index Rubyist
<happytux>
RubyPanther: Is this something new? When I read articles about it, these concepts are about 30 or more years old.
<Rubyist>
shevy: Trying to clean up a params hash in rails
<benzrf>
happytux: FP has been around a while
<Sigma00>
er, maybe I should have puts a
<Rubyist>
Think this is the right way to go?
<RubyPanther>
benzrf: Well, I focused on what it is supposed to be. What it really is is a bunch of lies to hide the fact that FP is only useful for tiny programs. Real programs that claim to use it, spend the whole time creating fake state, and masking their side effects
<benzrf>
happytux: FP is in contrast to imperative, not in contrast to OOP
Mattias has joined #ruby
<Sigma00>
>> a= {}; [1,2,3].each_with_index {|i,o| a[i]=o }; puts a
<shevy>
Rubyist if it solves your problem, sure; I have no idea what hash you need, but you could always write a method that guarantees to you that the creating hash is working
<centrx>
There is nothing new
<shevy>
Rubyist, look at Sigma00's code
<centrx>
Everything is from 30+ years ago
lewix has quit [Ping timeout: 245 seconds]
<shevy>
centrx not everything! parallel computing!!!
<happytux>
RubyPanther: :)
<RubyPanther>
You basically pretend each function is a page of papyrus, and you're not allowed to refer to anything not proven in formulas on the same page
sputnik13 has joined #ruby
<shevy>
lol
<happytux>
RubyPanther: But LISP and friends are quite mature.
<shevy>
I have fond memories of (L(I(S(P
<RubyPanther>
LISP is quite mature, stable, and unused. Yes.
<jhass>
Rubyist: what do you mean by cleanup? what's the benefit of having a hash like that? you can access an array by index just fine
<happytux>
RubyPanther: What Functional Programming language came out just recently?
<happytux>
RubyPanther: Go?
<shevy>
after 100 years of its existance, (L(I(S(P should be mature
lewix has joined #ruby
lewix has quit [Changing host]
lewix has joined #ruby
<RubyPanther>
I can make my way around a ~/.emacs script, but "nobody" wants to use LISP for an app.
<shevy>
happytux some apple language!
<shevy>
btw those new languages have awful names
<shevy>
go ... swift ...
robertodecurnex has quit [Ping timeout: 264 seconds]
<happytux>
shevy: How is it called? The IDE thing from this year Apple Conference?
<shevy>
what's next? turf?
<happytux>
ah
SBoolean has quit [Ping timeout: 252 seconds]
<shevy>
IDE?
<Rubyist>
jhass: One of activerecord's methods only takes a hash in certain format for update operation on child records
<shevy>
it has an IDE?
nanoyak has quit [Read error: Connection reset by peer]
<RubyPanther>
Even emacs is written in C. Lisp is just used as the extension language; it does do pretty good at that. That is where you don't really want state, you just want lightweight filters
<happytux>
So those languages are used for Build systems, right?
<shevy>
dunno
<shevy>
perhaps apple hates obj-c
<shevy>
and wants to leave it
<happytux>
hm, so there are advantages and downsides for both worlds.
<jhass>
Rubyist: so you got field names like '0', '1' etc?
nanoyak has joined #ruby
kilk_ has joined #ruby
<happytux>
So for what one can't use Functional Programming without resorting to pain and overkill?
<shevy>
to be honest, I don't understand why they just don't want to use languages like ruby or python
jkline has joined #ruby
<RubyPanther>
Apple just needs a dynamic language, for places where that is wanted.
<shevy>
but we have dynamic languages already!
<RubyPanther>
They're addicted to control
<shevy>
yeah
<shevy>
that is a much better explanation
<shevy>
wasn't there hypercard once?
<RubyPanther>
Go, OTOH, it designed to be a compiled language that is similar to dynamic languages, but easier to optimize inside a VM or other container
<RubyPanther>
It was like PDF, but with an IDE that made heavy use of the linking feature. Like the web, but with layout built in
adantj has quit [Ping timeout: 272 seconds]
<jhass>
Rubyist: time to explain what you're actually doing ;)
almostwhitehat has quit [Quit: almostwhitehat]
robertodecurnex has joined #ruby
<RubyPanther>
benzrf: People get jealous of me for lots of reasons, my regularity is just one of them. Sorry for your problem. I recommend eating more fruit.
net_mask has joined #ruby
ringarin has quit [Quit: Leaving]
<benzrf>
RubyPanther: lol
Spami has joined #ruby
SBoolean has joined #ruby
<happytux>
OK, so for what FP can/should be used and for what should I rather use IP?
<happytux>
I ask because I am thinking about investing some time in learning a FP language.
bthesorceror has joined #ruby
<shevy>
nobody realls knows
<happytux>
I need to know what language would be good to learn and for what I can use it, practically.
<shevy>
*really
<shevy>
we have ruby
<shevy>
and C
<shevy>
that's like python
joaoh82 has quit [Remote host closed the connection]
<shevy>
and C++
<shevy>
or Java
<shevy>
and perl
<shevy>
:D
dukedave has joined #ruby
eka has quit [Read error: Connection reset by peer]
<jsaak>
it is always good to know languages, learn a FP too, you will see how practical it will be for you
<shevy>
yeah
<shevy>
always good to learn
<shevy>
php
<dukedave>
Is there something like Enumerable#chunk, but which yields pairs of elements and expects true/false if they belong in the same/different chunk?
nmokru has quit [Quit: nmokru]
eka has joined #ruby
phantasm66 has joined #ruby
ixti has quit [Ping timeout: 252 seconds]
<RubyPanther>
happytux: You do need to learn one, though you hopefully won't need to use it. ;) I recommend Scheme, it is similar to Lisp, but simpler
<RubyPanther>
Scheme is popular as an extension language so it is sometimes useful
<jhass>
dukedave: no, but maybe there's a (nice) solution to your real problem
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<Mon_Ouie>
dukedave: You don't mean like #partition, right?
razrunelord has joined #ruby
<dukedave>
Mon_Ouie, no, it's a 'chunking' operation, rather than just a Boolean partition :/
Xeago has quit [Read error: Connection reset by peer]
Rubyist is now known as Meatchicken
<centrx>
enum.chunk(2).partition ?
<dukedave>
jhass, I was just going to roll a reduce if not?
Xeago has joined #ruby
rezzack has quit [Quit: Leaving.]
SBoolean has quit [Ping timeout: 252 seconds]
<centrx>
dukedave, enum.chunk(2).partition
<centrx>
dukedave, enum.chunk(2) returns a chainable enumerator
<dukedave>
That's how I'd write it as a reduction, the point being I can compare obj and curr.last, to decide if they belong in the same chunk (in this case if they're within 5 of each other)
sambao21 has joined #ruby
<cocotton>
Hey all, is there a way to tell $stdin.read to stop reading when I press enter? (read only 1 value)
<jhass>
cocotton: use .gets
frem__ has joined #ruby
sinkensabe has quit [Remote host closed the connection]
ixti has joined #ruby
sinkensabe has joined #ruby
sputnik13 has joined #ruby
<cocotton>
jhass: Things is I'm using mixlib-cli as an option parser, and it seems to create some problems. When using gets, it fetches the first flag (ruby myScript -a flag) rather than the user input at this moment
bthesorceror has joined #ruby
<dukedave>
jhass, centrx, see example for 'chunk with compare' above
nanoyak has joined #ruby
jprovazn_afk is now known as jprovazn
yacks has quit [Ping timeout: 240 seconds]
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
<jhass>
cocotton: $stdin.gets
dangerousdave has quit [Max SendQ exceeded]
arrubin has quit [Ping timeout: 260 seconds]
jeregrine has quit [Ping timeout: 260 seconds]
bjeanes has quit [Ping timeout: 260 seconds]
jrhe has quit [Ping timeout: 260 seconds]
datafirm has joined #ruby
sinkensabe has quit [Ping timeout: 264 seconds]
anaeem1 has joined #ruby
ghr has quit [Ping timeout: 245 seconds]
codabrink has quit [Ping timeout: 252 seconds]
<cocotton>
jhass: oh haha, my bad, that works well, many thanks!
dangerousdave has joined #ruby
arrubin has joined #ruby
bjeanes has joined #ruby
jrhe has joined #ruby
x1337807x has joined #ruby
jeregrine has joined #ruby
freezey has joined #ruby
vifino has quit [Quit: Ze Cat now leaves...]
b00stfr3ak has quit [Remote host closed the connection]
<atmosx>
riceandbeans: It is different, but I don't think you will notivce any difference. I'm quite happy with Sequel truth to be told.
<jhass>
dukedave: I don't think it gets much smarter than that. Personally I'd expand that to multiple lines and a if / else though (I only use ternary for value expressions, not for control flow)
<dukedave>
jhass, oh yeah, I just wanted to one liner it ;) but thanks for the sanity check!
<dukedave>
FWIW, it's sexy in Haskell: Data.List.groupBy (\x y -> y - x < 5) [1, 2, 10, 11, 20, 21, 22, 30]
<dukedave>
I was just hoping Ruby has something similar :)
<benzrf>
dukedave: haskell-five >>=
<centrx>
dukedave, Array has group_by
m8 has joined #ruby
<centrx>
*Enumerable
vifino has joined #ruby
moritzs has quit [Ping timeout: 245 seconds]
m8 has quit [Max SendQ exceeded]
kidoz has quit [Quit: Ухожу я от вас]
<dukedave>
centrx, yeah, unfortunately they don't quite behave the same
<dukedave>
well, at all in fact :)
bradhe has joined #ruby
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
therocketforever has joined #ruby
blooberr____ has joined #ruby
codabrink has joined #ruby
treehug88 has quit [Ping timeout: 272 seconds]
jkline has quit [Quit: jkline]
therocketforever has quit [Client Quit]
alvaro_o has joined #ruby
Kaozr has joined #ruby
mijicd has quit [Remote host closed the connection]
bradhe has quit [Ping timeout: 264 seconds]
gregf has joined #ruby
aagdbl has quit [Quit: Connection closed for inactivity]
codeurge has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
joaoh82 has quit [Remote host closed the connection]
therocketforever has joined #ruby
taybin has quit [Quit: This computer has gone to sleep]
Meatchicken has quit [Quit: Page closed]
RaCx has joined #ruby
RaCx has quit [Client Quit]
<axilla>
how would i say current_storage not greater than allowed_storage
Hanmac1 has joined #ruby
stantona has quit [Remote host closed the connection]
shime_ has quit [Ping timeout: 240 seconds]
<DouweM>
so less than or equal? current_storage <= allowed_storage
<Marfu_>
when I run my script i get only one record, before
<Marfu_>
deleted
<Marfu_>
previous
dukedave has quit [Ping timeout: 252 seconds]
<Marfu_>
Why?
senayar has joined #ruby
<shevy>
I am not sure anyone will be able to reproduce that
Atrumx has quit [Quit: Exit]
<Marfu_>
?
aspires has joined #ruby
<Marfu_>
download and run my code
therocketforever has joined #ruby
<Marfu_>
easyly
rezzack has joined #ruby
paulfm has quit []
mercwithamouth has quit [Ping timeout: 245 seconds]
mary5030_ has joined #ruby
m_3 has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
Zai00 has joined #ruby
ndrei has joined #ruby
RaCx has joined #ruby
therocketforever has quit [Client Quit]
dawkirst has joined #ruby
<Marfu_>
hello? How read the datamaper database?
cjsarette has quit [Remote host closed the connection]
mikepack has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
cjsarette has joined #ruby
Fire-Dragon-DoL has joined #ruby
jonahR has joined #ruby
Fire-Dragon-DoL has quit [Max SendQ exceeded]
<shevy>
The outpit I get with your code is #<Koniec @info="_a0">
<shevy>
*output
<atmosx>
Marfu_: there's a manual on the website, read it.
<Marfu_>
This is from manual
<atmosx>
cool
Fire-Dragon-DoL has joined #ruby
<Marfu_>
read it first ;-)
chrishough has joined #ruby
rizzatti has quit [Quit: Leaving...]
mikepack_ has joined #ruby
<Marfu_>
but not working
<Marfu_>
this is commandline no www sinatra etc
<shevy>
last release in 2011
treehug88 has joined #ruby
Eiam has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
stantona has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
mary5030_ has quit [Remote host closed the connection]
djbkd has joined #ruby
mary5030 has joined #ruby
phantasm66 has quit [Quit: *poof*]
MrDoctor has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
yetanotherdave has joined #ruby
stantona has quit [Ping timeout: 264 seconds]
codabrink has quit [Ping timeout: 264 seconds]
kpshek has quit []
dangerou_ has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
yalue has quit [Quit: Leaving]
karmatr0n has quit [Remote host closed the connection]
paulfm has joined #ruby
<Sigma00>
RTFM
<Sigma00>
seriously
<Sigma00>
DataMapper.auto_migrate! This will issue the necessary CREATE statements (DROPing the table first, if it exists) to define each storage according to their properties.
blinkdesign has joined #ruby
<Marfu_>
Sigma00, I must delete this line?
<Sigma00>
don't blindly run code 'directly from the manual' if you're not gonna read the manual
troyready has quit [Quit: Leaving]
<Sigma00>
I'm not helping you with datamapper, there are docs for that and the project is dead
<Marfu_>
Working
* Marfu_
is stupid
<Marfu_>
Many thanks
codabrink has joined #ruby
dseitz has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<shevy>
yeah, dead projects are the saddest
Morkel has joined #ruby
sinkensabe has quit [Remote host closed the connection]
silkfox has quit [Ping timeout: 245 seconds]
pvb has quit [Quit: Leaving]
<MrDoctor>
Can someone please help me out with this
<MrDoctor>
Can't run migrations without a shard spec: this may be :all, :none, or a specific shard (for data-fixups). please call shard(arg) in your migration.
Gil_ has quit [Remote host closed the connection]
<MrDoctor>
I have no idea what a shard spec is
silkfox has joined #ruby
Marfu_ has left #ruby ["Wychodzi"]
happytux has quit [Ping timeout: 240 seconds]
Mon_Ouie has quit [Ping timeout: 276 seconds]
<shevy>
does one of you know if it is possible with ruby readline to capture the full line that a user typed?
aspires has quit []
emergion has joined #ruby
kpshek has joined #ruby
mikepack_ has quit [Remote host closed the connection]
happytux has joined #ruby
kpshek has quit [Client Quit]
kireevco has quit [Read error: Connection reset by peer]
kireevco has joined #ruby
jprovazn has quit [Quit: Odcházím]
dangerousdave has quit [Read error: Connection reset by peer]
dangerou_ has joined #ruby
yetanotherdave has quit [Ping timeout: 240 seconds]
mercwithamouth has joined #ruby
mania has quit []
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
tier has quit [Remote host closed the connection]
b1205 has joined #ruby
yfeldblum has quit [Remote host closed the connection]
djbkd has joined #ruby
shredding has joined #ruby
<shevy>
sometimes I feel as if I am the only ruby user
<ddv>
you are
joaoh82 has joined #ruby
tier has joined #ruby
AlSquire has joined #ruby
<shevy>
:(
cjsarette has quit [Remote host closed the connection]
<jheg>
Can the merge method be run on arrays?
<jheg>
or is it just for hashes?
mostlybadfly has quit [Quit: Connection closed for inactivity]
<jhass>
what result would you expect? (and no, there's no merge on Array)
dawkirst has quit [Remote host closed the connection]
t0rc has joined #ruby
<ddv>
jheg, you can call + on arrays
cjsarette has joined #ruby
<jheg>
thanks jhass ddv
razrunelord has joined #ruby
<jheg>
is + the hash equiv of merge?
<jhass>
if you answer my question there likely is something that does what you want
<jhass>
let's say we got [1,2,3] and [2,3,4,5], what result do you expect?
<shevy>
jheg in ruby it is all about juggling data in objects
musashi1 has joined #ruby
sinkensabe has joined #ruby
<shevy>
and trying to guess which method is the right one to use
<jhass>
apeiros: they just should move to malbolge and leave us alone :(
kyb3r_ has joined #ruby
<shevy>
because the docus suck
<apeiros>
jhass: :D
<apeiros>
jhass: endless puzzles waiting for them there ;-)
relix has quit [Ping timeout: 240 seconds]
<jheg>
the docs suck?
testcore has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<apeiros>
jheg: most don't. which ones suck IYO and why?
<benzrf>
in haskell functions have relevant types so u can use Hoogle to find them by type :3
jackneill has quit [Read error: Connection reset by peer]
<jhass>
jheg: we left the realms of being serious until we get a straight question from you, in case you didn't notice ;)
<ddv>
who cares about haskell you are in #ruby
<benzrf>
ddv: mee
<jhass>
apeiros: ^ kick time, pls? :P
<shevy>
jheg it depends; for things that are often used, the docs are ok, but for things that people don't often use they are awful or just don't exist
<jheg>
trial and error right?
<shevy>
and copy paste from other people's code
<apeiros>
jhass: benzrf because he's nagging with haskell? yeah, I really should :-D
<jhass>
yeah
<apeiros>
j/k
<shevy>
and puzzling and jiggling and wiggling until it works
bthesorceror has joined #ruby
<jhass>
we should just join #haskell and talk about ruby all the time
<jhass>
shevy: do you join me?
<shevy>
I can not join inferior channels
Takle has joined #ruby
<shevy>
well actually
<shevy>
I'd like to join #python and speak in their native language
hpoydar has joined #ruby
<ddv>
there is no point in python if you know ruby
<shevy>
sshshs ZSshsh Shshshshs
freezey has quit [Remote host closed the connection]
<shevy>
ddv but I like their documentation more!
Kricir has quit [Remote host closed the connection]
<wallerdev>
python is a dead language
djbkd has quit [Remote host closed the connection]
combusean has quit [Quit: Leaving.]
<shevy>
the best would be documentation that would be valid for every scripting language
<wallerdev>
like latin
<jhass>
really? I find pythons official docs pretty awful tbh.
<jhass>
though I didn't check in a while
sinkensabe has quit [Ping timeout: 264 seconds]
<wallerdev>
python's docs are written like a novel lol
<shevy>
I grew up with ruby's iframe rdocs
<shevy>
yeah wallerdev
<jhass>
yeah and the search sucks
<shevy>
it excites!
<shevy>
the hero slays the dragon in the end
bthesorceror has quit [Client Quit]
dukedave has joined #ruby
freezey has joined #ruby
datafirm has joined #ruby
<shevy>
sadly I can't take python seriously as an OOP language
<shevy>
what will repackage things once you pass it the name of the project you wish to repackage completely
<shevy>
*which will
yetanotherdave has joined #ruby
<shevy>
but right now I feel lazy, and I am out of beer
<shevy>
so I am idling ...
kies has quit [Ping timeout: 264 seconds]
Takle has quit [Ping timeout: 240 seconds]
predator117 has joined #ruby
<gomikemike>
so, with the proxy env variable set on the script, the query seems like its coming from the proxy server so all my custom facts now have values from the proxy server
<happytux>
shevy: so some kind of static code analyzer you write?
skaflem has quit [Quit: Leaving]
blinkdesign has quit [Remote host closed the connection]
<shevy>
happytux well static at first; perhaps lateron I will add a full parsing of all requires... but for my own use case I think static suffices completely
bthesorceror has joined #ruby
blinkdesign has joined #ruby
<shevy>
I need it only for one project for the perl team, they can't be bothered to have to deal with any ruby-related problem
anaeem1_ has quit [Remote host closed the connection]
bradhe has quit [Ping timeout: 240 seconds]
heftig has joined #ruby
ylluminate has quit [*.net *.split]
spacemud has quit [*.net *.split]
peterhu has quit [*.net *.split]
Anarch has quit [*.net *.split]
utkarsh_ has quit [*.net *.split]
fearoffish has quit [*.net *.split]
faulkner has quit [*.net *.split]
likemike has quit [*.net *.split]
mduk has quit [*.net *.split]
tskogberg has quit [*.net *.split]
kotk_ has quit [*.net *.split]
qqw_ has quit [*.net *.split]
__main__ has quit [*.net *.split]
go|dfish has quit [*.net *.split]
chihhsin_wego has quit [*.net *.split]
Wayneoween has quit [*.net *.split]
zastern has quit [*.net *.split]
skinny_much has quit [*.net *.split]
bahar has quit [*.net *.split]
Spleeze has quit [*.net *.split]
camilasan has quit [*.net *.split]
everett has quit [*.net *.split]
xm has quit [*.net *.split]
xMopxShell has quit [*.net *.split]
ozzloy has quit [*.net *.split]
Davedo has quit [*.net *.split]
dazeddev has quit [*.net *.split]
AntelopeSalad has quit [*.net *.split]
crodas has quit [*.net *.split]
bijumon has quit [*.net *.split]
stylus has quit [*.net *.split]
wmoxam has quit [*.net *.split]
aep has quit [*.net *.split]
matti has quit [*.net *.split]
philtr has quit [*.net *.split]
sindork has quit [*.net *.split]
nopc0de has quit [*.net *.split]
zxq9 has quit [*.net *.split]
eam has quit [*.net *.split]
avelldiroll has quit [*.net *.split]
Akuma has quit [*.net *.split]
kloeri has quit [*.net *.split]
jpinnix has quit [*.net *.split]
TheNumb has quit [*.net *.split]
NET||abuse has quit [*.net *.split]
phreax has quit [*.net *.split]
kke has quit [*.net *.split]
x0nic has quit [*.net *.split]
snkcld has quit [*.net *.split]
dacamp has quit [*.net *.split]
samuelkadolph has quit [*.net *.split]
amargherio has quit [Remote host closed the connection]
bijumon has joined #ruby
stylus has joined #ruby
kke has joined #ruby
eam has joined #ruby
likemike has joined #ruby
chihhsin_wego has joined #ruby
philtr has joined #ruby
Anarch has joined #ruby
TheNumb has joined #ruby
TheNumb has quit [Changing host]
TheNumb has joined #ruby
wmoxam has joined #ruby
x0nic_ has joined #ruby
matti has joined #ruby
matti has quit [Changing host]
matti has joined #ruby
snkcld has joined #ruby
faulkner has joined #ruby
ozzloy has joined #ruby
ozzloy has joined #ruby
xMopxShell has joined #ruby
sindork_ has joined #ruby
qqw has joined #ruby
dazeddev has joined #ruby
aep has joined #ruby
camilasan has joined #ruby
zastern has joined #ruby
crodas has joined #ruby
peterhu has joined #ruby
dacamp has joined #ruby
tskogberg has joined #ruby
phreax has joined #ruby
zxq9 has joined #ruby
samuelkadolph has joined #ruby
bahar has joined #ruby
ylluminate has joined #ruby
AntelopeSalad has joined #ruby
jpinnix_____ has joined #ruby
xm has joined #ruby
Spleeze has joined #ruby
mduk has joined #ruby
Akuma has joined #ruby
jpinnix_____ has quit [Changing host]
jpinnix_____ has joined #ruby
Wayneoween has joined #ruby
__main__ has joined #ruby
nopc0de- has joined #ruby
spacemud has joined #ruby
NET||abuse has joined #ruby
go|dfish has joined #ruby
kotk has joined #ruby
fearoffish has joined #ruby
kloeri has joined #ruby
everett has joined #ruby
Davedo has joined #ruby
skinny_much has joined #ruby
utkarsh_ has joined #ruby
x0nic_ is now known as x0nic
avelldiroll has joined #ruby
predator117 has quit [Remote host closed the connection]
x1337807x has joined #ruby
Piotrek has joined #ruby
<Piotrek>
Hi, does Ruby have something like perldoc or pydoc?
<shevy>
you may have to search for how they split it up, you poor soul
Xeago_ has quit [Remote host closed the connection]
mikepack has joined #ruby
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jhass is now known as jhass|off
thisirs has quit [Read error: Connection reset by peer]
<atmosx>
gem management through random package-managers (apt-get, emerge, pkg, etc.) sucks big time
<atmosx>
not to mention it's seriously outdated
DanielRb has joined #ruby
<Piotrek>
ah
<Piotrek>
shevy: OK, thanks
<atmosx>
it's way better to install ruby vanilla manually and use that, rvm/rbenv
<Piotrek>
:)
mikepack_ has quit [Ping timeout: 264 seconds]
<hfp>
Anybody familiar with XPaths and Nokogiri?
morinap has quit [Remote host closed the connection]
morinap has joined #ruby
kies has joined #ruby
mikepack has quit [Ping timeout: 252 seconds]
SBoolean_ has quit [Remote host closed the connection]
blackmesa has joined #ruby
tier has quit []
Neomex_ has joined #ruby
Neomex has quit [Ping timeout: 245 seconds]
Zenigor has quit [Remote host closed the connection]
<benzrf>
hfp: y not css selectors
bthesorceror has quit [Quit: bthesorceror]
bmurt has quit []
morinap has quit [Ping timeout: 245 seconds]
<hfp>
benzrf: Because I can't figure how to do what I want with CSS selectors. I'm trying to write a screen scrapper and I want to find within a table all the td that have a specific attribute value and remove the parent tr node from the Nokogiri element
<hfp>
I'm not sure how to do that with css selectors, I thought only xpath could do it
<Rojo>
Piotrek: there is also TomDoc
<benzrf>
table td[data-foo='wut']
<benzrf>
^css
<hfp>
Yes and how do I get Nokogiri to remove the parent node, ie the tr?
mijicd has joined #ruby
Kricir has joined #ruby
taybin has quit [Quit: This computer has gone to sleep]
robertodecurnex has quit [Remote host closed the connection]
Kricir_ has joined #ruby
Kricir has quit [Read error: Connection reset by peer]
mu5k17u has quit [Quit: Leaving]
anaeem1 has quit [Remote host closed the connection]
kies has quit [Ping timeout: 245 seconds]
<hfp>
benzrf: I'm not sure it's possible with css selectors
<benzrf>
05:02 < benzrf> table td[data-foo='wut']
<benzrf>
05:02 < benzrf> ^css
monkegjinni has joined #ruby
<hfp>
benzrf: This selects the td, how to remove the tr ancestor?
niklasb has quit [Quit: WeeChat 0.4.3]
BizarreCake has quit [Quit: Leaving]
<apeiros>
hfp: dom modification is neither part of CSS nor XPath
<apeiros>
hfp: take a look at Node and NodeSet docs for dom mod
mikepack has joined #ruby
alexju has quit [Remote host closed the connection]
<kenneth>
hey all; so i'm looking to build a library that looks somewhat like this
NukePuppy has quit [Ping timeout: 264 seconds]
<hfp>
apeiros: It's not to modify the DOM per se. I use Nokogiri to scrap a webpage and then I have to parse it to extract only certain values. But the page has, once in a while, an irregular tr with a colspan=6. So I want to remove these tr altogether before doing the parsing because it messes everything up
<kenneth>
you can subscribe to something, by passing it a block that gets executed whenever this event happens
<benzrf>
]]]]]]]]
Morkel has quit [Quit: Morkel]
<benzrf>
oops
alexju has joined #ruby
<kenneth>
but with the ability to break from the block to terminate the execution
<benzrf>
hfp: cant you get the nodeset for that, then traverse back upward
<apeiros>
hfp: "how to remove tr ancestor" - that's dom modification
<kenneth>
is there a way to intercept a break? when the block is not nicely and linearly called through through a yield
<hfp>
apeiros: Maybe I worded it poorly
<apeiros>
maybe
Xeago has joined #ruby
<hfp>
benzrf: I'm not sure, I started using Nokogiri 2 hours ago...
mikepack_ has joined #ruby
<shevy>
hehehe
Kricir_ has quit [Ping timeout: 252 seconds]
ctp has joined #ruby
<apeiros>
hfp: tr:not([colspan=6])
Gadgetoid_ has joined #ruby
<apeiros>
selects all tr's which don't have colspan=6
<hfp>
apeiros: Didn't think of that haha thanks I'll try it now
vinleod has joined #ruby
anaeem1 has joined #ruby
GriffinH_ has quit [Remote host closed the connection]
netf has quit [Write error: Connection timed out]
timfoo has quit [Write error: Broken pipe]
Gadgetoid has quit [Ping timeout: 1825 seconds]
peckermanzzz has quit [Ping timeout: 1825 seconds]
Caius has quit [Ping timeout: 1825 seconds]
soulcake has quit [Ping timeout: 1825 seconds]
Gadgetoid_ is now known as Gadgetoid
Piotrek has left #ruby ["/part"]
netf has joined #ruby
peckermanzzz has joined #ruby
Caius has joined #ruby
monkegjinni has quit [Ping timeout: 272 seconds]
dvcliving has joined #ruby
<dvcliving>
hello
Caius is now known as Guest3499
aspires has joined #ruby
soulcake has joined #ruby
holden247 has quit [Quit: Leaving.]
mikepack has quit [Ping timeout: 252 seconds]
nmokru has quit [Quit: nmokru]
Rollabunna has joined #ruby
timfoo has joined #ruby
alexju has quit [Ping timeout: 264 seconds]
<dvcliving>
someone uses rails? I cannot join #rails. I have a really weird problem with registration. All fields are failing and empty, the model is the same as before (it worked), controllers are the same, some gems where updated. Still on the same rails version. I checked the request and the fields as sent as json and processed by the right controller. Anybody knows what can be happening?
djbkd has quit [Remote host closed the connection]
<dvcliving>
or any idea on how to procceed, I wastes 4 hours on this, cannot get a solution
mikepack_ has quit [Ping timeout: 272 seconds]
joaoh82 has quit [Remote host closed the connection]
<hfp>
I don't get it... I have `foo = scrapped_stock_prices.search(".yfnc_datamodoutline1 table tr:not([colspan='6'])"); p foo.css('td')[141]`. 141 has the value 6 for colspan, so why is it selected?
<ericboehs>
Is there a clever way to make an object that responds to any method with the output of the first argument? Here's a crappy example using Struct: `Struct.new(:noop){ def load s; s end; def dump s; s end }.new.load {foo: 'bar'}`
Kerea has joined #ruby
r0bby has quit [Excess Flood]
r0bby has joined #ruby
b1205 has quit [Ping timeout: 245 seconds]
<wallerdev>
ericboehs: method_missing ?
treehug88 has joined #ruby
sambao21 has joined #ruby
<ericboehs>
Yeah but I also want to define the class on the fly
<apeiros>
Class.new
<apeiros>
though, why you'd need a class is beyond me
<apeiros>
sounds to me like a single object would suffice.
emsilva has quit [Quit: Keep Walking (Computer Slept!)]
<nahtnam>
Sigma00: Everybody is the best
<nahtnam>
Lol
benlieb has quit [Quit: benlieb]
tacit7 has quit [Ping timeout: 264 seconds]
b1205 has joined #ruby
<nahtnam>
I need a little more help. https://gist.github.com/nahtnam/3cb822d4a4101de9beab <- If im not wrong, this code should run 8 times (each statement), but its only running once. (I know I can just use .sort but I want to make my own sorting system).
<ericboehs>
DouweM: Doh. Of course! That's perfect
<ericboehs>
Why do I need it? Rails...
<ericboehs>
haha
<DouweM>
ericboehs: I do Rails and I've never needed this ;)
<DouweM>
ericboehs: what are you going to do with it?
Neomex has joined #ruby
<apeiros>
>> o = Object.new.tap do |o| def o.method_missing(m, arg, *args, &block); arg; end end.foo({ foo: "bar" })
<Sigma00>
nahtnam: it only runs once because start == 1 at the beginnig of the second loop
netf has joined #ruby
silkfox has quit [Ping timeout: 252 seconds]
<apeiros>
ericboehs: ^
<DouweM>
if you only need a single object, apeiros's is better
<nahtnam>
Sigma00: Thanks! :)
<DouweM>
if for some reason you really want a class, use Class.new
<ericboehs>
DouweM: Using a JSON data store in postgres
timfoo has joined #ruby
Neomex_ has quit [Ping timeout: 240 seconds]
lw has quit [Quit: s]
<ericboehs>
Either Rails' json coder support is broke or I'm not using it right
Neomex has quit [Client Quit]
anaeem1 has quit [Remote host closed the connection]
doodlehaus has quit [Remote host closed the connection]
adantj has quit [Ping timeout: 240 seconds]
<ericboehs>
I have a pg column type of json on a "service_keys". In my model I'm doing `store :service_keys, accessors: [:rdio_key], coder: JSON` and rails tries to JSON.load on a hash
<Sigma00>
if you want to be REALLY crazy, you could add method_missing to NilClass
yfeldblum has joined #ruby
<ericboehs>
Sigma00: nty :P
jonahR has quit [Remote host closed the connection]
<dvcliving>
Sigma00 any idea? I shared the code
joaoh82 has joined #ruby
chipotle_ has quit [Quit: cya]
wjimenez5271 has left #ruby [#ruby]
Blaguvest has joined #ruby
chipotle has joined #ruby
<Sigma00>
"I have this really weird problem with registration" expound on this please
Senjai has quit [Changing host]
Senjai has joined #ruby
jxf has quit [Ping timeout: 252 seconds]
<Sigma00>
I assume build_resource is a helper?
claymore has quit [Quit: Leaving]
<Sigma00>
oh, it's Devise
<dvcliving>
yes
Kerea has quit [Quit: leaving]
<dvcliving>
devise
<dvcliving>
registration form shows all fields empty and invalid
<Sigma00>
btw preferred_language is misspelled
jkline has joined #ruby
<dvcliving>
and all the validation messages are shown
<dvcliving>
yes
<dvcliving>
let me check
MrDoctor has quit [Remote host closed the connection]
MrDoctor has joined #ruby
TheKruex has quit []
MrDoctor has quit [Read error: No route to host]
mikepack has joined #ruby
<dvcliving>
* Now talking on ##namespace
<dvcliving>
* Now talking on ##namespace
<dvcliving>
Sigma00
MrDoctor has joined #ruby
<dvcliving>
its didn?t change
<nahtnam>
Lol, i give up
<dvcliving>
it sets the locale from locale helper
benlieb has joined #ruby
kilk_ has quit [Quit: kilk_]
<Sigma00>
dvcliving: I suggest you use a tool like PRY (or log heavily) to debug this problem
aspires has quit []
<banister>
Sigma00 it's spelt pry not PRY :P it's not an acronu
<banister>
acronym
Zenigor has joined #ruby
joaoh82 has quit [Ping timeout: 245 seconds]
datafirm has quit [Quit: Computer has gone to sleep.]
datafirm has joined #ruby
mikepack has quit [Ping timeout: 244 seconds]
datafirm has quit [Read error: Connection reset by peer]
<matled>
PRY: not an acRonYm?
nmokru has joined #ruby
<banister>
cute :)
qwyeth has quit [Remote host closed the connection]
<DouweM>
havenwood: I wondered if that'd work but didn't bother trying :P good to know it does
<jheg>
is there a way to drill into that array using has_value? that you know of?
Zenigor has quit [Ping timeout: 240 seconds]
emptymag00 has quit [Read error: Connection reset by peer]
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gusblan has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<apeiros>
jheg: no. as said, has_value? tests with == whether a value in the hash is equal to what you passed it. that's it. nothing more, nothing less.
hpoydar has quit [Remote host closed the connection]
<apeiros>
if you want to drill down, you'll have to do manually
<jheg>
OK thanks apeiros
vifino has quit [Quit: Ze Cat now leaves...]
echevemaster has joined #ruby
Kricir has quit [Ping timeout: 245 seconds]
jobewan has quit [Quit: Leaving]
Matip has quit [Read error: Connection reset by peer]
Matip has joined #ruby
Matip has quit [Changing host]
Matip has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
Zenigor_ has quit [Remote host closed the connection]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
jheg: I think you should not use a hash for whatever you're doing.
<apeiros>
jheg: also, that will only test a single value in the hash
<jheg>
I'm just fiddling really
sambao21 has joined #ruby
<jheg>
at the mo I'm doing no more than trying to learn the language
mehlah has joined #ruby
nmokru has quit [Quit: nmokru]
dangerousdave has quit [Ping timeout: 272 seconds]
<apeiros>
jheg: well, using the right data structure should probably be a part of that
thesheff17 has quit [Ping timeout: 245 seconds]
riotjone_ has joined #ruby
vinleod has quit [Quit: Computer has gone to sleep.]
mijicd has quit [Remote host closed the connection]
Deele has quit [Ping timeout: 260 seconds]
dawkirst has quit [Remote host closed the connection]
nmokru has joined #ruby
riotjones has quit [Ping timeout: 252 seconds]
cjsarette has quit [Remote host closed the connection]
<jheg>
apeiros: OK thanks really appreciate the advice
cjsarette has joined #ruby
SCommette has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
jottr_ has joined #ruby
bradhe has joined #ruby
moritzs has joined #ruby
andrewlio has quit [Quit: Leaving.]
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
nanoyak has joined #ruby
Nahra has joined #ruby
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 272 seconds]
dukedave has quit [Ping timeout: 252 seconds]
bradhe has quit [Ping timeout: 244 seconds]
asteve has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sambao21 has quit [Quit: Computer has gone to sleep.]
kirun has quit [Quit: Client exiting]
ffranz has quit [Quit: Leaving]
akonny has joined #ruby
momomomomo has joined #ruby
geggam has quit [Remote host closed the connection]
SCommette has quit [Quit: SCommette]
nowthatsamatt has quit [Quit: nowthatsamatt]
nmokru has quit [Quit: nmokru]
newUser1234 has quit [Remote host closed the connection]
nmokru has joined #ruby
Azulinho has quit [Ping timeout: 240 seconds]
<jkline>
I have two gems: jkline-mylib and jkline-myapp. The specs on jkline-myapp are failing because it is using an incompatible version of jkline-mylib, even though the gemspec lists the required version. I would appreciate suggestions how to fix this, including links to online docs.
treehug88 has quit []
<jkline>
(its a hard topic to google search for relevant information)
aspires has quit []
<dvcliving>
Sigma00
<dvcliving>
the problem was
hpoydar has joined #ruby
<jkline>
jkline-myapp.gemspec says "jkline-mylib", "= 0.1.0" but instead `rake spec` is using jkline-mylib 0.2.0
stantona has quit [Remote host closed the connection]
nmokru has quit [Client Quit]
dvcliving has quit [Quit: zZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzzzZZzz]
nmokru has joined #ruby
aspires has joined #ruby
djbkd has quit [Remote host closed the connection]
sambao21 has joined #ruby
Valesk_ has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has joined #ruby
nmokru has quit [Client Quit]
hpoydar has quit [Ping timeout: 252 seconds]
nmokru has joined #ruby
x1337807x has joined #ruby
frem has quit [Ping timeout: 240 seconds]
mikepack has joined #ruby
freerobby has quit [Quit: Leaving.]
<DEA7TH>
Is there a method I can use to calculate the median of an array? It doesn't need to be high performant.
<benzrf>
DEA7TH: sort it and take the middle item?
spider-mario has quit [Remote host closed the connection]
freezey has quit []
<DEA7TH>
ah, my bad - it's already sorted
<DouweM>
array[array.length/2] then
sambao21 has quit [Quit: Computer has gone to sleep.]
hpoydar has joined #ruby
klaut has quit [Remote host closed the connection]
mikepack has quit [Ping timeout: 272 seconds]
<Sigma00>
only if array is even
joaoh82 has joined #ruby
mikepack has joined #ruby
<Sigma00>
er, odd
<Sigma00>
and you'd want +1
Valesk_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
but depending on what you want, you want to special case even length arrays
benzrf is now known as benzrf|offline
gusblan has quit [Remote host closed the connection]
nmokru has quit [Client Quit]
nmokru has joined #ruby
<Sigma00>
oh you're right, since index starts at 0 that's fine
Zai00 has quit [Quit: Zai00]
<DouweM>
;)
joaoh82 has quit [Ping timeout: 272 seconds]
mikepack has quit [Ping timeout: 264 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stantona has joined #ruby
GriffinHeart has joined #ruby
DEA7TH has quit [Ping timeout: 264 seconds]
mikepack has joined #ruby
nmokru has quit [Quit: nmokru]
jkline has quit [Quit: jkline]
nmokru has joined #ruby
Kricir has joined #ruby
frem has joined #ruby
GriffinHeart has quit [Ping timeout: 245 seconds]
sdouglas has joined #ruby
arrubin has quit []
x1337807x has joined #ruby
jkline has joined #ruby
nmokru has quit [Client Quit]
snath has quit [Ping timeout: 272 seconds]
akonny has quit [Quit: akonny]
predator117 has quit [Ping timeout: 264 seconds]
nmokru has joined #ruby
gusblan has joined #ruby
hermanmunster has quit [Remote host closed the connection]
monkegjinni has joined #ruby
hermanmunster has joined #ruby
_jayel_ has joined #ruby
predator117 has joined #ruby
Kricir has quit [Ping timeout: 264 seconds]
MrDoctor has quit [Remote host closed the connection]
MrDoctor has joined #ruby
_jayel_ has quit [Quit: Leaving]
yetanotherdave has quit [Ping timeout: 264 seconds]
nmokru has quit [Client Quit]
Avahey_ has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
RaCx has quit [Quit: Computer has gone to sleep.]
Valesk_ has joined #ruby
monkegjinni has quit [Ping timeout: 240 seconds]
hermanmunster has quit [Ping timeout: 264 seconds]
timonv has joined #ruby
yetanotherdave has joined #ruby
r0bby has quit [Excess Flood]
r0bby has joined #ruby
nahtnam has quit [Quit: Page closed]
Rollabunna has joined #ruby
karmatr0n has quit []
MrDoctor has quit [Ping timeout: 252 seconds]
<jheg>
DEA7TH: would this work?
<jheg>
array = [1,4,34,22,12,67,34,6]
<jheg>
if array.length.odd?
<jheg>
i = array.length / 2 + 0.5
<jheg>
puts "The median is #{array[i]}"
<jheg>
else
<jheg>
i = array.length / 2 - 0.5
<jheg>
i2 = array.length / 2 + 0.5
<jheg>
puts "The median is #{array[i]} and #{array[i2]}"
<jheg>
end
doodlehaus has joined #ruby
amargherio has joined #ruby
Guest92259 has quit [Quit: Leaving...]
chrishough has quit [Quit: chrishough]
<Sigma00>
!gist
<helpa>
http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
<DouweM>
jheg: you can't use floats for array indexes
usr583 has joined #ruby
<jheg>
sorry
<jheg>
its not a float
<DouweM>
yeah it is
<jheg>
ah sorry
blackmesa has quit [Ping timeout: 264 seconds]
<jheg>
would I need to convert to int?
<jheg>
although it did work as I intended
<DouweM>
why are you messing with + 0.5 anyway? 5/2 == 2, because you're dividing integers. 2 is the "lower median index", 2 + 1 (so len/2+1) is the "higher median index"
timonv has quit [Ping timeout: 240 seconds]
mary5030_ has joined #ruby
<DouweM>
no need for +0.5
bthesorceror has joined #ruby
toastynerd has quit [Remote host closed the connection]
bradhe has joined #ruby
Rollabunna has quit [Ping timeout: 240 seconds]
<jheg>
so better to write 9 / 2 + 1 to get the middle number ?
<jheg>
to avoid changing the int to a float?
snath has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
kevind has quit [Quit: kevind]
<DouweM>
length / 2 for an odd length is the left side of the median. if you want the right side, use length / 2 + 1
usr583 has quit [Quit: Page closed]
bradhe has quit [Ping timeout: 252 seconds]
<DouweM>
ah damn, I'm confusing things as well I think
hpoydar has quit [Remote host closed the connection]
<jheg>
for odd isn't it just length / 2 - 1 for the middle number
<DouweM>
it's completely the other way around
<jheg>
oh yeah length / 2 for odd
<DouweM>
if you have 3 numbers, the index of the median is 1, or 3/2, without -1
<DouweM>
right. it's with an even length that things get hairy
<jheg>
length / 2 - 1 and length / 2 for even
<DouweM>
4/2 == 2, which is the right side, 4/2-1==1 is the left side
<DouweM>
yup
<DouweM>
sorry for making this even more confusing :
<DouweM>
:/
<jheg>
so 9 / 2 - 1 [3] and 9 / 2 [4]
<apeiros>
.length/2 is the middle index already. no -1, no +1
<DouweM>
I was mixing a couple of things up and not really thinking it through
<jheg>
lol
<DouweM>
apeiros: for even length, length/2 is the right side, length/2-1 the left side
gusblan has quit [Remote host closed the connection]
<apeiros>
yes. for even length arrays you need to know whether you want average of low & high median or one of low/high
<jheg>
yeah thats what I have now
dukedave has joined #ruby
<jheg>
night all thanks once again for all your help o/
SCommette has joined #ruby
aantix has joined #ruby
jheg has quit [Quit: jheg]
thesheff17 has joined #ruby
kies has joined #ruby
bthesorceror has quit [Quit: bthesorceror]
djbkd has quit [Remote host closed the connection]
bthesorceror has joined #ruby
djbkd has joined #ruby
hermanmunster has joined #ruby
jkline has quit [Quit: jkline]
doodlehaus has quit [Remote host closed the connection]
chrishough has joined #ruby
benzrf|offline is now known as benzrf
Valesk_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nmokru has joined #ruby
cashnguns has joined #ruby
mijicd has joined #ruby
jespada has joined #ruby
l3ck has joined #ruby
Takle has quit [Remote host closed the connection]
moritzs has quit [Ping timeout: 252 seconds]
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
gusblan has joined #ruby
dwayhs__ has joined #ruby
danman has quit [Quit: danman]
ephemerian has left #ruby [#ruby]
maletor_ has quit [Ping timeout: 245 seconds]
l3ck has quit [Client Quit]
dwayhs_ has quit [Ping timeout: 240 seconds]
maletor has joined #ruby
danman has joined #ruby
Nahra has quit [Ping timeout: 245 seconds]
Shidash has joined #ruby
northfurr has joined #ruby
andrewjanssen has joined #ruby
bthesorceror has quit [Quit: bthesorceror]
Valesk_ has joined #ruby
NukePuppy has joined #ruby
Nahra has joined #ruby
joaoh82 has joined #ruby
lw has joined #ruby
gusblan has quit [Remote host closed the connection]
testcore has quit [Quit: BitchX: it keeps going and going and going and going and...]
sdouglas has quit [Remote host closed the connection]
Nahra has quit [Remote host closed the connection]
danman has quit [Ping timeout: 264 seconds]
gaboesquivel has joined #ruby
<shevy>
dumdedum
sgp667 has joined #ruby
<shevy>
will mruby replace mri ruby?
nmokru has quit [Quit: nmokru]
Takle has joined #ruby
cjsarette has quit [Remote host closed the connection]
cjsarette has joined #ruby
gusblan has joined #ruby
SCommette has quit [Quit: SCommette]
<sgp667>
hey guys I got super noobish question but its ungooglable? what is this? ="> #<Mysql:0x96734b0>" I got this as response in irb to command "db = Mysql.new ...."
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
joaoh82 has quit [Ping timeout: 272 seconds]
i_s has quit [Read error: Connection reset by peer]
gaboesquivel has quit [Client Quit]
gaboesquivel has joined #ruby
sdouglas_ has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
phinfonet has quit [Read error: Connection reset by peer]