toretore has quit [Quit: This computer has gone to sleep]
dvlwrk has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
Cloudzy has joined #ruby
doodlehaus has joined #ruby
a346 has joined #ruby
jeramy_s has joined #ruby
towski_ has joined #ruby
amclain has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
freerobby has quit [Quit: Leaving.]
scripore has quit [Quit: This computer has gone to sleep]
Soda has quit [Remote host closed the connection]
ascarter has joined #ruby
n008f4g_ has quit [Ping timeout: 256 seconds]
rbennacer has quit [Ping timeout: 264 seconds]
Ellis has quit [Quit: Ellis]
felipecvo has joined #ruby
oo_ has joined #ruby
mistermocha has quit [Ping timeout: 256 seconds]
pika_pika has quit [Ping timeout: 245 seconds]
sankaber has joined #ruby
jeromelanteri has quit [Ping timeout: 250 seconds]
dopiee has joined #ruby
doodlehaus has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
towski_ has quit [Remote host closed the connection]
thatslifeson has quit [Read error: Connection reset by peer]
thatslifeson has joined #ruby
stox has joined #ruby
thatslifeson has quit [Read error: Connection reset by peer]
ascarter has joined #ruby
Oka has quit [Quit: さようなら]
ascarter has quit [Client Quit]
drocsid has joined #ruby
thatslifeson has joined #ruby
juanpablo__ has joined #ruby
rodfersou has quit [Quit: leaving]
krz has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
towski_ has joined #ruby
thatslifeson has quit [Ping timeout: 248 seconds]
Hijiri has joined #ruby
thatslifeson has joined #ruby
juanpablo__ has quit [Ping timeout: 252 seconds]
towski_ has quit [Remote host closed the connection]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ponga has joined #ruby
dopiee has quit [Quit: Leaving]
jeromelanteri has joined #ruby
juanpaucar has joined #ruby
plutonic has joined #ruby
uri has joined #ruby
Soda has joined #ruby
jaequery has joined #ruby
freerobby has joined #ruby
ponga has quit [Ping timeout: 264 seconds]
fgo has joined #ruby
juanpaucar has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
tubuliferous_ has joined #ruby
bigsky has joined #ruby
<bigsky>
hi all
<bigsky>
anybody here who have tried ejbca?
Zai00 has quit [Quit: Zai00]
uri has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
stox has quit [Ping timeout: 240 seconds]
devlop has joined #ruby
Spami has joined #ruby
Spami has quit [Client Quit]
stox has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<xxneolithicxx>
what commands does ruboto know
<drocsid>
I have an array of hashes, and each hash has a name. I wish to put some strings into a datastructure ( not sure which type I want to use ) and want to only iterate through the array one time. What's the appropriate approach to make this efficent?
charliesome has joined #ruby
<drocsid>
*each hash has a name element.
charliesome has quit [Client Quit]
jeramy_s has joined #ruby
icebourg has joined #ruby
<xxneolithicxx>
sounds like a basic loop, whats so special about what you want to do with the names
tus has quit []
jeramy_s has quit [Client Quit]
<drocsid>
just want to make sure each name is represented at least once in the array of hashes.
<drocsid>
should I use a ds that I can remove elements from
<drocsid>
is the hash map appropriate.
<drocsid>
I'm just a novice so that's why I'm asking?
<drocsid>
.
<xxneolithicxx>
if the name is what you are using to organize data you should probably using it as the key of a single hash and not as a key of multiple hashes in an array
Pharaoh2 has quit [Ping timeout: 252 seconds]
mleung has joined #ruby
<xxneolithicxx>
each name can then have another hash as a value for more data
djbkd has quit [Quit: My people need me...]
<drocsid>
so I have an array with each element a set of hashes with the name being what I'm interested in. It's data I parsed from json.
Lissie has joined #ruby
<drocsid>
So I thought maybe the thing to do is to iterate through that array and get each name and compare it against another ds, removing the name from the other ds when I find it. Is that a good way to go about it?
Spami has joined #ruby
b4tm4n has quit [Remote host closed the connection]
<xxneolithicxx>
what are you trying to compute from the json data, how many time each name occurs?
claptor has joined #ruby
<drocsid>
just that each name occurs once in the json data
dfinninger has joined #ruby
<xxneolithicxx>
and if it doesnt?
<drocsid>
then I will generate an alert of the missing names
devlop has quit [Quit: Leaving]
devlop has joined #ruby
<xxneolithicxx>
but in order for you to know it was missing you would need a list of names before hand
<xxneolithicxx>
another list
<drocsid>
right that's what I'm saying
RegulationD has joined #ruby
<drocsid>
just trying to figure out what other ds I should use
<drocsid>
array?
<drocsid>
what can I remove elements from
<drocsid>
think I will just loop through each of the json elements, compare against my other ds
<drocsid>
xxneolithicxx: thanks, I have some ideas on how to go about this now ( efficently? )..
<havenwood>
sohrab: But I'd deserialize, merge then reserialize.
<xxneolithicxx>
also just fyi, if you want deep merge its not in there so know if you need deep merge or not
<sohrab>
havenwood: yeah that looks simple ty
<havenwood>
drocsid: I don't think I follow what you're trying to do. You have an Array of Hashes with :name keys. Are you trying to partition them based on the value corresponding to the :name key? What are the rules?
<sohrab>
xxneolithicxx: this is super simple. dont' think i'll need that but ty
juanpablo__ has quit [Ping timeout: 252 seconds]
<xxneolithicxx>
he was trying to find which ones did not occur an array of names
workmad3 has joined #ruby
<xxneolithicxx>
uniq set of the names in the array of hashes minus a known list of names
<xxneolithicxx>
trade off between computer vs storage as to which way he wants to go on that but all those work
<havenwood>
computer versus storage?
<xxneolithicxx>
compute time vs memory
bas3D_gOD has joined #ruby
<xxneolithicxx>
depending on how much data hes working with
m0r0n has joined #ruby
<bas3D_gOD>
what is the objective c chat?
<havenwood>
bas3D_gOD: ##objc maybe?
<xxneolithicxx>
#objective-c
<drocsid>
thanks again for the ideas. This is good for me to look into more so I can grow.
<m0r0n>
Hello I was wondering what's the best way to pull a git ruby application and have it run seamlessly. I'm having issues with bundle install all over the place after pulling my repo
<havenwood>
xxneolithicxx: only 3 folk there
<bas3D_gOD>
thanks
<bas3D_gOD>
:*
workmad3 has quit [Ping timeout: 250 seconds]
<bas3D_gOD>
:*(
<xxneolithicxx>
lol ehh close enough, i elgooged
<bas3D_gOD>
does anyone have any experience programming nobjectiv ec
<havenwood>
bas3D_gOD: 32 in ##objc, make it 33?
Drakevr has quit [Ping timeout: 245 seconds]
<xxneolithicxx>
may also want to try mac channels as an alernative
Lissie has quit [Quit: My computer has gone to sleep. ZZZzzz…]
<_blizzy_>
he must hate ASP.NET MVC also.
<bas3D_gOD>
isn't everything mvc these days?
<_blizzy_>
'it does too much work'
<_blizzy_>
THATS THE POINT.
<_blizzy_>
and we still have to code in a lot of stuff too.
Eiam_ has joined #ruby
<bas3D_gOD>
i tried doing rails and i didn't get what we were doing
<_blizzy_>
yes, mvc is everywhere, Rails, Django, Laravel, ASP.NET MVC.
<_blizzy_>
etc.
yfeldblu_ has quit [Remote host closed the connection]
jottr_ has joined #ruby
<_blizzy_>
well, I must afk now. bye, bas3D_gOD.
Drakevr has joined #ruby
<xxneolithicxx>
shit, i should not have dont that
<xxneolithicxx>
freaking web irc client hung my browser
<xxneolithicxx>
pos
jottr_ has quit [Ping timeout: 240 seconds]
<sevenseacat>
so much nerdrage in that reddit thread
Sawbones has quit []
Channel6 has joined #ruby
<bas3D_gOD>
people still go on reddit?
jeromelanteri has quit [Ping timeout: 250 seconds]
lektrik has quit [Ping timeout: 244 seconds]
<xxneolithicxx>
you mean you dont live in reddit?
_blizzy_ has quit [Ping timeout: 272 seconds]
<bas3D_gOD>
reddit is so 2005, it's 2015;.... have you been living under a rock?
narcan has joined #ruby
<sevenseacat>
i only go there when people link to stuff there
oo_ has quit [Remote host closed the connection]
stox has quit [Ping timeout: 264 seconds]
<xxneolithicxx>
so whats 2015
<bas3D_gOD>
don't link to reddit... reddit is an old site full of trolls and other undesirable people
Spami has quit [Quit: This computer has gone to sleep]
<m0r0n>
Hello again. I made a rails project, uploaded to git, resinstalled ubuntu, pulled the git after following the same install procedure and I'm getting missing gem errors. Can you please help me?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
yfeldblum has joined #ruby
<havenwood>
bas3D_gOD: So growing at 200% a year for ten years is... smaller?
mengu has joined #ruby
<bas3D_gOD>
no it's stupid
<havenwood>
m0r0n: The best place for Rails questions is probably the #RubyOnRails channel. When you `bundle` it says gems are missing?
<bas3D_gOD>
the infestation of trolls has been growing 200% a year
<havenwood>
bas3D_gOD: So you're saying the signal to noise ratio has remained even? :P
<bas3D_gOD>
no it got a lot worse
<bas3D_gOD>
last time i was there someone linked child pornography
<bas3D_gOD>
this was three days ago
<havenwood>
bas3D_gOD: Sounds like you're not in r/ruby.
<Radar>
Forgive me Matz for I have sinned
<m0r0n>
havenwood: thanks. I tried joining #rails. Yes it does says gems are missing. I then gem install ____ -v xxx and it claims it can't find the source
<bas3D_gOD>
someone linked me to something on reddit, a comment had a link to cp masked as the cutest girl in the world
<Radar>
m0r0n: try #rubyonrails, not Rails.
<m0r0n>
I'll join rubyonrails and ask there, thanks for the help
<bas3D_gOD>
now i'm on every fucking list the nsa, cia, kkk, fbi and whatever other three letter acronym government agency exists out there
<Radar>
bas3D_gOD: Oh yes we've heard of you.
* havenwood
glances at his clipboard.
<Radar>
How *is* California this time of year?
<xxneolithicxx>
you realize you probably made their list a long time ago just by joining IRC right?
mengu has quit [Ping timeout: 252 seconds]
a346 has quit [Quit: a346]
maciejczyzewski has joined #ruby
A205B064 has quit [Ping timeout: 245 seconds]
ramfjord has joined #ruby
vim_shimm has joined #ruby
<greedo>
Radar: drought
<bas3D_gOD>
xxneolithicxx: you realize that you're also on the list for having too many x in your name
beneggett has joined #ruby
Rickmasta has quit [Ping timeout: 244 seconds]
<xxneolithicxx>
dont hate
jlast has joined #ruby
<xxneolithicxx>
I wonder if you could request an FOIA on yourself to see what they have on you lol
jeromelanteri has joined #ruby
lidenskap has joined #ruby
maciejczyzewski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ebbflowgo has quit [Quit: ebbflowgo]
Rickmasta has joined #ruby
vim_shimm has quit [Ping timeout: 264 seconds]
blazes816 has joined #ruby
freerobby has quit [Quit: Leaving.]
<bas3D_gOD>
xx (sounds like sex); sex is for perverts(put on automatic possible rapist list); sex is evil; he likes having sex instead of supporting stupid wars that create more global instability(this guy is a rapist and a terrorist); yes you're on all those lists and i am on a list for telling you that you are on a list... we're both fucked
<sevenseacat>
thats enough
<sevenseacat>
bas3D_gOD: pipe down.
<Radar>
+1
<xxneolithicxx>
so dem rubies, whatcha guys workin on
<Radar>
SMS verification to stop assholes from spamming sellers on our site.
<bas3D_gOD>
pipe is also another term for a sexual object... this whole room is on the list!!!
P1RATEZ has joined #ruby
<sevenseacat>
right now, i'm doing code school's try sql course for fun and profit.
<xxneolithicxx>
shit people still use SMS
<Radar>
bas3D_gOD: You were asked to pipe down.
<bas3D_gOD>
i'm coding a rails app anyone want to join me?
tcrypt has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
<Radar>
bas3D_gOD: Nope.
<bas3D_gOD>
Radar: does pipe down involve in going down on someone's "pipe"?
<Radar>
That's enough.
<xxneolithicxx>
:-)
blazes816 has quit [Ping timeout: 245 seconds]
zorak8 has joined #ruby
devlop has quit [Quit: Leaving]
thatslifeson has quit [Remote host closed the connection]
tubuliferous has quit [Ping timeout: 272 seconds]
devlop has joined #ruby
devlop has quit [Read error: Connection reset by peer]
<xxneolithicxx>
the last time i heard anything interesting about SMS was someone writing tool to use it to browse the web in third world countries or something like that
<Radar>
Yeah people still use SMS to contact our sellers. We give the users the seller's mobile number after they've verified theirs.
<Radar>
I've been using Twilio and I like it.
<sevenseacat>
last app i worked on sent a lot of sms messages about shifts they were assigned to work on
<sevenseacat>
thousands of the buggers
<Radar>
sevenseacat: who did you use to send the messages?
<sevenseacat>
messagenet
mleung has quit [Quit: mleung]
<Radar>
never heard of them
<Radar>
They're not too far from where I work now
<sevenseacat>
:)
<Radar>
We're using Twilio because we need international support.
Morkel has joined #ruby
<sevenseacat>
yeah we only needed domestic messaging
dopie has joined #ruby
felipecvo has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 255 seconds]
badhatter has joined #ruby
badhatter has joined #ruby
Contigi has quit [Quit: Leaving]
<shevy>
vulix depends on whether people may find it useful
lxsameer has joined #ruby
<shevy>
the best you can do is wrap it into a gem, have a logical, consistent and easy to use API, and provide high quality docs + working usage examples
<shevy>
sevenseacat we need domestic cats messaging!
laurentide has quit [Ping timeout: 245 seconds]
A205B064 has joined #ruby
sigurding has quit [Quit: sigurding]
<shevy>
messagecat: WhatsApp for cats
Lewix has quit [Remote host closed the connection]
<shevy>
genetically engineer cats to become cleverer
dopie has quit [Ping timeout: 246 seconds]
<shevy>
why should they not be allowed to program to make a living anyway? Not long ago, there was a court hearing for a chimpanzee made legally possible
<shevy>
though actually, the title is a misnomer... it's not "human rights", it is just equivalent for habeas corpus (right to their own body http://en.wikipedia.org/wiki/Habeas_corpus )
Contigi has joined #ruby
mleung has quit [Quit: mleung]
plutonic has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Max SendQ exceeded]
sigurding has joined #ruby
qnode has joined #ruby
konsolebox has joined #ruby
lolmaus has joined #ruby
lfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qnode has quit [Quit: Leaving]
<eam>
shevy: it was a mistake, corrected shortly after
dopie has joined #ruby
EricCartman has joined #ruby
Channel6 has quit [Quit: Leaving]
IronKoopa has joined #ruby
<EricCartman>
are there any developers out there that only have a ged?
<havenwood>
EricCartman: totally
michaeldeol has joined #ruby
wjimenez5271 has quit [Ping timeout: 264 seconds]
<EricCartman>
I only have a ged and I want to make 100k a year as a rails dev. am I asking for too much?
<Radar>
!8ball
<helpa>
Signs point to yes.
<Radar>
HELPA HAS SPOKEN
<Radar>
EricCartman: how much experience do you have with Rails?
DerisiveLogic has quit [Ping timeout: 255 seconds]
<EricCartman>
just learned it. I'm about to go to a programming boot camp will that help my chances?
Xiti has quit [Ping timeout: 250 seconds]
<Radar>
Which programming boot camp?
joonty has joined #ruby
<EricCartman>
coding dojo
<Radar>
glhf trying to find a $100k job immedately.
krz has joined #ruby
<sevenseacat>
100k out of the box?
<EricCartman>
is that a lot?
<Radar>
Unless you move to SF in which case > 50% of that would be going towards rent
<Radar>
EricCartman: With no experience? Yes, that's a lot.
BradPitt has quit [Ping timeout: 245 seconds]
<flughafen>
hey guys sevenseacat certainty shevy
<sevenseacat>
if you find somewhere offering 100k jobs, let me know plz? :)
<EricCartman>
can't I live in homeless shelters?
<Radar>
You can expect probably around the 65k mark
<flughafen>
EricCartman: i don't have a degree and i make really good money. it's possible, you just need to work a lot.
<EricCartman>
do you have a ged?
<flughafen>
EricCartman: no, just a regular high school diploma, but I did bad in high school and never went to college
<Radar>
I don't have a ged and I didn't go to uni
<Radar>
I make more than 100k :)
codecop has joined #ruby
<EricCartman>
wait you didn't graduate high school?
<Radar>
I didn't go to your American high schools
<Radar>
What I do have is 9 years experience in Ruby and Rails.
* sevenseacat
pokes textual a bit for being silly
cocotton has joined #ruby
<eam>
Radar: it's not that expensive in the SF bay area
<EricCartman>
after how many years would you say your skills plateaued?
<eam>
also uh, for six figure jobs try just about anywhere around SF
juanpaucar has joined #ruby
fabrice31 has joined #ruby
<sevenseacat>
i dont think they do plateau
<EricCartman>
I think they do
<sevenseacat>
you think wrong
fabrice31 has quit [Read error: Connection reset by peer]
<EricCartman>
you stop noticing the huge wall you're facing and can pick up advanced topics like a breeze. I consider that a plateau
aufi has joined #ruby
fabrice31 has joined #ruby
jgrevich has quit [Ping timeout: 256 seconds]
sohrab has quit [Quit: leaving]
<sevenseacat>
if that actually existed, it might be considered one
jgrevich has joined #ruby
jgrevich has quit [Client Quit]
<EricCartman>
you stop noticing the struggle that you had when you initially struggled
<sevenseacat>
the more you learn, the more you realize how much there is to learn
<EricCartman>
it exists in every field
<flughafen>
sevenseacat: +1
zorak8 has quit [Ping timeout: 272 seconds]
* Radar
microwaves some popcorn
* sevenseacat
goes back to poking at installing mysql on windows
<EricCartman>
I realize that but how long did it take you to stop having your hand held by others?
<eam>
gonna suggest that the work plateau occurs after reaching financial independence
<flughafen>
sevenseacat: windows? i'm so sorry
cocotton has quit [Ping timeout: 250 seconds]
<EricCartman>
because right now I am still learning a lot, but I know that with time I will learn everything about rails
rshetty has quit [Remote host closed the connection]
<solars>
trying different combinations now..
mengu has quit [Remote host closed the connection]
julieeharshaw has quit [Ping timeout: 240 seconds]
<solars>
the ._? method only returns self
ponga has quit [Remote host closed the connection]
<solars>
ah you're probably right
julieeharshaw has joined #ruby
<solars>
.blank? is: respond_to?(:empty?) ? empty? : !self
vtunka has joined #ruby
<solars>
so I get !nil
gaboesquivel has joined #ruby
Cloudhand has quit [Ping timeout: 244 seconds]
avril14th has quit [Remote host closed the connection]
jottr_ has quit [Ping timeout: 252 seconds]
quimrstorres has quit [Remote host closed the connection]
gaboesquivel has quit [Ping timeout: 250 seconds]
toretore has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
vtunka has quit [Ping timeout: 256 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kp666 has joined #ruby
bricker has quit [Ping timeout: 246 seconds]
rkazak has left #ruby [#ruby]
systemd0wn has quit [Remote host closed the connection]
systemd0wn has joined #ruby
kp666 has quit [Max SendQ exceeded]
kp666 has joined #ruby
robert_ has joined #ruby
shoutsid has quit [Remote host closed the connection]
<robert_>
is there a kind of stream object for binary files that are generated in memory? (that is, not saved to disk.)
relix has joined #ruby
oo_ has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
<apeiros>
robert_: String
<apeiros>
and/or StringIO if you need an IO interface
<robert_>
ah, StringIO works for binary too?
<apeiros>
why would it not?
mclee_ is now known as mclee
<robert_>
well, binary is usually "Oh, you need a FileIOLikeObject" for that kind of thing.
Morkel has quit [Quit: Morkel]
<apeiros>
ruby ain't java :-p
lidenskap has quit [Remote host closed the connection]
<robert_>
but I suppose ass-u-me :p
<apeiros>
just make sure you set your encodings correctly.
lidenskap has joined #ruby
<robert_>
apeiros: My whole thing is that I'm going to be using sendgrid's web api for mail delivery and they don't let you attach dynamic files after the Mail object is created.
shoutsid has joined #ruby
<apeiros>
I don't even know what a dynamic file is supposed to be :)
<robert_>
that is
blackmesa has quit [Ping timeout: 240 seconds]
<robert_>
add_attachment wants a file on the disk; it doesn't support streams or anything.
<apeiros>
ah, such APIs are annoying
<apeiros>
check its code
khebbie has joined #ruby
<apeiros>
it has to read the file somehow too and process it as a string.
lidenskap has quit [Remote host closed the connection]
adac has joined #ruby
<robert_>
I meant that it doesn't support add_file_attachment vs add_attachment, where add_attachment accepts arbitrary data.
<robert_>
it wants you to pass that in when composing the object.
<adac>
Does someone know ho to transform a "RGeo::Geographic::SphericalMultiPolygonImpl" object into geojson Multipolygon?
shoutsid has quit [Remote host closed the connection]
fabrice31 has joined #ruby
<apeiros>
robert_: and I still mean the same. look at the method's code.
ponga has joined #ruby
Mezjin has joined #ruby
<apeiros>
adac: I'm pretty sure everybody else has to look at the docs just the same as you…
<robert_>
I know, and I'll to use StringIO for that.
ponga has quit [Remote host closed the connection]
khebbie has quit [Ping timeout: 256 seconds]
vtunka has joined #ruby
<vulix>
I have a question of practicality - if I write some data science tools in Ruby do you guys think they will actually be useful, or pointless since python and java have so many libraries already?
serivich has joined #ruby
<apeiros>
vulix: if you can make use of them, they're useful
timonv has joined #ruby
<vulix>
well my work flow is already in java and python, I just prefer to replace the python part with ruby >)>
<apeiros>
and "language X already has Y" was never a good reason not to write something. otherwise we could just stop writing ruby altogether.
<vulix>
true
<apeiros>
(and would probably write COBOL or whatever came before that)
rshetty has joined #ruby
sevenseacat has quit [Quit: Me dun like you no more.]
iamninja_ has quit [Read error: Connection reset by peer]
<vulix>
sometimes I just worry ruby isnt being used for anything outside of rials
<apeiros>
it is
iamninja_ has joined #ruby
<apeiros>
with regards to sciences, I often read bio/genetic related stuff here
AlexRussia has quit [Quit: WeeChat 1.2-dev]
<vulix>
Ok speaking of bio, bioruby seems like a dead project?
timonv has quit [Client Quit]
vtunka has quit [Ping timeout: 250 seconds]
n008f4g_ has joined #ruby
timonv_ has joined #ruby
<apeiros>
no idea, I'm not a biologist
Joufflu has quit [Ping timeout: 245 seconds]
oo_ has quit [Remote host closed the connection]
towski_ has joined #ruby
tkuchiki_ has joined #ruby
towski_ has quit [Remote host closed the connection]
<apeiros>
if you're using a reasonably new ruby, the `gem` command comes with ruby.
oo_ has joined #ruby
<apeiros>
(+ if you use a reasonable package manager…)
<adaedra>
Your system should provide it, but sometimes ruby and rubygems are separate packages.
<adaedra>
Otherwise, use rvm or rbenv which will setup a recent ruby for you and are able to manage multiple ruby versions at the same time if your need.
<thecoolguy>
Ah, i see
postmodern has quit [Quit: Leaving]
ponga has joined #ruby
zenspider has quit [Ping timeout: 240 seconds]
OnBrokenWings has quit [Ping timeout: 272 seconds]
tubuliferous_ has joined #ruby
OnBrokenWings has joined #ruby
CloCkWeRX has joined #ruby
Mezjin has joined #ruby
doodlehaus has joined #ruby
Zai00 has joined #ruby
Aswebb_ has quit [Remote host closed the connection]
doodlehaus has quit [Remote host closed the connection]
fabrice31 has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tubuliferous_ has quit [Ping timeout: 276 seconds]
zenspider has joined #ruby
fabrice31 has joined #ruby
n008f4g_ has quit [Ping timeout: 264 seconds]
vickleton has quit [Ping timeout: 252 seconds]
Igorshp has quit [Remote host closed the connection]
shoutsid has quit [Remote host closed the connection]
shredding has joined #ruby
shoutsid has joined #ruby
shoutsid has quit [Remote host closed the connection]
simonewestphal_ has quit [Quit: simonewestphal_]
iotouch has quit [Quit: This computer has gone to sleep]
serivich has quit [Read error: Connection reset by peer]
lxsameer has quit [Quit: Leaving]
mengu has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
anaeem1 has joined #ruby
tkuchiki_ has joined #ruby
neanderslob has quit [Read error: Connection reset by peer]
seal has joined #ruby
jottr_ has joined #ruby
seal has quit [Read error: Connection reset by peer]
anaeem1 has quit [Client Quit]
Cust0sL1men has joined #ruby
tkuchiki has quit [Ping timeout: 245 seconds]
yaw has joined #ruby
Nahra has quit [Remote host closed the connection]
shoutsid has joined #ruby
RegulationD has joined #ruby
Nahra has joined #ruby
quimrstorres has joined #ruby
shoutsid has quit [Remote host closed the connection]
User458764 has joined #ruby
Guest26625 has quit [Remote host closed the connection]
Nahra has quit [Remote host closed the connection]
jottr_ has quit [Ping timeout: 252 seconds]
bim has joined #ruby
bim is now known as Guest42124
RegulationD has quit [Ping timeout: 250 seconds]
Darkwater has joined #ruby
doodlehaus has joined #ruby
shellfu_afk is now known as shellfu
oo_ has quit [Remote host closed the connection]
shellfu has quit [Remote host closed the connection]
vdamewood has joined #ruby
mdw has joined #ruby
tkuchiki_ has quit [Remote host closed the connection]
juanpablo__ has joined #ruby
rshetty_ has joined #ruby
vdamewood has quit [Max SendQ exceeded]
krz has quit [Ping timeout: 256 seconds]
zcreative has joined #ruby
rshetty has quit [Ping timeout: 265 seconds]
fabrice31 has quit [Remote host closed the connection]
<ruboto>
jhass # => 757: unexpected token at '{"foo": "bar' (JSON::ParserError) ...check link for more (https://eval.in/318276)
<jhass>
looks like the answer is yes, it can't
Mohan has joined #ruby
Mohan is now known as Guest29575
<jhass>
?pry Darkwater
<ruboto>
Darkwater, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<jhass>
and is super awesome for such experiments ;)
kp666 has quit [Remote host closed the connection]
shoutsid has quit [Remote host closed the connection]
<Devoth>
Hey folks!. How can I set another character for :undef replacement in this chunk of code: str.encode!( "iso-8859-2", "utf-8", :invalid => :replace, :undef => :replace) ?
gfawcettpq has joined #ruby
ramfjord has quit [Ping timeout: 265 seconds]
a5i has joined #ruby
livathinos has quit [Ping timeout: 250 seconds]
Igorshp has joined #ruby
Mezjin has quit [Remote host closed the connection]
lessless has quit [Ping timeout: 264 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
shellfu is now known as shellfu_afk
<Devoth>
ii I do str.encode!( "iso-8859-2", "utf-8", :invalid => :replace, :undef => '') it throws an error
<mikecmpbll>
Devoth: have you looked at the docs? :)
<mikecmpbll>
look at the options listed under `encode`
yeticry has quit [Ping timeout: 265 seconds]
DEA7TH has joined #ruby
mdw has quit [Ping timeout: 264 seconds]
<Devoth>
So I tried to do :undef => '' (so undefined characters are deleted)
<mikecmpbll>
no, you didn't read it
<Devoth>
Is that how I'm supposed to do it?
yeticry has joined #ruby
<mikecmpbll>
look at all the options
Askilada has joined #ruby
jenrzzz has joined #ruby
<Askilada>
Hi, is it possible to make the Time class, be relative to the unix timestamp instead of 1823-11-12
<mikecmpbll>
Askilada: ?
<Askilada>
mikecmpbll: yeah
lidenskap has joined #ruby
<Darkwater>
jhass: cool, thanks
rodfersou has joined #ruby
<Askilada>
mikecmpbll: It's because, then you use, Time object in MongoDB, it will give me the seconds from 1823-11-12 , and not Feb. 1. 1970
<mikecmpbll>
Askilada: code pls, no idea what you're on about
sevenseacat has joined #ruby
<Darkwater>
also pry looks cool
<Askilada>
mikecmpbll: give me two min, then I'll make a pastebin
<mikecmpbll>
Askilada: Time.new.to_i produces a unix timestamp, Time.at(131243243) parses one
<Devoth>
mikecmpbll: ok now I got it - need to define :replace in the same array(hash)… but to be honest if you didn't explicitly say the answer is there I wouldn't figure it out on my own. This is really awkward concept for someone coming from PHP ;)
<mikecmpbll>
Devoth: you got it
<Devoth>
mikecmpbll: thanks man
<mikecmpbll>
Devoth: you wouldn't have got it? why, you did get it?
<mikecmpbll>
lol..
claw has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
<Devoth>
mikecmpbll: dunno exactly It's a bit different approach to what I'm used to I guess
lidenskap has quit [Ping timeout: 250 seconds]
<mikecmpbll>
Devoth: the only approach you need to know is the 'read the docs' approach :)
<mikecmpbll>
and you've mastered that now. so go forth and conquer (ruby style)
rshetty has joined #ruby
<Devoth>
mikecmpbll: if the docs / languages had the same conventions it would be easy, sometimes it requires switching to a different mindset, like e.g. when I'm digging through bash manual - so hard to understand. Ruby docs are somewhere between that and php (php as easy ;) )
shoutsid has joined #ruby
<mikecmpbll>
Devoth: fair enough. maybe i'm too familiar with the ruby docs to see the trouble but it seems pretty clearly laid out to me
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<mikecmpbll>
thanks for the gist, ruboto ;)
doodlehaus has quit [Remote host closed the connection]
<Askilada>
Ups sorry :(
<Askilada>
Don't hate me, first time in this room
<Askilada>
Thanks ruboto
<Askilada>
Hope you can see my idear
dhvxox has quit [Ping timeout: 256 seconds]
sigurding has joined #ruby
_lovehandle_ has quit [Ping timeout: 265 seconds]
fabrice31 has joined #ruby
surs1 has joined #ruby
<mikecmpbll>
Askilada: you've not shown the code that converts the DateTime/Time objects to the floats that you have in your output
bkxd has quit [Ping timeout: 256 seconds]
<mikecmpbll>
Askilada: somewhere in Endpointresult.collection.aggregate i would imagine.
<Askilada>
Yes, but if you try to take the number in the created, you'll se a greater then number, which not match the unix timestamp for that date
surs has quit [Ping timeout: 245 seconds]
<mikecmpbll>
Askilada: yeah, but i don't know how that number is produced
timonv_ has quit [Quit: Leaving...]
<mikecmpbll>
Askilada: also, the origin of your problem might be with: time.to_time - 7.days.ago
<mikecmpbll>
you probably want time.to_time - 7.days
barkerd427 is now known as zz_barkerd427
<mikecmpbll>
or simply 7.days.ago, depending on exactly what you want.
ugyqrs has joined #ruby
shredding has quit [Ping timeout: 256 seconds]
<Askilada>
Ohh the number should be all right, and the date as well. When i use the MongoDB query in my CLI i got the right result, but, its like, Time is as documentated returning the time sence 1823-11-12, and are build up on the unsigned bugnumber, instead of unsigned integer, so i don't get the unix timestamp, that mongodb want
<mikecmpbll>
Askilada: what you're actually getting with your code, is the number of seconds in 7 days, with float precision errors
Darkwater has left #ruby ["so much to do, so much to see"]
<Askilada>
It's more like an mongo-driver error, no help in #mongodb, so I was looking for how to make the number start from the unix Epoch. But what I'm trying to do it just use my Time object in my mongodb.collection agg
abyss has quit [Remote host closed the connection]
duncannz has quit [Read error: Connection reset by peer]
<mikecmpbll>
Askilada
<mikecmpbll>
oops. Askilada: i think you're missing the point
<mikecmpbll>
because your example code is completely broken
<Askilada>
mikecmpbll: It's an itteration of my code, but yeah. I have used the last 3 hours searching on google, that's why I'm here now
<mikecmpbll>
Askilada: did you read what i said about your error in your code?
DEA7TH has quit [Ping timeout: 252 seconds]
<mikecmpbll>
because i'm not understanding what in your example is a "problem", it all looks to run exactly as expected to me (and nothing to do with Time's epoch)
phutchins has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
Guest42124 has quit [Remote host closed the connection]
Spami has joined #ruby
juanpaucar has joined #ruby
giuseppesolinas has quit [Quit: Leaving]
timonv_ has joined #ruby
<Askilada>
mikecmpbll: I found this earlier today: http://qnalist.com/questions/5225253/how-to-set-an-isodate-via-set-operation-with-ruby-driver, which descripe my problem pretty well. In the response. A quate "The Ruby driver uses Ruby's built in Time class for representing ISODate types from MongoDB. In your own code, just use Ruby's Time class and the driver will take care of serializing and deserializing this data for you." But i just got way more seconds
<Askilada>
while doing it this way
hiyosi has joined #ruby
timonv_ has quit [Remote host closed the connection]
<mikecmpbll>
Askilada: i'm not going to help you unless you can provide your own debugging which demonstrates some problem
<mikecmpbll>
sorry, good luck though.
chinmay_dd has joined #ruby
krz has joined #ruby
Raboo has joined #ruby
<Askilada>
mikecmpbll: Okay, I'll see what i can do
<Askilada>
thanks
lolmaus has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
jimms has quit [Read error: Connection reset by peer]
bim has joined #ruby
jimms has joined #ruby
edwinvdgraaf has joined #ruby
zz_Outlastsheep is now known as Outlastsheep
bim is now known as Guest91172
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
simonewestphal has joined #ruby
juanpaucar has quit [Ping timeout: 264 seconds]
timonv_ has joined #ruby
timonv_ has quit [Client Quit]
timonv has joined #ruby
mengu has joined #ruby
plutonic has joined #ruby
krz has quit [Ping timeout: 250 seconds]
piotrj has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
vtunka has joined #ruby
nfk has joined #ruby
piotrj has quit [Remote host closed the connection]
surs1 has quit [Ping timeout: 250 seconds]
ldnunes has joined #ruby
piotrj has joined #ruby
shoutsid has quit [Remote host closed the connection]
<Devoth>
apeiros: I 'cant run HTMLEntities on every char in the text, as some shouldn't be replaced (if that is what you mean)
Pumukel has joined #ruby
<apeiros>
Devoth: that's not what I mean. I mean you can drop the special_chars.each.
<Devoth>
apeiros: I was wondering if gsub can take pattern parameter as array, but it doesn't seem so ;)
<apeiros>
and the other thing I mean is that I expect a method to exist in HTMLEntities, where you can replace your entire code from above with just `HTMLEntities.<magic method>(string_with_weird_chars)`
Mohan_ has joined #ruby
cocotton has quit [Ping timeout: 240 seconds]
<Devoth>
apeiros: ok thanks, will look at these :)
mjuszczak has quit [Read error: Connection reset by peer]
mjuszcza_ has joined #ruby
gaboesquivel has joined #ruby
sinkensabe has quit [Remote host closed the connection]
krz has quit [Ping timeout: 250 seconds]
gaboesquivel has quit [Client Quit]
zorak8 has joined #ruby
Igorshp has quit [Remote host closed the connection]
Rapier- has joined #ruby
rshetty has joined #ruby
piotrj has joined #ruby
Igorshp has joined #ruby
scripore has joined #ruby
joonty has quit [Quit: joonty]
bim has joined #ruby
bim is now known as Guest752
iotouch has joined #ruby
zorak8 has quit [Ping timeout: 272 seconds]
dvlwrk has joined #ruby
joonty has joined #ruby
dstarh has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
rshetty has quit [Read error: Connection reset by peer]
rshetty has joined #ruby
<izzol>
hi guys
ixti has joined #ruby
User458764 has joined #ruby
vdamewood has quit [Quit: Computer has gone to sleep.]
<apeiros>
what do you think happens when you add an integer to a float?
Mohan is now known as Guest96183
JDiPierro has joined #ruby
* apeiros
really wants those "IT 101 knowledge" articles up…
cefkamcau has joined #ruby
<jhass>
s/IT/CS/ you mean :)
OnBrokenWings has quit [Quit: Leaving]
<apeiros>
jhass: no, it's totally internet technology!
<glen>
i've written asm in early 90's, but didn't get into internals of float, so never deeply understood how it's layed into memory
<apeiros>
(at least I think I misread that this is code which is intended for teaching)
<jhass>
WS
griffindy has joined #ruby
<jhass>
webscale 101
lkba has joined #ruby
<apeiros>
ooooooh
<apeiros>
yessir
<glen>
ok. my final snip: puts "progress: #{(updated.to_f/total*100).round(2)}% updated=#{updated} total=#{total}"
piotrj has quit [Remote host closed the connection]
<jhass>
glen: it's worthwhile to investigate, check my link
<apeiros>
glen: in short - when you add an integer to a float, ruby will coerce the integer to a float. so you're not really adding an integer to a float - you're adding a float to a float. and get a float as a result.
tus has joined #ruby
<apeiros>
and hence have to deal with all the issues floats have.
piotrj has joined #ruby
Pupeno has quit [Quit: Leaving...]
sankaber has joined #ruby
<glen>
but i think adding float another float whose value is full integer, there won't be "loss". that's my point
<apeiros>
it is correct that integers can be represented by floats up to a relatively large value
ixti has joined #ruby
<apeiros>
my point that it's a bad habit/smell still stands
mjuszczak has joined #ruby
elaptics_away is now known as elaptics
Igorshp has quit [Remote host closed the connection]
blackmesa has joined #ruby
mjuszcza_ has quit [Ping timeout: 272 seconds]
mengu has joined #ruby
fgo has joined #ruby
<a5i>
If I have 2 similar hashes, and I want to find the difference (IE return the extra hash included in x hash and not in y array) how can I go about doing that?
doodlehaus has joined #ruby
<toretore>
what
<a5i>
y hash*
<c355E3B>
a5i: you can get and compare the keys
quimrstorres has joined #ruby
glen has left #ruby [#ruby]
<a5i>
hmm
<apeiros>
a5i: use Hash#keys to get the keys
mjuszcza_ has joined #ruby
<toretore>
a5i: you need to be more specific about the result you want
<apeiros>
a5i: use Array#& to find common keys, Array#- to find differences (in both directions)
mjuszczak has quit [Read error: Connection reset by peer]
ylluminarious has joined #ruby
a346 has joined #ruby
juanpaucar has joined #ruby
Xiti has quit [Quit: Xiti]
jimms has quit [Read error: Connection reset by peer]
claptor has quit [Quit: this channel is bakas]
fgo has quit [Ping timeout: 250 seconds]
jimms has joined #ruby
Xiti has joined #ruby
lfox has joined #ruby
mjuszcza_ has quit [Client Quit]
lfox has quit [Client Quit]
tonyhb has joined #ruby
mengu has quit []
catphish has left #ruby ["Leaving"]
juanpaucar has quit [Ping timeout: 252 seconds]
Igorshp has joined #ruby
dudedudeman has quit [Changing host]
dudedudeman has joined #ruby
Aswebb_ has quit [Remote host closed the connection]
Pumukel has quit [Ping timeout: 244 seconds]
User458764 has joined #ruby
kstuart has quit [Quit: WeeChat 1.1.1]
terlar has quit [Ping timeout: 256 seconds]
shazaum has joined #ruby
piotrj has quit [Remote host closed the connection]
piotrj has joined #ruby
Guest96183 has quit [Ping timeout: 276 seconds]
jerius has joined #ruby
agarie has joined #ruby
sigurding has quit [Ping timeout: 256 seconds]
mjuszczak has joined #ruby
Mohan_ has joined #ruby
mary5030 has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 256 seconds]
uri has joined #ruby
sigurding has joined #ruby
mary5030 has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<a5i>
oh what !
piotrj has quit [Ping timeout: 244 seconds]
User458764 has joined #ruby
tubuliferous_ has joined #ruby
devans_ has joined #ruby
jimms has quit [Ping timeout: 264 seconds]
krz has joined #ruby
Aswebb_ has joined #ruby
jimms has joined #ruby
piotrj has joined #ruby
edwinvdgraaf has joined #ruby
tubuliferous_ has quit [Ping timeout: 245 seconds]
<a5i>
is there Hash#- ?
piotrj has quit [Remote host closed the connection]
decoponio has joined #ruby
iotouch has joined #ruby
allcentury has joined #ruby
<adaedra>
The doc should reply to your answer.
<adaedra>
to your question*.
RegulationD has joined #ruby
paulcsmith has joined #ruby
krz has quit [Ping timeout: 248 seconds]
piotrj has joined #ruby
terlar has joined #ruby
mtakkman has joined #ruby
coderhs has quit [Ping timeout: 248 seconds]
diego4 has joined #ruby
jimms has quit [Remote host closed the connection]
Feyn has quit [Quit: Leaving]
RegulationD has quit [Ping timeout: 245 seconds]
diegoviola has quit [Ping timeout: 250 seconds]
catphish has joined #ruby
<catphish>
is there a trivial way to map integers to weekdays like 0=>"Monday"
<catphish>
or am i better off just making a hash
tonyhb has quit [Quit: peace]
ndrei has joined #ruby
Askilada has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<c355E3B>
catphish: DateTime#strftime may be what your looking for
sevenseacat has quit [Quit: Me dun like you no more.]
JDiPierro has quit [Remote host closed the connection]
<tjbiddle>
Hey all. If I have an array of [['abc', '123], ['abc', '']] how would I go about returning only the unique objects going by the first column, yet ensuring that the second column is not empty or nil?
DerisiveLogic has joined #ruby
<tjbiddle>
Using Array#uniq just returns whichever comes up first
<tjbiddle>
Just using it without passing a block, at lest
<tjbiddle>
least*
edwinvdg_ has joined #ruby
jerius has quit [Quit: /part]
<jhass>
so that means if you have ["def", ""] without any other ["def", "123"] you still want the empty one?
<tjbiddle>
No, I want the non-empty one
<tjbiddle>
So if I have [['abc', '123'], ['abc', ''], ['def', '123]] it would return the two with '123' in the second column
workmad3 has joined #ruby
Channel6 has joined #ruby
<dudedudeman>
Man, i feel like i was just reading about this in the prag prog book last night
<jhass>
so you're guaranteed to have a non-empty one?
simonewestphal has quit [Quit: simonewestphal]
edwinvdg_ has quit [Remote host closed the connection]
mrmargolis has joined #ruby
tesuji has quit [Ping timeout: 264 seconds]
<tjbiddle>
jhass: Hm. I mean - edge case, there could be an option where it's empty and that's the only option, but I was told to assume otherwise. So yes
hanmac1 has joined #ruby
<jhass>
so just get rid of the empty ones first
riotjones has quit [Remote host closed the connection]
<tjbiddle>
dudedudeman: I think compact only removes nil entries
<dudedudeman>
tjbiddle: word. i'm going to go do some reading on all of the above
<tjbiddle>
jhass: That works then, thanks!
jottr_ has joined #ruby
chrissonar has quit [Remote host closed the connection]
mitchellhenke has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
ki0 has quit [Remote host closed the connection]
ki0 has joined #ruby
Igorshp has quit [Remote host closed the connection]
<tjbiddle>
jhass: Hm, actually thinking about it again - There is a case where I'd have an empty second column make sense.
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rhllor has joined #ruby
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sigurding has quit [Quit: sigurding]
_lovehandle_ has quit [Ping timeout: 255 seconds]
tonyhb has quit [Quit: peace]
mgberlin has joined #ruby
mgberlin has quit [Remote host closed the connection]
MasterPiece has joined #ruby
astrobunny has joined #ruby
<jhass>
can't you parse into a desired format?
<jhass>
like a hash and you only override an empty value?
<jhass>
hash[header] = value if hash[header].nil? || hash[header].empty? ?
<jhass>
if not do ^ in a .each_with_object({}) do |header, value|
piotrj has quit [Remote host closed the connection]
_lovehandle_ has joined #ruby
<jhass>
and call to_a on the result if you absolutely have to keep the 2d array for some strange reason
thatslifeson has quit [Remote host closed the connection]
lfox has joined #ruby
fryguy9 has joined #ruby
relix has joined #ruby
pacMakaveli has joined #ruby
iasoon has quit [Ping timeout: 252 seconds]
shellfu_afk is now known as shellfu
<tjbiddle>
jhass: I like the idea of a hash. I think this is working: When creating the initial array, making it to an array of hashes as you suggested, rather than array of arrays. Then just calling uniq
<jhass>
that's not what I meant, but maybe I don't get your usecase fully
JDiPierro has joined #ruby
plutonic has quit [Quit: plutonic]
kaleido has joined #ruby
avelldiroll has quit [Remote host closed the connection]
fabrice31 has quit [Remote host closed the connection]
<ruboto>
tjbiddle # => /tmp/execpad-bef64f13c7dd/source-bef64f13c7dd:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/318369)
evanjs has quit [Remote host closed the connection]
terlar has quit [Read error: Connection reset by peer]
nfk|laptop has joined #ruby
zcreative has quit [Ping timeout: 245 seconds]
ssyrain has joined #ruby
juanpaucar has joined #ruby
<tjbiddle>
jhass: Nice :)
<tjbiddle>
Thanks for helping me work through it
aganov has quit [Remote host closed the connection]
<hanmac1>
hm instead of Array of Hashs you might also use an Array of Struct or OpenStruct objects
<tjbiddle>
hanmac: Why's that
mistermocha has quit [Ping timeout: 246 seconds]
juanpaucar has quit [Ping timeout: 276 seconds]
havenwood has joined #ruby
iotouch has quit [Quit: 离开]
alex88 has quit []
n008f4g_ has quit [Ping timeout: 245 seconds]
rshetty has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
vasilakisfil__ has joined #ruby
rshetty has joined #ruby
vasilakisfil_ has quit [Ping timeout: 265 seconds]
Lewix has quit [Remote host closed the connection]
rhllor has quit [Read error: Connection reset by peer]
riotjones has joined #ruby
ringarin has quit [Quit: Leaving]
thatslifeson has joined #ruby
thiagovsk has joined #ruby
baroquebobcat has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
jimms has joined #ruby
grios has joined #ruby
ReK2 has quit [Changing host]
ReK2 has joined #ruby
ReK2WiLdS has joined #ruby
ReK2WiLdS has quit [Changing host]
livathinos has quit []
cassianoleal has quit [Quit: (null)]
tubuliferous_ has joined #ruby
riotjones has quit [Ping timeout: 264 seconds]
dvlwrk has joined #ruby
segfalt has joined #ruby
ponga has quit [Remote host closed the connection]
tonyhb has joined #ruby
i8igmac has quit [Ping timeout: 246 seconds]
icebourg has joined #ruby
evanjs has quit [Remote host closed the connection]
sevvie has quit [Ping timeout: 240 seconds]
luser__ has joined #ruby
<luser__>
Hi.
<dudedudeman>
sup
<luser__>
Got a 'small' problem
evanjs has joined #ruby
tubuliferous_ has quit [Ping timeout: 245 seconds]
<luser__>
Is there any ruby function that would allow me to filter array of objects, eg order.supplier_orders (supplier orders is that array of objects) by object property?
<luser__>
(order.supplier_orders.where(supplier_id: params[:supplier_id])) this wouldn't work obviously, because of 'where', but is there any way to replace it?
rhllor has joined #ruby
i8igmac has joined #ruby
RegulationD has joined #ruby
terlar has joined #ruby
jottr_ has joined #ruby
adac has quit [Ping timeout: 250 seconds]
ramfjord has joined #ruby
redbaritone has joined #ruby
robustus has quit [Ping timeout: 255 seconds]
redbaritone has quit [Client Quit]
Lewix has joined #ruby
momomomomo has quit [Quit: momomomomo]
GnuYawk has quit [Quit: WeeChat 1.0]
RegulationD has quit [Ping timeout: 250 seconds]
robustus has joined #ruby
agarie has quit [Remote host closed the connection]
<jhass>
luser__: .select, whether that's the best solution to your problem is impossible to tell from your vague description
dseitz has joined #ruby
juanpablo__ has joined #ruby
sigurding has joined #ruby
lordkryss has quit [Quit: Connection closed for inactivity]
sinkensabe has joined #ruby
jaequery has joined #ruby
toretore has quit [Quit: Leaving]
sevvie has joined #ruby
<luser__>
jhass: Ok, will look into it. Thank you.
Cust0sL1men has quit [Ping timeout: 272 seconds]
juanpablo__ has quit [Ping timeout: 250 seconds]
michael_mbp has quit [Excess Flood]
MatthewsFace has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
Crisix has joined #ruby
ssyrain has quit [Remote host closed the connection]
rshetty has joined #ruby
Eiam_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sinkensabe has quit [Ping timeout: 264 seconds]
michael_mbp has joined #ruby
mjuszczak has quit []
momomomomo has joined #ruby
gaussblurinc1 has joined #ruby
sigurding has quit [Quit: sigurding]
<catphish>
luser__: assuming supplier_orders can't be made into a database scope, then .select{|order| order.supplier_id == params[:supplier_id]} might be your best option
kblake has joined #ruby
<gaussblurinc1>
how to include methods from module to class, I want module methods be class methods, not instance methods
rshetty has quit [Ping timeout: 245 seconds]
<gaussblurinc1>
extend will be ok?
<Devoth>
Hey guys, anyone experienced an issue where Thor command line app wasn't running highline ask() methods properly?
<havenwood>
Devoth: What happens when it run improperly?
<catphish>
gaussblurinc1: i've never used extend, but a quick search suggests it does what you want
<Darkwater>
in what scope are symbols' object ids consistent?
mistermocha has joined #ruby
<Darkwater>
I can fire up multiple irb instances and the ids will be consistent, but on my vps it's different
<Devoth>
havenwood: also it completely ignores .in, .default, etc.
<Devoth>
havenwood: same code pastd into irb works flawlessly
<Darkwater>
is it per machine? per machine session?
momomomomo has quit [Ping timeout: 245 seconds]
<jhass>
per process
<jhass>
everything else is a coincidence
<Darkwater>
that's a real coincidence then
Spami has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
anyway, if you depend on the object_id of a symbol you do something wrong ;)
Igorshp has joined #ruby
mrmargolis has quit [Ping timeout: 256 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<catphish>
they may get assigned in a consistent manner for some unknown value of consistent, but i can't think of a legitimate reason to use them like that
tonyhb has quit [Read error: Connection reset by peer]
tonyhb has joined #ruby
segfalt has quit [Ping timeout: 256 seconds]
ascarter has joined #ruby
<catphish>
he's right though, it is amazingly consistent for (for example) :a
<catphish>
in fact, it's no accident, some symbols seem to have constant object IDs even if they haven't been used
ascarter has quit [Max SendQ exceeded]
<catphish>
on my host, ObjectSpace._id2ref(95368) always returns :b even if i never used :b
ascarter has joined #ruby
tonyhb_ has joined #ruby
<catphish>
no idea how it works though
<catphish>
its clearly not portable between hosts, or a solution to any problem that exists though :)
luser__ has quit [Remote host closed the connection]
ascarter has quit [Client Quit]
mleung has joined #ruby
<Devoth>
havenwood: strange thing - I've commented out require "highline/import" line… and it doesn't throw an error. Perhaps something else is overriding ask method (maybe some thor method?)
<Devoth>
havenwood: ok, got a temp solution. Using HighLine.new.ask() instead
ascarter has joined #ruby
tonyhb has quit [Ping timeout: 246 seconds]
<Devoth>
havenwood: thank you :)
<havenwood>
Devoth: de nada, seems you beat me to it ;)
<jhass>
catphish: Darkwater keep in mind that Ruby creates a symbol of the same name when defining a method for example, so the bootup process creates a whole bunch of symbols already
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
ascarter has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
ascarter has quit [Max SendQ exceeded]
unreal_ has quit [Ping timeout: 245 seconds]
ascarter has joined #ruby
mjuszczak has joined #ruby
tus has quit [Remote host closed the connection]
joonty has quit [Quit: joonty]
mitchellhenke has quit [Read error: Connection reset by peer]
ascarter has quit [Max SendQ exceeded]
timonv has quit [Ping timeout: 240 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
thumpba has joined #ruby
tus has joined #ruby
mitchellhenke has joined #ruby
ascarter has joined #ruby
bricker has joined #ruby
cocotton has quit [Remote host closed the connection]
sevvie has joined #ruby
cocotton has joined #ruby
Igorshp has joined #ruby
ascarter has quit [Client Quit]
cocotton has quit [Ping timeout: 272 seconds]
jimms_ has joined #ruby
ItSANg___ has joined #ruby
ItSANgo__ has quit [Read error: Connection reset by peer]
krisquigley has quit [Read error: Connection reset by peer]
krisquigley has joined #ruby
jimms has quit [Read error: Connection reset by peer]
chinmay_dd has quit [Quit: Leaving]
pietr0 has joined #ruby
MasterPiece has quit [Read error: Connection reset by peer]
konsolebox has quit [Ping timeout: 252 seconds]
sankaber has quit [Read error: Connection reset by peer]
mrmargolis has quit [Read error: Connection reset by peer]
<Mon_Ouie>
They're not assigned sequentially in MRI, it's just a simple formula based on whatever address was returned by the allocator
nfk|laptop has quit [Quit: yawn]
sankaber has joined #ruby
cocotton has joined #ruby
mrmargolis has joined #ruby
jaequery has joined #ruby
agarie has joined #ruby
ascarter has joined #ruby
nfk|laptop has joined #ruby
MatthewsFace has joined #ruby
rhllor has joined #ruby
ascarter has quit [Max SendQ exceeded]
pacMakaveli has quit [Remote host closed the connection]
ascarter has joined #ruby
momomomomo has quit [Quit: momomomomo]
momomomomo has joined #ruby
RegulationD has joined #ruby
dANO has quit []
Mon_Ouie has quit [Ping timeout: 245 seconds]
mistermocha has quit [Ping timeout: 265 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shellfu_coffee is now known as shellfu
sevvie has quit [Remote host closed the connection]
psy_ has joined #ruby
relix has joined #ruby
mistermocha has joined #ruby
fabrice31 has quit [Remote host closed the connection]
jimms_ has quit [Read error: Connection reset by peer]
RegulationD has quit [Ping timeout: 265 seconds]
tcrypt has joined #ruby
ramfjord has joined #ruby
sevvie has joined #ruby
rshetty has quit [Remote host closed the connection]
willharrison has quit [Quit: Lost terminal]
RTG` has quit [Ping timeout: 264 seconds]
jimms has joined #ruby
rshetty has joined #ruby
workmad3 has joined #ruby
catphish has left #ruby ["Leaving"]
blizzy has quit [Ping timeout: 245 seconds]
zorak8 has quit [Ping timeout: 252 seconds]
mikecmpbll has joined #ruby
RTG` has joined #ruby
ghr has quit [Ping timeout: 245 seconds]
sohrab has joined #ruby
rshetty has quit [Ping timeout: 246 seconds]
hanmac1 has quit [Quit: Leaving.]
chthon has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
Mohan_ has quit [Ping timeout: 246 seconds]
Pharaoh2 has quit [Read error: Connection reset by peer]
SouL_|_ has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
allcentury has quit [Ping timeout: 245 seconds]
Mohan has joined #ruby
DrCode has quit [Ping timeout: 256 seconds]
ki0 has quit [Ping timeout: 256 seconds]
CorySimmons has joined #ruby
diegoviola has joined #ruby
Mohan is now known as Guest95932
edwinvdgraaf has joined #ruby
rshetty has joined #ruby
rgb-one has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
ag4ve_ has quit [Ping timeout: 245 seconds]
fgo has joined #ruby
edwinvdgraaf has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
bluOxigen has joined #ruby
shoutsid has quit [Remote host closed the connection]
juanpablo__ has joined #ruby
speakingcode has joined #ruby
shoutsid has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jimms has quit [Ping timeout: 250 seconds]
shoutsid has quit [Remote host closed the connection]
_honning_ has joined #ruby
odin22 has joined #ruby
tubuliferous_ has joined #ruby
granthatcher has quit []
jimms has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
Devoth has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
CorySimmons has quit [Quit: Bye!]
juanpaucar has joined #ruby
mistermocha has joined #ruby
blueOxigen has quit [Ping timeout: 245 seconds]
zorak8 has joined #ruby
fgo has quit [Ping timeout: 246 seconds]
zorak8 has quit [Max SendQ exceeded]
juanpablo__ has quit [Ping timeout: 264 seconds]
zorak8 has joined #ruby
tsipanov has joined #ruby
tsipanov has left #ruby [#ruby]
tsipanov has joined #ruby
Timba-as has quit [Quit: Be back later ...]
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scripore has quit [Quit: This computer has gone to sleep]
jimms_ has joined #ruby
jimms has quit [Read error: Connection reset by peer]
The_Phoenix has joined #ruby
OtterCoder has joined #ruby
devans_ has quit [Ping timeout: 252 seconds]
juanpablo__ has joined #ruby
tsipanov has quit [Client Quit]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
juanpaucar has quit [Ping timeout: 248 seconds]
Igorshp has quit [Remote host closed the connection]
jimms_ has quit [Read error: Connection reset by peer]
jimms has joined #ruby
blazes816 has joined #ruby
vickleton has joined #ruby
djmittens has joined #ruby
wallerdev has joined #ruby
juanpablo__ has quit [Ping timeout: 265 seconds]
Filete has joined #ruby
tcrypt has quit [Ping timeout: 264 seconds]
zachrab has quit [Remote host closed the connection]
zachrab has joined #ruby
agarie has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
rbennacer has quit [Remote host closed the connection]
vudew has quit [Quit: Lost terminal]
juanpablo__ has joined #ruby
drocsid has quit [Ping timeout: 255 seconds]
ahmetkapikiran has quit [Ping timeout: 272 seconds]
ascarter has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
ascarter has quit [Client Quit]
terlar has quit [Ping timeout: 255 seconds]
Pharaoh2 has joined #ruby
lkba_ has joined #ruby
jcutrell has joined #ruby
<a5i>
How can I check if a file exists or not?
gaussblurinc1 has quit [Quit: Leaving.]
<jcutrell>
a5i: my guess is File.exists? is what you’re probably needing.
<a5i>
o
<jcutrell>
File.exists? "Gemfile"
<jcutrell>
(If it’s in the cwd)
lkba has quit [Ping timeout: 272 seconds]
sufyan has quit [Remote host closed the connection]
<Senjai>
jcutrell: Gotta point those questioins towards google :P
workmad3 has quit [Ping timeout: 256 seconds]
ascarter has joined #ruby
<jcutrell>
You can also use this to get the absolute path of the current dirname: File.expand_path File.dirname(__FILE__)
<jcutrell>
Senjai: yeah, I suppose so.
<Senjai>
a5i: That is one of those "first result" questions on google. Google "How to check if a file exists in ruby"
<Senjai>
guarenteed first result
<Senjai>
I havent even checked, im that confident
<a5i>
Yeah your right, I just didnt know how to word the search
<jcutrell>
a5i learning how to google right is definitely a skill in and of itself. :)
<jcutrell>
Now you know.
<a5i>
ok, thanks anyway
ascarter has quit [Max SendQ exceeded]
<jcutrell>
Glad to help.
<Senjai>
a5i: We're all here to help, but googling is necssary to learn
<a5i>
okay
<Senjai>
Its kind of upsetting to get askes a question that would have been answered by a quick google search
ascarter has joined #ruby
lkba_ has quit [Ping timeout: 256 seconds]
wottam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nfk|laptop has quit [Quit: yawn]
<jhass>
a5i: jcutrell modern ruby has __dir__ for File.dirname(__FILE__)
<jcutrell>
Ah yes.
edwinvdgraaf has joined #ruby
<jcutrell>
Modern as in <=2.1 ?
<jhass>
2.0+
<havenwood>
jcutrell: 2.0.0
scripore has joined #ruby
<jhass>
so by now every officially supported ruby version
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mjuszcza_ has joined #ruby
nfk|laptop has joined #ruby
<havenwood>
jcutrell: Ruby 2.0 is in maintenance mode until it's end-of-life this February and 2.1 and 2.2 are fully supported releases.
ponga has joined #ruby
<jcutrell>
Good deal.
shoutsid has joined #ruby
<havenwood>
s/it's/its
mjuszczak has quit [Ping timeout: 272 seconds]
sevvie has quit [Ping timeout: 248 seconds]
User458764 has joined #ruby
<Senjai>
s/its/its'
<Senjai>
i think <.< >.> #ijustwantedtocontribute
Eiam_ has joined #ruby
<havenwood>
oh right, possessive
allcentury has joined #ruby
agarie has joined #ruby
<havenwood>
i think i'm waffling between "it's (it is) end-of-lifed" and "it's (possessive) end-of-life." I don't even know what I was thinking with "its." :O
ndrei has joined #ruby
MasterPiece has joined #ruby
Lewix has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
DerisiveLogic has quit [Ping timeout: 264 seconds]
rdark has quit [Quit: leaving]
piotrj has joined #ruby
<bricker>
"its" is possessive.
rshetty has quit [Remote host closed the connection]
<bricker>
"its'" is just you typing 4 characters when you only need to type 3
ValicekB has quit []
vim_shimm has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
kirun has joined #ruby
AlphaAtom has quit [Ping timeout: 244 seconds]
<xxneolithicxx>
wth, its' is a thing?
<havenwood>
bricker: oh right
<havenwood>
bricker: it's like i have negative coffee this morning
<havenwood>
i'm two cups in and feel like i'm at -1, so musta started at -3
rshetty has joined #ruby
<bricker>
xxneolithicxx: no
<bricker>
xxneolithicxx: it's = "it is". its = everything else.
tvw has joined #ruby
lfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rbennacer has joined #ruby
Mezjin has quit [Remote host closed the connection]
sankaber has joined #ruby
allcentury has quit [Ping timeout: 244 seconds]
diegoviola has quit [Ping timeout: 255 seconds]
<shevy>
ohhhh
<shevy>
bricker is teaching ze people ze english!
ramfjord has quit [Ping timeout: 264 seconds]
<shevy>
bricker have you seen Conan, or Red Sonja? What can you say about the old accent by Arnie? :)
zz_Outlastsheep is now known as Outlastsheep
hollywood has joined #ruby
shoutsid has quit [Remote host closed the connection]
<bricker>
*impeccable*
rrichardsr3 has joined #ruby
ValicekB has joined #ruby
nfk|laptop has quit [Ping timeout: 250 seconds]
vim_shimm has quit [Ping timeout: 250 seconds]
rrichardsr3 has quit [Client Quit]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lidenskap has joined #ruby
diegoviola has joined #ruby
Brozo has joined #ruby
jaequery has joined #ruby
rshetty has quit [Remote host closed the connection]
zachrab has quit [Remote host closed the connection]
rshetty has joined #ruby
shadoi has quit [Read error: Connection reset by peer]
shay_shay has quit [Read error: Connection reset by peer]
piotrj has quit [Remote host closed the connection]
agarie has quit [Remote host closed the connection]
ugyqrs has quit [Remote host closed the connection]
<hanmac>
i would have liked a reverse_sort_by for something like that, but it seems i dont always get what i want ... maybe i have the wrong gender to nag like that ...
RegulationD has quit [Ping timeout: 256 seconds]
<shevy>
possibly because the name is quite long
<jhass>
hanmac: not cool
<shevy>
.sort_by is already pretty long too :)
wldcordeiro has joined #ruby
shay_shay has joined #ruby
shay_shay has quit [Changing host]
shay_shay has joined #ruby
<hanmac>
shevy i also would be happy with a desc_sort_by
<shevy>
still long!
<shevy>
you are too long hanmac
<shevy>
shorten yourself
Dude007 has quit [Remote host closed the connection]
piotrj has joined #ruby
quimrstorres has quit [Remote host closed the connection]
OtterCoder has quit [Quit: No Ping reply in 180 seconds.]
OtterCoder has joined #ruby
jottr_ has joined #ruby
jenrzzz has joined #ruby
dkphenom has joined #ruby
<ebernhardson>
random noob question ... i've loaded up my cucumber suite via `ruby -r debug $(which bundle) exec cucumber feature/foo.feature` and added the line `debugger` to the function where i want it to stop, but it just runs the whole thing straight through without doing the breakpoint. what gives? i know its running this line because cucumber reports a failure at the foo.should == true a couple lines farther down in same method
OtterCoder has quit [Read error: Connection reset by peer]
OtterCoder has joined #ruby
platzhirsch has quit [Quit: Leaving.]
Lissie has quit [Quit: My computer has gone to sleep. ZZZzzz…]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
_honning_ has joined #ruby
Lissie has joined #ruby
failshell has joined #ruby
thatslifeson has quit [Remote host closed the connection]
mjuszcza_ has quit []
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zachrab has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 256 seconds]
vasilakisfil__ is now known as vasilakisfil
ki0 has joined #ruby
mjuszczak has joined #ruby
baweaver has joined #ruby
blackmesa has joined #ruby
tonyhb has joined #ruby
agarie has joined #ruby
x1337807x has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
claptor has joined #ruby
yeticry has joined #ruby
charliesome has joined #ruby
allcentury has joined #ruby
Limix has joined #ruby
diegoviola has quit [Ping timeout: 250 seconds]
lfox has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
relix has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest752 has quit [Remote host closed the connection]
bim has joined #ruby
DerisiveLogic has joined #ruby
bim is now known as Guest16192
Guest16192 has quit [Remote host closed the connection]
wottam has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
vim_shimm has joined #ruby
baroquebobcat has joined #ruby
icarus__ has joined #ruby
yekta has joined #ruby
djbkd has joined #ruby
gnfz has joined #ruby
ramfjord has joined #ruby
gaussblurinc1 has joined #ruby
shoutsid has joined #ruby
DEA7TH has joined #ruby
Outlastsheep is now known as zz_Outlastsheep
ebernhardson has left #ruby [#ruby]
Guest95932 has quit [Ping timeout: 250 seconds]
piotrj has quit [Remote host closed the connection]
piotrj has joined #ruby
Mohan has joined #ruby
Mohan is now known as Guest24252
yekta has quit [Ping timeout: 248 seconds]
cphrmky has quit [Ping timeout: 244 seconds]
diegoviola has joined #ruby
huddy has quit [Quit: Connection closed for inactivity]
piotrj has quit [Ping timeout: 265 seconds]
diegoviola has quit [Changing host]
diegoviola has joined #ruby
Lissie has quit []
Flowrhent has joined #ruby
_honning_ has quit [Ping timeout: 276 seconds]
quimrstorres has joined #ruby
yekta has joined #ruby
vim_shimm has quit [Ping timeout: 256 seconds]
DerisiveLogic has quit [Ping timeout: 264 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
dseitz has joined #ruby
mrsolo has quit [Read error: Connection reset by peer]
chrishough has quit [Read error: Connection reset by peer]
baweaver has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
postmodern has joined #ruby
rbennacer has quit [Remote host closed the connection]
NinjaOps has quit [Quit: Konversation terminated!]
mrsolo has joined #ruby
_blizzy_ has joined #ruby
shoutsid has quit [Remote host closed the connection]
juanpaucar has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
havenwood has quit []
havenwood has joined #ruby
yekta has quit [Ping timeout: 252 seconds]
maciejczyzewski has joined #ruby
maciejczyzewski has quit [Client Quit]
lolmaus has joined #ruby
yekta has joined #ruby
lkba has joined #ruby
jimms has quit [Read error: Connection reset by peer]
juanpaucar has quit [Ping timeout: 264 seconds]
vim_shimm has joined #ruby
jimms has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
jheg has joined #ruby
mikemac has joined #ruby
aufi has joined #ruby
momomomomo has joined #ruby
sohrab has quit [Ping timeout: 250 seconds]
Hijiri has quit [Ping timeout: 245 seconds]
yekta has quit [Ping timeout: 248 seconds]
crazymykl has quit [Ping timeout: 246 seconds]
bigsky has quit [Ping timeout: 244 seconds]
sohrab has joined #ruby
mjuszczak has quit []
bigsky has joined #ruby
Hijiri has joined #ruby
mjuszczak has joined #ruby
startupality_ has joined #ruby
workmad3 has joined #ruby
wottam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
startupality has quit [Ping timeout: 252 seconds]
startupality_ is now known as startupality
DEA7TH has quit [Ping timeout: 248 seconds]
Spami has quit [Quit: This computer has gone to sleep]
Filete has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
wallerdev has quit [Quit: wallerdev]
workmad3 has quit [Ping timeout: 250 seconds]
vickleton has quit [Read error: Connection reset by peer]
sohrab has quit [Ping timeout: 252 seconds]
evanjs has quit [Remote host closed the connection]
vickleton has joined #ruby
rbennacer has joined #ruby
failshell has quit [Remote host closed the connection]
phutchins has quit [Ping timeout: 252 seconds]
evanjs has joined #ruby
vasilakisfil has quit [Ping timeout: 265 seconds]
shoutsid has joined #ruby
agarie has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
vudew has joined #ruby
djmittens has joined #ruby
geggam has joined #ruby
quimrstorres has quit [Remote host closed the connection]
quimrstorres has joined #ruby
_honning_ has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
failshell has joined #ruby
mjuszczak has quit []
Hijiri has quit [Ping timeout: 252 seconds]
cocotton has quit [Read error: Connection reset by peer]
agarie has joined #ruby
bim has joined #ruby
bim is now known as Guest71480
blazes816 is now known as tcrypt
zachrab has joined #ruby
<rubyonrailed>
How do I append to the beginning of an array?
<pipework>
rubyonrailed: Google, mostly.
<pipework>
As a hint, look for the inverse of 'shift'.
<pipework>
It's a basic array operation.
lavros has quit [Quit: leaving]
tonyhb has quit [Read error: Connection reset by peer]
<dudedudeman>
would a .insert(0, foo) work for this?
tonyhb has joined #ruby
_honning_ has quit [Ping timeout: 264 seconds]
Squarepy has quit [Quit: Leaving]
thiagovsk has quit [Quit: Connection closed for inactivity]
tjbiddle has quit [Quit: tjbiddle]
lolmaus has quit [Quit: Konversation terminated!]
lele is now known as Guest24
plribeiro30001 has joined #ruby
tjbiddle has joined #ruby
plribeiro3000 has quit [Ping timeout: 264 seconds]
mjuszczak has joined #ruby
Pharaoh2 has quit [Remote host closed the connection]
<jhass>
dudedudeman: yes, but there's a dedicated method
yaw has joined #ruby
baweaver has joined #ruby
Pumukel has joined #ruby
agent_white has joined #ruby
<agent_white>
moin
thatslifeson has joined #ruby
icarus__ has quit [Ping timeout: 250 seconds]
doertedev has quit [Ping timeout: 246 seconds]
yqt has joined #ruby
stef204 has quit [Read error: Connection reset by peer]
<Oog>
beset way to generate a random number of X digits?
havenwood has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Oog>
i found return Random.new.bytes(length).bytes.join[0, length] but that doesnt look exactly random to me... i think certain digits are weighted more
BTRE has joined #ruby
<jhass>
rand(10*n..10*(n+1)-1) I guess
towski_ has quit [Remote host closed the connection]
<Ellistaa>
that only returns 1 digit
<jhass>
no
<Ellistaa>
yuh hu i just did it in irb :)
startupality has quit [Quit: startupality]
<jhass>
uh, ** of course
zachrab has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
zachrab has joined #ruby
<Ellistaa>
:0
djbkd has quit [Remote host closed the connection]
quimrstorres has quit [Remote host closed the connection]
peterhu has joined #ruby
mrmargol_ has joined #ruby
djmittens has quit [Ping timeout: 256 seconds]
scripore has quit [Quit: This computer has gone to sleep]
baweaver has joined #ruby
kirun has quit [Quit: Client exiting]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
OrbitalKitten has joined #ruby
vim_shimm has quit [Ping timeout: 245 seconds]
mrmargolis has quit [Ping timeout: 264 seconds]
vim_shimm has joined #ruby
JDiPierro has quit [Remote host closed the connection]
OrbitalKitten has quit [Client Quit]
dcarmich has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
parduse is now known as Guest89836
tonyhb has joined #ruby
jenrzzz_ has joined #ruby
pardusf has joined #ruby
Guest89836 has quit [Ping timeout: 272 seconds]
barkerd427 is now known as zz_barkerd427
pardusf has quit [Client Quit]
allcentury has quit [Quit: WeeChat 1.1.1]
BTRE has joined #ruby
a5i has quit [Quit: Connection closed for inactivity]
jottr_ has quit [Read error: Connection reset by peer]
parduse has joined #ruby
jottr_ has joined #ruby
joonty has quit [Quit: joonty]
jenrzzz has quit [Ping timeout: 245 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
djmittens has joined #ruby
freerobby has joined #ruby
nfk|laptop has joined #ruby
luluapple has joined #ruby
DerisiveLogic_ has joined #ruby
DerisiveLogic_ has quit [Remote host closed the connection]
RTG` has quit [Ping timeout: 250 seconds]
DerisiveLogic_ has joined #ruby
nfk|laptop has quit [Read error: Connection reset by peer]
DerisiveLogic has quit [Ping timeout: 256 seconds]
Musashi007 has quit [Quit: Musashi007]
sleepee has joined #ruby
nateberkopec has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
RTG` has joined #ruby
nateberkopec has joined #ruby
tvw has quit [Remote host closed the connection]
mitchellhenke has quit [Quit: Computer has gone to sleep.]
momomomomo has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
i8igmac has quit [Ping timeout: 240 seconds]
bluOxigen has quit [Ping timeout: 248 seconds]
piotrj has quit [Remote host closed the connection]
davedev24_ has quit [Read error: Connection reset by peer]
ldnunes has quit [Quit: Leaving]
djmittens has quit [Ping timeout: 256 seconds]
davedev24_ has joined #ruby
workmad3 has joined #ruby
piotrj has joined #ruby
Flowrhent has quit [Quit: Flowrhent]
hollywood has quit [Quit: Leaving]
jenrzzz_ has quit [Ping timeout: 265 seconds]
<Oog>
how to do while loop in ruby? loop do break end ?
claw has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djmittens has joined #ruby
vim_shimm has quit [Ping timeout: 240 seconds]
nfk|laptop has joined #ruby
<apeiros>
Oog: while condition; do_stuff; end
<Oog>
i want it to guarantee run once
<apeiros>
ah
mengu has quit [Ping timeout: 250 seconds]
<apeiros>
begin; do_stuff; end while condition
<apeiros>
Oog: but note that often there are more idiomatic constructs available
dopie has quit [Quit: This computer has gone to sleep]
<pipework>
Oog: You can use loop to run at least once.
ascarter has joined #ruby
relix has joined #ruby
scripore has joined #ruby
sleepee has quit [Quit: Leaving]
<apeiros>
IMO loop is in itself a code smell.
Lewix has joined #ruby
<ytti>
what about main loop in daemon
tonyhb has quit [Quit: peace]
<apeiros>
ytti: even daemons usually have an exit condition. e.g. sigint.
jaxxstorm has quit [Ping timeout: 256 seconds]
<ytti>
how would that be in ruby as while condition
<apeiros>
terminate = false; trap("SIGINT") { terminate = true }; until terminate; run daemon; end
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
Lewix has quit [Read error: Connection reset by peer]
<apeiros>
f.ex.
doodlehaus has quit [Remote host closed the connection]
paulcsmith has quit [Quit: Be back later ...]
mitchellhenke has joined #ruby
<apeiros>
that also allows it to terminate a full loop properly. unlike a mid-code exit.
Lewix has joined #ruby
ki0 has joined #ruby
jonr22 has joined #ruby
<pipework>
apeiros: I bet loop is better for when you genuinely want to loop.
<Oog>
thx
<apeiros>
pipework: no.
<pipework>
apeiros: Disagree.
<pipework>
But I'm okay with leaving it at that.
<apeiros>
pipework: unless you truly loop forever, you just create spaghetti code.
<pipework>
apeiros: Again, disagre.
<jhass>
apeiros: interestingly matz said that he regrets begin; end while; and recommends loop do; break if
<apeiros>
jhass: I know. but he regrets the syntax, not the construct itself.
gfawcettpq has joined #ruby
<apeiros>
often mistaken.
AlphaAtom has joined #ruby
<apeiros>
pipework: you disagree with it being spaghetti or with it being bad?
<pipework>
apeiros: I disagree with the black-and-white nature of your statement.
<pipework>
Everything is spaghetti.
vim_shimm has joined #ruby
<apeiros>
then you don't understand that term and should educate yourself.
RegulationD has joined #ruby
dopie has joined #ruby
<apeiros>
and in that case, it's probably pointless to argue with you about it.
mistermocha has quit [Read error: Connection reset by peer]
<pipework>
I feel exactly the same way towards you about this.
<pipework>
Mutual disagreement is okay though.
mistermocha has joined #ruby
<apeiros>
if you're fine with having your argument based on ignorance - sure.
<pipework>
I like how you're choosing to assert ignorance on my part rather than address my assertion.
chrishough has joined #ruby
<apeiros>
there's no assertion about that.
<jhass>
gosh, relax
<pipework>
I prefer objective arguments.
<pipework>
It's rare I even agree with Matz.
<apeiros>
23:32 pipework: Everything is spaghetti.
frem has quit [Quit: Connection closed for inactivity]
rhllor has quit [Quit: rhllor]
<apeiros>
zero assertion there that you don't understand the term.
baweaver has joined #ruby
* dudedudeman
needs an adult
baweaver has quit [Remote host closed the connection]
ki0 has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 256 seconds]
<pipework>
Oog: My suggestion going forward is to just not write terrible code. Anything can become spaghetti if you suck at using it, rarely is something like a loop a 'smell', it's just a preferential decision to dislike them without any objective reasoning other than a possible tendency to not be able to restrain yourself as a developer.
<Oog>
?
<pipework>
If you like the begin block, use that, if you like the loop, go with that. Either way, don't write terrible code. :)
<Oog>
im generating an email verificationc ode - i need to make sure its not already in use
quimrstorres has joined #ruby
<jhass>
and share your actual problem so we can suggest a solution that needs neither ;)
<pipework>
Oog: Oh, so it's not necessarily just a loop that must happen once?
<Oog>
do user.code=x break if code in use loop
nfk|laptop has quit [Quit: yawn]
RegulationD has quit [Ping timeout: 256 seconds]
<Oog>
maybe there is a better way i dont know it?
<pipework>
Oog: You'll need a way to determine if something's being used. There are many ways to do such a thing.
<apeiros>
and for the records - with regards to the syntax ruby uses for do/while, I too agree that it's not good. mostly because of how suffix while/until works (and that's matz' concern with it too afaik)
Lewix has quit [Read error: Connection reset by peer]
<apeiros>
hash.include?("key") # is O(1), does not create a temporary array
djbkd has quit [Remote host closed the connection]
<apeiros>
hash.keys.include?("key") # is O(n), and does additionally create a temporary array
<Senjai>
I typically am just used to something like whitelisted_attributes.include?(attribute)
<Senjai>
apeiros: Yes, I was of course not caring about performance, but you're correct ofc
<Senjai>
as per usj
<apeiros>
hm… though, reading the question again I'm not actually sure I understood it correctly
<Senjai>
apeiros: took me a second too
<Senjai>
sohrab: Btw, having to do this is a hint that you should probably not be using a hash, for whatever your using it for
ki0 has joined #ruby
<Senjai>
just an fyi
<apeiros>
sohrab: by 'a key that is not "x" or "y"?' - do you mean you want to check whether there are additional keys in the hash and not just "x" and/or "y"?
<apeiros>
sohrab: or do you mean you want to test whether the hash contains neither "x" nor "y" as keys?
<Senjai>
apeiros: The first one I believe, but yeah, I got caught on the wording too
<Senjai>
apeiros: j/c do I have access to the bot?
<Senjai>
For facts and stuff
<apeiros>
Senjai: factoids and eval are public
<apeiros>
not sure whether we already restricted it to authenticated people, though
Dude007 has joined #ruby
<apeiros>
and if not, that'll happen soon
<apeiros>
authenticated with nickserv that is. you don't need a registration with the bot.
bkxd has joined #ruby
scripore has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
<apeiros>
none of the keys: test_keys.none? { |key| hash.has_key?(key) }
sevvie has quit [Ping timeout: 256 seconds]
<apeiros>
though I'd probably use array's set operations for the second one too if I'd expect test_keys to become large. not because its algorithmic complexity would be better, but because method call overhead in ruby is significant.
<Senjai>
mmm sets
ki0 has quit [Ping timeout: 248 seconds]
dopie has joined #ruby
<Senjai>
apeiros: Why do you know so much, for reals
sevvie has joined #ruby
<apeiros>
I had a bit of time to learn that stuff
quimrstorres has joined #ruby
Igorshp has quit [Remote host closed the connection]
yqt has joined #ruby
ebbflowgo has joined #ruby
mitchellhenke has quit [Quit: Computer has gone to sleep.]
shoutsid has joined #ruby
<apeiros>
set variant for none of the keys: (test_keys & hash.keys).empty?
<apeiros>
and now I'm curious for when which is faster and by how much :<
towski_ has joined #ruby
duderonomy has joined #ruby
crdpink2 has quit [Ping timeout: 245 seconds]
crdpink has joined #ruby
<Senjai>
Set intersection ftw
quimrstorres has quit [Ping timeout: 250 seconds]
<Senjai>
I often forget certain use cases for it
<Senjai>
I used to use it extensively, it was like a phase
<Senjai>
apeiros: lol :( #firstworldproblems
<Senjai>
I bet sohrab will never ask another question again
ebbflowgo has quit [Ping timeout: 250 seconds]
Dude007 has quit [Remote host closed the connection]
<apeiros>
I wish ruby's Set class was in C. Set is often slower than Array for set operations :(
<Senjai>
No way
<apeiros>
and it'd be nice if Hash#keys returned a Set
<Senjai>
Really
<Senjai>
Are you talking about set intersection or the rest of it
Dude007 has joined #ruby
<apeiros>
intersection, union, subtraction
<Senjai>
For preventing duplicates and stuff, and testing inclusion, I found sets to be incredibly more productive than arrays
<sohrab>
Senjai: huh, i'm just trying to hack this together quickly. dunno if it's a bad idea
roshanavand has joined #ruby
<apeiros>
testing inclusion is O(n) in arrays, so yes, that'll be slower than with sets.
<ght>
Question: As an old habit from preivous languages, I like to declare variables at the top of methods, often setting them to nil. Is there any advantage in Ruby to this in terms of allocating space in ram?
<Senjai>
sohrab: Hack away, but yeah, hashes arent typically used that way
<ght>
previous*
<apeiros>
ght: no
<Senjai>
apeiros: So I guess I've only used the good parts of set then
<ght>
Ok.
roshanavand has quit [Client Quit]
<apeiros>
ght: and for local variables I don't do that. but for ivars, I usually assign all in initialize to make it easy to find all of them.
roshanavand has joined #ruby
<Senjai>
ght: Thats not necessarily a bad practice
<apeiros>
Senjai: all parts of set are good. just some are not as fast as they could/should be
<Senjai>
ght: It has more value in statically typed languages imop
ebbflowgo has joined #ruby
<ght>
Senjai: Ok, thank you.
Eiam_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
and unless you really need the performance, I'd use the datastructure which semantically fits
<Senjai>
Well, just for sohrab
<Senjai>
's example
<Senjai>
I assume its a coordinate system or something
<Senjai>
I would rather pass a Coordinate class or something
<Senjai>
instead of a hash of attributes
roshanavand has quit [Client Quit]
hiyosi has joined #ruby
Spami has joined #ruby
nfk|laptop has joined #ruby
Dude007 has quit [Ping timeout: 264 seconds]
yqt has quit [Ping timeout: 245 seconds]
dopie has quit [Quit: This computer has gone to sleep]
juanpablo___ has quit [Quit: (null)]
juanpablo___ has joined #ruby
nfk has quit [Remote host closed the connection]
nfk|laptop has quit [Ping timeout: 245 seconds]
vickleton has quit [Quit: Ex-Chat]
Dude007 has joined #ruby
juanpablo___ has quit [Ping timeout: 264 seconds]
nfk has joined #ruby
pdoherty has joined #ruby
jonr22 has joined #ruby
enebo has quit [Quit: enebo]
mitchellhenke has joined #ruby
a5i has joined #ruby
mikecmpbll has quit [Quit: ciao.]
nfk has quit [Ping timeout: 256 seconds]
predator217 has joined #ruby
sevvie has quit [Ping timeout: 246 seconds]
hellome has joined #ruby
FernandoBasso has quit [Read error: Connection reset by peer]
thatslifeson has quit [Remote host closed the connection]
predator117 has quit [Ping timeout: 265 seconds]
FernandoBasso has joined #ruby
baweaver has quit [Remote host closed the connection]
mary5030_ has quit [Remote host closed the connection]
dopie has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lfox has quit [Ping timeout: 245 seconds]
Guest71480 has quit [Remote host closed the connection]
mitchellhenke has quit [Quit: Computer has gone to sleep.]
Cloudhand has quit [Ping timeout: 256 seconds]
x1337807x has joined #ruby
bim has joined #ruby
jonr22 has quit [Ping timeout: 276 seconds]
bim is now known as Guest3092
baweaver has joined #ruby
ItSANgo has quit [Quit: Leaving...]
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
workmad3 has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
baweaver has joined #ruby
Schmidt has quit [Ping timeout: 255 seconds]
<a5i>
Is there a Ruby formatter somewhere ?
blackmesa has quit [Ping timeout: 244 seconds]
djbkd has joined #ruby
Guest3092 has quit [Remote host closed the connection]
rkazak_ has joined #ruby
ddarkpassenger has joined #ruby
_blizzy_ has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
Schmidt has joined #ruby
zachrab has quit [Remote host closed the connection]
zachrab has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RegulationD has joined #ruby
ItSANgo has joined #ruby
x1337807_ has joined #ruby
DigitallyBorn has joined #ruby
Dibillilia has joined #ruby
zachrab has quit [Ping timeout: 244 seconds]
<apeiros>
a5i: what would a ruby formatter do?
<DigitallyBorn>
Hi, everybody. New-ish to ruby and I'm trying to do a regex match and loop through each of the matches. I need char index for each. Is the best way to use .match(text, index) and shift the index after each match?
<a5i>
format ruby code
<a5i>
I think it's just github screwing up
<apeiros>
ah
x1337807_ has quit [Client Quit]
<a5i>
it automatically sets my formatting to tab size 8
<a5i>
and i cant chnage it :/
wottam has joined #ruby
<ytti>
space, eleastic tab stops, tabs
chrishough has joined #ruby
<ytti>
in order of preference
<Dibillilia>
Hey guys, maybe you can help me. I'm having a problem installing Gems. It looks like SSL connection is failing. I'm on Windows. Here's the error: Unable to download data from https://rubygems.org/ - SSL_connect retur
<ytti>
or maybe elastic would be best, if it would be widely supported
<apeiros>
DigitallyBorn: scan + Regexp class methods could also be used
RegulationD has quit [Ping timeout: 255 seconds]
<a5i>
ytti, my format keeps getting screwed up by github,
<apeiros>
Dibillilia: I think for that specific error there exist a couple of answers on stackoverflow. google is your friend (I'd do the same to help)
x1337807x has quit [Ping timeout: 256 seconds]
x1337807_ has joined #ruby
<DigitallyBorn>
apeiros: Scan doesn't return match positions, does it?
<apeiros>
DigitallyBorn: hence Regexp class methods. they provide that information
<apeiros>
or the relevant $vars if that's more your thing
<Dibillilia>
I've checked Stack Overflow. All of the errors seem to have been problems with the gem package manager.
mistermocha has joined #ruby
<apeiros>
DigitallyBorn: actually just Regexp.last_match or $~ (contains MatchData)
rgb-one has quit [Remote host closed the connection]
<apeiros>
and MatchData has #offset
Zai00 has quit [Quit: Zai00]
ChoiKyuSang has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
dopie has quit [Quit: This computer has gone to sleep]
ddarkpassenger has quit [Quit: Leaving]
fryguy9 has quit [Quit: Leaving.]
piotrj has quit [Remote host closed the connection]
* rootsudo
doesn't know what ruby is.
* rootsudo
is going to learn this tonight.
wallerdev has quit [Quit: wallerdev]
pdoherty has quit [Ping timeout: 256 seconds]
dorei has joined #ruby
* Brozo
feels it rootsudo
slawrence00 has joined #ruby
quimrstorres has joined #ruby
dudedudeman has quit [Quit: Leaving.]
mjuszczak has quit []
marr has quit [Read error: Connection reset by peer]
constantinexvi has quit [Quit: Exiting]
pengin__ has quit [Remote host closed the connection]
Dibillilia has left #ruby [#ruby]
jenrzzz has joined #ruby
quimrstorres has quit [Ping timeout: 276 seconds]
DigitallyBrn has joined #ruby
ChoiKyuSang has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
astrobunny has joined #ruby
towski__ has joined #ruby
DigitallyBorn has quit [Ping timeout: 264 seconds]
towski_ has quit [Ping timeout: 240 seconds]
JDiPierro has joined #ruby
juanpablo___ has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
_honning_ has quit [Remote host closed the connection]
ascarter has joined #ruby
djbkd has quit [Quit: My people need me...]
mrsolo has quit [Quit: Leaving]
banister has quit [Read error: Connection reset by peer]
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanpablo___ has quit [Ping timeout: 256 seconds]
<a5i>
how do I run ruby files with crontabs ?
bim has joined #ruby
<apeiros>
a5i: are you using rvm?
<a5i>
No
bim is now known as Guest29354
<apeiros>
do you know how to run other stuff with cron?