<Lightsword>
I figured how to open the ports when one finishes but I’m having issues with eventmachine and addint more requests to it
rshetty has quit [Ping timeout: 250 seconds]
SlvrDragn has joined #ruby
SlvrDragn has quit [Client Quit]
ClarusCogitatio has quit [Ping timeout: 265 seconds]
<weeb1e_>
Lightsword: If you use a multi callback, your application is going to have to wait for the full batch of requests to complete before starting a new batch
<weeb1e_>
It would be better to start the next request as soon as one finishes
siso has quit [Ping timeout: 272 seconds]
<Lightsword>
so I shouldn’t use the multi interface at all?
blackmesa has quit [Ping timeout: 244 seconds]
<weeb1e_>
Probably not, instead loop manually: outstanding_requests = 0; 50.times do outstanding_requests += 1; start_next_request end
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<weeb1e_>
Then from the callback of a request, check if the queue is empty, if so "outstanding_requests -= 1; all_requests_complete if outstanding_requests < 1", else call start_next_request again
siso has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
allcentury has joined #ruby
SCHAAP137 has joined #ruby
jlast has quit [Read error: Connection reset by peer]
xymbol has joined #ruby
jlast has joined #ruby
xymbol has quit [Client Quit]
Spami has joined #ruby
tatsuo has joined #ruby
narcan has joined #ruby
aspires has quit []
rshetty has joined #ruby
aspires has joined #ruby
rshetty has quit [Read error: Connection reset by peer]
rshetty has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
hiyosi has joined #ruby
mikecmpbll has joined #ruby
drewvanstone has joined #ruby
mikecmpbll has quit [Client Quit]
econerd4ever has quit [Remote host closed the connection]
rshetty has quit [Read error: Connection reset by peer]
rshetty has joined #ruby
econerd4ever has joined #ruby
baweaver has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
<Fire-Dragon-DoL>
WTF happened to rubygems
oo_ has joined #ruby
<Fire-Dragon-DoL>
llol
<Fire-Dragon-DoL>
like OVERNIGHT! :P
echooo has joined #ruby
mikepack has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
Vifid has quit [Remote host closed the connection]
cajone has quit [Remote host closed the connection]
hiyosi has quit [Ping timeout: 265 seconds]
x77686d has joined #ruby
Nogbit has quit [Ping timeout: 245 seconds]
msmith_ has joined #ruby
tokik has quit [Ping timeout: 264 seconds]
Lingo______ has quit [Quit: Be back later ...]
rimenes has joined #ruby
Lingo______ has joined #ruby
bmichelsen has quit [Quit: ZZZzzz…]
longneckbeard has quit [Quit: brb]
jerius has joined #ruby
jerius has quit [Client Quit]
siso has quit [Quit: siso]
Fire-Dragon-DoL has quit [Quit: Leaving.]
razieliyo has quit [Quit: Saliendo]
dc_ has joined #ruby
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
lacrymology has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
agent_white has joined #ruby
<lacrymology>
will gem install gems globally by default?
<agent_white>
evenin' folks
Axy has quit [Read error: Connection reset by peer]
<jhass>
lacrymology yes
r0bby_ has joined #ruby
<jhass>
/etc/gemrc and ~/.gemrc may influence that behavior
robustus has quit [Ping timeout: 250 seconds]
robbyoconnor has quit [Quit: Konversation terminated!]
rshetty has quit [Remote host closed the connection]
<lacrymology>
so I guess I should run gem install with sudo?
dcunit3d has joined #ruby
<jhass>
if you want to install the gem globally
<jhass>
do you get a permission error or why are you asking?
robustus has joined #ruby
stunder has quit [Quit: Screw you guys I'm going home]
xymbol has joined #ruby
<lacrymology>
jhass: no, it was taking a while and I didn't want to waste time and then find out I should have done it
<jhass>
then continue waitng
workmad3 has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
dkb20k has joined #ruby
Vile` has quit [Remote host closed the connection]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Vile` has joined #ruby
Ankhers has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
drewvanstone has quit [Quit: leaving]
drewvanstone has joined #ruby
baweaver has joined #ruby
dkb20k has quit [Ping timeout: 240 seconds]
freerobby has quit [Quit: Leaving.]
<agent_white>
Is there a way to add custom methods to irb? I made a method and tossed it into .irbrc, but when I open irb I can't seem to call it.
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dseitz has joined #ruby
<agent_white>
Odd... nevermind. May have just opened the wrong irbrc file.. ;P
<weeb1e_>
lacrymology: Also make sure your rubygems is up to date, older versions are orders of magnitude slower
jimbach has quit [Remote host closed the connection]
<agent_white>
Actually, problem not solved.
oo_ has joined #ruby
tkuchiki has joined #ruby
dseitz has quit [Client Quit]
freerobby has joined #ruby
fgo has joined #ruby
jimbach has joined #ruby
Azure has quit [Quit: My MBP went to sleep.]
matchaw has joined #ruby
Xiti has quit [Quit: Xiti]
jimbach has quit [Ping timeout: 258 seconds]
fgo has quit [Ping timeout: 244 seconds]
larissa has quit [Quit: Leaving]
matchaw_ has quit [Ping timeout: 272 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
eka has joined #ruby
Xiti has joined #ruby
bricker`work has quit [Ping timeout: 244 seconds]
ssyrain has joined #ruby
iinzg has quit [Read error: Connection reset by peer]
marr has quit [Ping timeout: 245 seconds]
Azure has joined #ruby
Takle has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
Jake232 has joined #ruby
tier has joined #ruby
Jake232 has quit [Client Quit]
klmlfl has quit [Ping timeout: 264 seconds]
emmesswhy has joined #ruby
cajone has joined #ruby
rshetty_ has joined #ruby
charliesome has quit [Quit: zzz]
mary5030 has joined #ruby
renderful has joined #ruby
amclain has joined #ruby
RastaqWhere has joined #ruby
RastaqWhere has quit [Client Quit]
yfeldblum has quit [Remote host closed the connection]
r0bby_ has quit [Ping timeout: 264 seconds]
rshetty_ has quit [Ping timeout: 264 seconds]
davedev24_ has quit []
Jake232 has joined #ruby
dkb20k has joined #ruby
zacstewart has quit [Read error: Connection reset by peer]
zacstewart has joined #ruby
renderful has quit [Ping timeout: 264 seconds]
njames has quit [Remote host closed the connection]
sailias has joined #ruby
Channel6 has joined #ruby
Thanh_ has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
Xeago has quit [Remote host closed the connection]
x77686d has quit [Ping timeout: 255 seconds]
rh1n0_away has quit [Max SendQ exceeded]
Ankhers has quit [Ping timeout: 250 seconds]
rh1n0 has joined #ruby
charliesome has joined #ruby
tatsuo has quit [Quit: Leaving...]
yfeldblum has joined #ruby
msmith_ has quit [Remote host closed the connection]
davedev24_ has joined #ruby
baweaver has quit [Remote host closed the connection]
Thanh_ has quit [Quit: Page closed]
rshetty has joined #ruby
rshetty has quit [Read error: Connection reset by peer]
siso has joined #ruby
hornairs_ has quit [Quit: hornairs_]
boombadaroomba has joined #ruby
mikepack has joined #ruby
djbkd has quit [Quit: My people need me...]
aspires has quit []
fgo has joined #ruby
boombadaroomba has quit [Ping timeout: 258 seconds]
Duckily has quit [Quit: Duckily]
<parabolize>
agent_white: seems to work for me. Could you paste your irbrc?
zzzbra has joined #ruby
rylev has quit [Remote host closed the connection]
dermothaughey has joined #ruby
narcan has joined #ruby
jnylen has quit [Ping timeout: 264 seconds]
LudicrousMango has quit [Remote host closed the connection]
klmlfl has joined #ruby
Bira has joined #ruby
guyze has joined #ruby
zacstewart has quit []
<guyze>
what is the difference between rails 3 and 4?
<eam>
one
adriancb has joined #ruby
<guyze>
okay eam
funburn has quit [Ping timeout: 272 seconds]
<guyze>
what about programming language versions why do they get updated?\
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<agent_white>
parabolize: I figured it out :) I had to add the gem "pry-rails" to my project, then in my .pryrc I just added the method via `class Object; def foo();end;end;`
avr has joined #ruby
dermothaughey has quit [Ping timeout: 264 seconds]
<guyze>
thank you jhass
Lightsword has quit [Quit: Lightsword]
<guyze>
what is the difference between ruby 1.8.7 and 2.1.4
<guyze>
why are there version numbers in ruby?
rpag has joined #ruby
<jhass>
lol
benlieb has joined #ruby
<guyze>
is ruby a program?
<eam>
jhass: ;-)
Bira has quit [Ping timeout: 256 seconds]
<parabolize>
agent_white: Why are you still using irb anyway? Switch to pry.
<agent_white>
parabolize: I use pry :)
fustirge has quit [K-Lined]
rubie has joined #ruby
<rubie>
is it possible to write a method that will create another method?
<jhass>
ruby, the language changes, it's not strictly versioned but as the reference implementation, MRI, adds new features we tend to say things like "this was introduced in ruby 2.1.4" where 2.1.4 is the MRI version
<jhass>
guyze: ^
<jhass>
and for the differences just google
zacts has quit [Quit: leaving]
fabrice31 has joined #ruby
<jhass>
rubie: yes
<jhass>
you know a few already in fact, attr_reader and so on
zacts has joined #ruby
<eam>
eval is the ultimate method that does arbitrary other things
<guyze>
jhass: oh... i still have a lot to learn
<rubie>
jhass: i was just thinking if it woudl be possible to use binary search on an unsorted list if you could create methods that would make methods that woudl search smaller and smaller parts of the list
<rubie>
is that possible?
<guyze>
thank you for trying to explain it to me
jtdowney has joined #ruby
<rubie>
or is this just recursion
<jhass>
rubie: possible yes. I don't think it makes a whole lot of sense to be honest
<parabolize>
rubie: the list would have to exist while the code is being evaluated
krz has joined #ruby
emmesswhy has quit [Quit: Leaving]
<eam>
parabolize: nah, you could do it at runtime
<rubie>
would having 4 methods all using linear search be faster than having method 4x bigger doing linear search?
<eam>
rubie: can't say without specifics. The best thing to do is to try it out yourself
<rubie>
i have no idea how, its just theory
<eam>
it all depends on how exactly you write your methods
fabrice31 has quit [Ping timeout: 240 seconds]
kireevco has quit [Quit: Leaving.]
sargas has joined #ruby
<eam>
rubie: it is generally faster to pass parameters vs playing around with dynamic methods
beef-wellington has quit [Ping timeout: 265 seconds]
yourabi has joined #ruby
rshetty has joined #ruby
<tmoore>
rubie: you'd have to run on multiple threads... and you don't really need different methods, they would just need to take start and end index as parameters
<tmoore>
if you're running them on a single thread, one after another, it wouldn't be faster than just iterating through the entire thing in one method... you'd be iterating through the entire thing anyway
<eam>
what's idiomatic ruby to take f(foo: nil, bar: nil) and merge into some_hash as {foo: foo} only if not foo.nil?
arup_r has joined #ruby
Mars` has quit [Ping timeout: 264 seconds]
arup_r has quit [Remote host closed the connection]
arescorpio has joined #ruby
klmlfl has quit [Remote host closed the connection]
<MartynKeigher>
hey all.. im having a simple issue with some ruby code. i am trying to return a sql value, which is a percentage (result is actually 88),, but my rb file (job) is returning a '1', ie: the number of rows the query returns. i want it to return "88" not "1". can someone please point me in the right direction with this? Thanks. Here is the code http://pastebin.com/7cjCrYW7
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<MartynKeigher>
i know im missing something simple. the SQL query is 100% correct. im just returning the wrong value.
phutchins has quit [Ping timeout: 258 seconds]
adriancb has quit [Ping timeout: 244 seconds]
Lingo______ has quit [Ping timeout: 245 seconds]
dermothaughey has quit [Remote host closed the connection]
adriancb has joined #ruby
kobain has joined #ruby
dermothaughey has joined #ruby
<centrx>
MartynKeigher, How does this code "return"?
ramfjord has joined #ruby
<jhass>
you assume that we magically know which database gem you use there, but line 11 looks weird
<tmoore>
MartynKeigher: first of all... object.each what is 'object' there... is that meant to be result?
<tmoore>
results rather
<MartynKeigher>
the returned value displays on a dashboard
klmlfl has quit [Remote host closed the connection]
<MartynKeigher>
oh sorry.. jhass .. im using mysql2 gem
centrx has quit [Quit: The plan is programmed into every one of my one thousand robots]
mattmcclure has quit [Quit: Connection closed for inactivity]
klmlfl has joined #ruby
<tmoore>
Duckily: it might help to break the problem down... 1. how would you do it if you were always rounding down? 2. how would you do it if you were always rounding up? 3. how can you decide whether to round down or up?
radic has quit [Disconnected by services]
<tmoore>
all can be solved with different uses of mod I think
dermothaughey has joined #ruby
radic_ has joined #ruby
agjacome has quit [Quit: leaving]
dermothaughey has quit [Remote host closed the connection]
jusmyth has joined #ruby
<tmoore>
(but if always rounding down or always rounding up is acceptable for your problem, it becomes much simpler)
<Duckily>
tmoore: yeah i know, but its too much variance
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
Macaveli has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
mikepack has quit [Ping timeout: 240 seconds]
marcdel has joined #ruby
agent_white has joined #ruby
rshetty has joined #ruby
rshetty has quit [Read error: Connection reset by peer]
njames has quit [Remote host closed the connection]
rshetty has joined #ruby
pontiki2 has joined #ruby
<pontiki2>
hi ruby
<agent_white>
Heya pontiki! \o
<pontiki2>
hello, agent white
umttumt has quit [Remote host closed the connection]
<agent_white>
How are you this evening?
kireevco has quit [Quit: Leaving.]
<pontiki2>
recovering, agent_white
marcdel has quit [Ping timeout: 258 seconds]
<agent_white>
:o I hope your recovery is going well! Fighting a virus?
<pontiki2>
had some minor surgery this morning
<pontiki2>
i'm being kept o'night for observation
Spami has quit [Ping timeout: 255 seconds]
corehook has joined #ruby
<agent_white>
Oh no! :( What for if you don't mind me asking?
marcdel has joined #ruby
<agent_white>
I hope you're doing well!!
michaeldeol has joined #ruby
matcouto has joined #ruby
<agent_white>
Also -- Is there any good articles anyone can point me towards for sandboxing ruby? Looking to make a ruby eval bot, but I've had no such luck finding articles on doing so.
Spami has joined #ruby
hmsimha_ has joined #ruby
Ankhers has joined #ruby
NoNMaDDeN has joined #ruby
fandi has quit [Ping timeout: 256 seconds]
xymbol has joined #ruby
anarang has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
ht__th has joined #ruby
rshetty_ has joined #ruby
Eiam_ has quit [Quit: (╯°□°)╯︵ ǝpouǝǝɹɟ]
kamil has joined #ruby
Ankhers has quit [Ping timeout: 250 seconds]
narcan has joined #ruby
rshetty has quit [Ping timeout: 255 seconds]
xymbol has quit [Ping timeout: 245 seconds]
sigurding has joined #ruby
BadQuanta1 has joined #ruby
em0ral has quit [Read error: Connection reset by peer]
dc_ has joined #ruby
bal has joined #ruby
BadQuanta has quit [Ping timeout: 258 seconds]
hamakn_ has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rshetty_ has quit [Remote host closed the connection]
hamakn has quit [Read error: Connection reset by peer]
nrsk has joined #ruby
msx has quit [Read error: Connection reset by peer]
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
francisfish has quit [Remote host closed the connection]
beilabs has quit [Quit: Be back later ...]
frank_____ has joined #ruby
jlast has joined #ruby
dc_ has quit [Ping timeout: 240 seconds]
clauswitt has joined #ruby
<Hanmac>
agent_white: ask charliesome
<agent_white>
I did and he said the bot sourcecode was not publicly available :(
parabolize has quit [Remote host closed the connection]
Bira has quit [Ping timeout: 264 seconds]
mansonik has quit [Quit: Connection reset by ph33r]
maestrojed has joined #ruby
x77686d has quit [Ping timeout: 256 seconds]
dc_ has quit [Ping timeout: 240 seconds]
dcunit3d has quit [Ping timeout: 255 seconds]
fabrice31 has joined #ruby
Lingo______ has joined #ruby
charliesome has quit [Quit: zzz]
renderful has joined #ruby
tlarevo has joined #ruby
andikr has joined #ruby
braincra- has joined #ruby
tlarevo has quit [Read error: Connection reset by peer]
ctp has joined #ruby
tlarevo_ has joined #ruby
renderful has quit [Ping timeout: 255 seconds]
braincrash has quit [Ping timeout: 265 seconds]
HayesHimself has joined #ruby
ptrrr has quit [Quit: ptrrr]
bluOxigen has joined #ruby
HayesHimself has quit [Client Quit]
BadQuanta has joined #ruby
HayesHimself has joined #ruby
BadQuanta1 has quit [Ping timeout: 240 seconds]
siso_ has joined #ruby
siso has quit [Ping timeout: 272 seconds]
siso_ is now known as siso
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
xymbol has joined #ruby
bellow has joined #ruby
<bellow>
Hello
<bellow>
What type of Gel medium should I use when transferring a picture to wood? I have tried Liquitex® String Gel Medium.I have let it sit for over 12 hours and the picture pulls right up when trying to get the paper off
josephndenton has quit [Ping timeout: 256 seconds]
marcdel has quit []
amundj has joined #ruby
rshetty has joined #ruby
vimer has joined #ruby
<sevenseacat>
err... what
<sevenseacat>
wrong channel?
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zenojis has quit [Read error: Connection reset by peer]
<bellow>
Then what is the right channel
<sevenseacat>
for what?
corehook has quit [Remote host closed the connection]
zenojis has joined #ruby
amundj has quit [Client Quit]
xymbol has quit [Ping timeout: 256 seconds]
<pontiki2>
that's a win for nonsequitur question
unshadow has joined #ruby
RitterJack has joined #ruby
<bellow>
What type of Gel medium should I use when transferring a picture to wood? I have tried Liquitex® String Gel Medium.I have let it sit for over 12 hours and the picture pulls right up when trying to get the paper off
<sevenseacat>
lol
chipotle has quit [Quit: cya]
<pontiki2>
bellow: why are you asking woodworking questions in a computer programming channel devoted to the ruby language??
<bellow>
Not a woodworking question
<pontiki2>
it has *NOTHING* to do with computer programming either
<hephaestus_rg>
that's the c program. it's the simplest thing i could come up with Abhijit
razieliyo has joined #ruby
razieliyo has joined #ruby
siso has quit [Ping timeout: 272 seconds]
<Abhijit>
hephaestus_rg, gcc file.c will create one .o file
<Abhijit>
run that file
josephndenton has joined #ruby
NoNMaDDeN has joined #ruby
Lingo______ has joined #ruby
Luser has joined #ruby
fgo has joined #ruby
nagaraj has quit [Read error: Connection reset by peer]
tesuji has joined #ruby
lemur has quit [Remote host closed the connection]
<Luser>
Hey guys, do you think it is possible to run this repo https://github.com/rikiji/rmotion ? I am having troubles with setting it up..
maasha has joined #ruby
<hephaestus_rg>
Abhijit: no .o file, at least it's not in `ls`
lemur has joined #ruby
CustosL1men has joined #ruby
xymbol has joined #ruby
ptrrr has quit [Quit: ptrrr]
josephndenton has quit [Ping timeout: 244 seconds]
ghr has joined #ruby
cmckee has joined #ruby
Mateon1 has joined #ruby
fgo has quit [Ping timeout: 240 seconds]
nfk has joined #ruby
mengu has quit [Remote host closed the connection]
lemur has quit [Ping timeout: 258 seconds]
nagaraj has joined #ruby
xymbol has quit [Ping timeout: 265 seconds]
olivier_bK has quit [Quit: Quitte]
olivier_bK has joined #ruby
mrgrieves has quit [Remote host closed the connection]
michael_lee has joined #ruby
Lingo______ has quit [Quit: Be back later ...]
hiyosi has joined #ruby
Lingo______ has joined #ruby
arup_r has joined #ruby
speaking1ode has joined #ruby
mengu has joined #ruby
speakingcode has quit [Ping timeout: 264 seconds]
virtualize has quit []
blackmesa has joined #ruby
tokik has quit [Ping timeout: 244 seconds]
jlast has joined #ruby
Lingo______ has quit [Ping timeout: 256 seconds]
hiyosi has quit [Ping timeout: 264 seconds]
michael_lee has quit [Remote host closed the connection]
rdark has joined #ruby
Drakevr has quit [Changing host]
Drakevr has joined #ruby
<maasha>
wruuuum, wruuum
<maasha>
narray is driving me nuts :o(
asdfasdf has joined #ruby
joonty has joined #ruby
<maasha>
I want to count all non-zero positions in an integer narray: (na > 0).sum - but that is clearly a wrong result. I get the right by doing (na.where > 0).size - but for fucks sake - why is the first not working?
beilabs has quit [Ping timeout: 255 seconds]
phutchins has joined #ruby
nvdpl has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
lidaaa has quit [Ping timeout: 240 seconds]
wald0 has quit [Quit: Lost terminal]
<maasha>
I think the issue is that (na > 0) returns a byte array, and summing this overflows the 256 char array. However, if I do (na > o).to_i.sum it is the same thing. It appears that a byte narray cannot be converted to an int narray ?
gr33n7007h has quit [Ping timeout: 240 seconds]
nvdpl has quit [Client Quit]
mikecmpbll has joined #ruby
<maasha>
(NArray.int(300).indgen! > 0).sum
<maasha>
43
<maasha>
expecting 299
tsahl has joined #ruby
sigurding has quit [Quit: sigurding]
lxsameer has joined #ruby
sigurding has joined #ruby
gregoriokusowski has joined #ruby
beilabs has joined #ruby
phutchins has quit [Ping timeout: 255 seconds]
elaptics`away is now known as elaptics
<hephaestus_rg>
Abhijit: my VM was out of memory was the root cause. i killed some memory hungry processes and it worked.
<hephaestus_rg>
all good now
<hephaestus_rg>
thanks for the suggestions though
hephaestus_rg has quit [Quit: Lost terminal]
reinaldob has joined #ruby
Bira has joined #ruby
Spami has quit [Ping timeout: 256 seconds]
zorak8 has quit [Ping timeout: 258 seconds]
timonv_ has joined #ruby
reinaldob has quit [Ping timeout: 255 seconds]
Grantlyk has joined #ruby
Grantlyk has quit [Client Quit]
Grantlyk has joined #ruby
Bira has quit [Ping timeout: 255 seconds]
sandelius has joined #ruby
wjimenez5271 has quit [Remote host closed the connection]
gr33n7007h has joined #ruby
lolmaus has joined #ruby
francisfish has joined #ruby
Bira has joined #ruby
roolo has joined #ruby
startupality has joined #ruby
arup_r has quit [Remote host closed the connection]
Spami has joined #ruby
User458764 has joined #ruby
francisfish has quit [Remote host closed the connection]
sara-zahrani has joined #ruby
sara-zahrani has quit [Client Quit]
foooobear has quit [Read error: Connection reset by peer]
<arup_r>
It is now 15 mins .. but still not loaded... What could be the reason?
Phonetiki has joined #ruby
<Phonetiki>
hi again
<arup_r>
Any idea ?
pontiki2 has quit [Ping timeout: 246 seconds]
<agent_white>
Hehe tiki that name is awesome
* maasha
kicks narray
<sevenseacat>
arup_r: i dont think ive ever seen anyone ask as many pointless questions as you.
<arup_r>
Yes... sevenseacat: Me too
<maasha>
sevenseacat: I take that as a complement :o)
<arup_r>
But that's the point.. It is weired
<sevenseacat>
arup_r: that wasnt a compliment.
<maasha>
sevenseacat: you misunderstood. For me it was
<arup_r>
sevenseacat: Did you get the question?
visof has joined #ruby
Lingo______ has quit [Ping timeout: 264 seconds]
sara-zahrani has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
<agent_white>
So I'm wanting to make my own sandbox for a ruby eval bot, and was looking at Sandrbox for inspiration. The question I have is: how did they determine which methods/constants to blacklist? (blacklist here -- ariables have types and data do not have types. In contrast,
<arup_r>
zenspider: It is solved .. when I open IRB in a new shell session.. This usecase is first time for me.. Got the hints from someone else SHIT http://stackoverflow.com/q/16108152/2767755
mengu has quit [Remote host closed the connection]
<arup_r>
gregf_ That's why I don't use Minitest(lack of patience).. I use Rspec.. ;)
fgo has joined #ruby
<arup_r>
gregf_ anyway got to go..Nice to chat with you.. :-)
bluOxigen has quit [Ping timeout: 250 seconds]
pink_chocolate has quit [Remote host closed the connection]
NoNMaDDeN has quit [Ping timeout: 244 seconds]
xymbol has joined #ruby
rshetty has joined #ruby
gregoriokusowski has joined #ruby
cibernox has joined #ruby
coderhs has joined #ruby
unshadow has joined #ruby
unshadow has quit [Client Quit]
Phonetiki has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 272 seconds]
coderhs has quit [Client Quit]
<cibernox>
Hi, I have one weird question. I have a project with ruby 1.9 and I would like to update it to 2.1 or 2.2 but I won’t get that to be approved by client’s devops if there is no unavoidable requiremente to update
unshadow has joined #ruby
unshadow has quit [Client Quit]
<cibernox>
so the only thing I need is a gem that doesn’t work in ruby 1.9 to add it in the gemfile
xymbol has quit [Ping timeout: 255 seconds]
Phonetiki has joined #ruby
unshadow has joined #ruby
<cibernox>
anyone knows any gem that requires ruby 2.0?
<cibernox>
other than a pry-byebug and such
bluOxigen has joined #ruby
tsahl has quit [Quit: Leaving]
<cibernox>
i don’t care what it does :D
<cibernox>
just needs to be incompatibe with 1.9
tgandrews has quit [Quit: tgandrews]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
DaniG2k has joined #ruby
ta has quit [Remote host closed the connection]
<shevy>
wat
<shevy>
crazy requirement
ta has joined #ruby
jlast has joined #ruby
testcore has quit [Ping timeout: 250 seconds]
<shevy>
in general, any .gemspec that should have something like: s.required_ruby_version = '>= 2.0' should suffice
ikaros has joined #ruby
fabrice31_ has joined #ruby
<shevy>
hmm
<shevy>
they redesigned rubygems.org recently
<shevy>
takes me a bit to find
<shevy>
cibernox I think you can create a dummy gem
fabrice31 has quit [Ping timeout: 258 seconds]
Phonetiki has quit [Quit: Disconnected]
bigkevmcd has joined #ruby
<sevenseacat>
wow they did redesign it.... thats only been in the last couple days
<cibernox>
what is what happens when a client has square-headed devops that refuse to update anything
<gregf_>
ah - nevrmind shevy++
corehook has quit [Remote host closed the connection]
<cibernox>
ever
mrgrieves has joined #ruby
ldnunes has joined #ruby
davedev24_ has quit [Ping timeout: 240 seconds]
corehook has joined #ruby
ta has joined #ruby
tgandrews has joined #ruby
<mrgrieves>
Good Morning! I'm trying a few things with puppet's facter and rspec and was wondering if someone here can provide some guidance. I have a sample module with a sample fact https://github.com/dansanabria/facter_sandbox.git , and I have set up my env to run rspec with the necessary helpers etc ... The first question I have is: How can I mock the get_fact method on my spec?
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Hanmac>
deepy: did you know that you can store classes, modules and other constants into the eigenclass/singleton_class of objects?
michael_lee has quit [Ping timeout: 256 seconds]
dcunit3d has joined #ruby
<deepy>
I've no clue, I'm a Python/Java programmer
<deepy>
I just hang around here to whine when things go wrong with Diaspora
<agent_white>
Lets say I have `class A; class B; end; end;` . How do I get the outer class? Say if I did `c = ::A::B`. What would I call on C to get a return value of A ?
<agent_white>
call on "c" **
<Hanmac>
deepy:
<Hanmac>
>> o = Object.new; class << o; CONST = "ABC"; end; o.singleton_class::CONST
<Hanmac>
bobbytek: that should be your code if i am correct boxes.each_with_object(Hash.new { |hash, key| hash[key] = [] }) { |box, groups| box['groups'].each {|group| groups[group] << box['name'] } }
<sevenseacat>
okay, so what commands are you running and what errors are you getting
rshetty__ has joined #ruby
<basichash>
sevenseacat: right so i clone the two repos, then run the commands etc. Then ruby-install ruby 2.1.3. That all seems to work, but running chruby 2.1.3 returns nothing
jlast has quit [Ping timeout: 258 seconds]
<sevenseacat>
its not supposed to return anything
agent_white has joined #ruby
<sevenseacat>
it just changes your path
rshetty has quit [Ping timeout: 264 seconds]
koderok has joined #ruby
Ankhers has quit [Ping timeout: 250 seconds]
<basichash>
man i dunno wtf i'm doing wrong
rshetty__ has quit [Remote host closed the connection]
rshetty_ has quit [Ping timeout: 240 seconds]
<sevenseacat>
i havent yet heard what your problem is
<basichash>
fcked it up somewhere along the way
<basichash>
maybe rvm is better to use?
<sevenseacat>
like, if youre having a problem, youre expecting to see one thing and actually seeing something else
<sevenseacat>
but you havent mentioned that
<sevenseacat>
'better' is a vague term
timonv_ has joined #ruby
henesy has quit [Ping timeout: 258 seconds]
razieliyo has joined #ruby
razieliyo has joined #ruby
sigurding has quit [Quit: sigurding]
bluOxigen has quit [Ping timeout: 255 seconds]
nagaraj has quit [Quit: nagaraj]
nilurie has quit [Quit: Lost terminal]
nilurie has joined #ruby
kobain has joined #ruby
supersym has quit [Ping timeout: 250 seconds]
benzrf|offline is now known as benzrf
sigurding has joined #ruby
kobain has quit [Max SendQ exceeded]
drawingthesun has quit [Read error: Connection reset by peer]
narcan has joined #ruby
einarj has quit [Read error: Connection reset by peer]
mengu has quit [Remote host closed the connection]
drawingthesun has joined #ruby
einarj has joined #ruby
oo_ has joined #ruby
bal has quit [Ping timeout: 272 seconds]
drawingthesun has quit [Max SendQ exceeded]
sameerynho has quit [Quit: Leaving]
bal has joined #ruby
aspiers has quit [Ping timeout: 258 seconds]
<basichash>
sevenseacat: what's the easiest way to set up ruby for rails?
<basichash>
i.e. for you
phutchins has joined #ruby
<sevenseacat>
i use ruby-install and chruby.
<basichash>
lol dam
<basichash>
on mac i assume
foooobear has joined #ruby
razieliyo has quit [Quit: Saliendo]
<sevenseacat>
nope, ubuntu.
lkba has joined #ruby
<basichash>
can you give me a hand installing it? having trouble for some reason
<sevenseacat>
still waiting to hear your problem.
<Hanmac>
didnt you hear? he has mac, thats his problem
jheg has joined #ruby
mr_foobar_baz has quit [Quit: WeeChat 1.0.1]
<basichash>
i'm using ubuntu
<basichash>
i'll give it another shot first, maybe i make a stupid mistake
triple_b has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
delianides has joined #ruby
<sevenseacat>
if you have a problem you'll share with us, we can help you. if not, there's no point.
i0n has joined #ruby
sdwrage has joined #ruby
mengu has joined #ruby
<basichash>
sevenseacat: i did, i just wasn't exactly sure what it was. still doesn't make it easy for you obviously
mengu has quit [Changing host]
mengu has joined #ruby
<sevenseacat>
you didnt say anything about a problem you were having.... just 'it didnt work'
<sevenseacat>
without even saying what 'it' was
dcunit3d has joined #ruby
dc_ has joined #ruby
dcunit3d has quit [Ping timeout: 250 seconds]
Bira has quit [Remote host closed the connection]
dc_ has quit [Ping timeout: 256 seconds]
<basichash>
sevenseacat: right all good
<sevenseacat>
:)
<basichash>
lol
triple_b_ has joined #ruby
i0n_ has joined #ruby
<basichash>
sevenseacat: random question, why does "gem install rails" take so long? is there a verbose flag i can use to see it's progress?
jedrek has joined #ruby
<jedrek>
hello there
<sevenseacat>
depends what part of it is taking so long
<jedrek>
what's a good alternative to IRB other than pry?
<jhass>
pry
<sevenseacat>
usually its the documentation steps
<jhass>
scnr :P
<jhass>
what's wrong with pry?
<basichash>
sevenseacat: hmm i did --no-rdoc
<jedrek>
pry's fine
<jedrek>
i'm just curious
<sevenseacat>
well the output will tell you what its doing
<basichash>
sevenseacat: that's the thing, there's no output
triple_b has quit [Ping timeout: 255 seconds]
<sevenseacat>
so what was the last piece of output?
i0n has quit [Ping timeout: 255 seconds]
i0n_ is now known as i0n
<basichash>
sevenseacat: hasn't been any. "gem install rails" and then a blank newline
<sevenseacat>
then its still working out dependencies and the like
<basichash>
ah ok it's started outputing stuff
<sevenseacat>
may take a couple of min
St_Marx has quit [Quit: Ex-Chat]
bmichelsen has joined #ruby
workmad3 has joined #ruby
Lingo______ has joined #ruby
PierreRambaud has quit [Remote host closed the connection]
kapott has joined #ruby
adriancb has joined #ruby
jheg has quit [Ping timeout: 240 seconds]
BTRE has quit [Ping timeout: 244 seconds]
pushpak has joined #ruby
redjack1964 has joined #ruby
dorei has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
Lingo______ has quit [Ping timeout: 244 seconds]
allcentury has joined #ruby
sargas has joined #ruby
yfeldblum has joined #ruby
Darryl_ has quit [Quit: Connection closed for inactivity]
redjack1964_ has quit [Ping timeout: 244 seconds]
kobain has joined #ruby
Dr3amc0d3r|away has quit [Ping timeout: 245 seconds]
joast has quit [Quit: Leaving.]
asdfasdf has quit [Ping timeout: 246 seconds]
sanguisdex has quit [Read error: Connection reset by peer]
aspiers has joined #ruby
yfeldblum has quit [Ping timeout: 255 seconds]
henesy has joined #ruby
Photism has quit [Quit: Leaving]
ta_ has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 256 seconds]
jheg has joined #ruby
ta has joined #ruby
fsapo has quit [Ping timeout: 265 seconds]
tier has joined #ruby
sanguisdex has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
AFKGeek has joined #ruby
kasperti_ has quit []
allcentury has joined #ruby
einarj has quit [Read error: Connection reset by peer]
einarj has joined #ruby
<jheg>
is this the way to return an array elements from another array that match the condition? …
tkuchiki has quit [Remote host closed the connection]
<jheg>
new_array = array.each{ |element| element == ‘ ‘ }
Darryl_ has joined #ruby
<jhass>
no, new_array will always equal array in this case
ta has quit [Ping timeout: 272 seconds]
tkuchiki has joined #ruby
<jhass>
as each returns the receiver
<jhass>
you want #select
BTRE has joined #ruby
<jheg>
thanks jhass
<Hanmac>
jheg look also for Array#grep
jlast has joined #ruby
bewees has joined #ruby
<jheg>
is that an array method Hanmac I can;t see it in docs
corehook has joined #ruby
<Hanmac>
jheg: oh i was wrong, its an Enumerable method
<jheg>
I’m finding it tricky to get my head around how classes can interact
ta has quit [Remote host closed the connection]
<jheg>
I have two classes one named Board and another called Player
jedrek has left #ruby [#ruby]
ta has joined #ruby
<shevy>
jheg well; which class is more important
<shevy>
how many boards exist: ANSWER_HERE
henesy has quit [Ping timeout: 265 seconds]
<shevy>
how many players exist: ANSWER_HERE
procat has joined #ruby
<jheg>
within board there is an array with 9 poisitions and within the Player class I want to create a method that takes a number between 1 and 9 and assigns a given value to that index in the array in the Board class
<jheg>
lemme link one sec
<jheg>
in answer to your q though 1 board exists and 2 players
jerius has joined #ruby
bmichelsen has quit [Quit: ZZZzzz…]
NoNMaDDeN has quit [Remote host closed the connection]
<jheg>
so its the tic tac toe game where players take turns to select a square
<shevy>
ok
<shevy>
so we have one board, and two players
<jheg>
yep
<shevy>
so class Board is more important
toretore has joined #ruby
<shevy>
it could hold the players in an Array called @players
bewees2 has joined #ruby
<shevy>
so you only have to instantiate a new Board.new
beef-wellington has joined #ruby
ta has quit [Ping timeout: 240 seconds]
<shevy>
or if you really wanna go nuts
<shevy>
you can make something like a class GameHandler to handle those two classes
<shevy>
I like to keep the amount of classes minimal; and the code also minimal
<teotwaki>
why would players be part of the board?
<shevy>
because the Board handles the game
<jheg>
that will keep track of which squares are taken so i guess so yes
<teotwaki>
that makes no sense whatsoever.
<shevy>
I think that makes perfect sense
<jheg>
Ah ok so intantiate the player objects inside the Board class?
<shevy>
jheg yeah; depends on how you want to initialize your game
<jheg>
I was going to have a game class
<shevy>
ok
dkphenom has joined #ruby
<jheg>
to initialize Board and players
Kricir has quit [Remote host closed the connection]
<shevy>
the Board is still the biggest contender; it will be initialized only once whereas there can be several players
bewees2 has quit [Client Quit]
<jheg>
but i need the player classes to be able to change the instance var inside the Board class
rshetty has quit [Remote host closed the connection]
<jheg>
if that makes sense?
bewees2 has joined #ruby
<shevy>
you can do that when you use the class Game master handler
bewees has quit [Ping timeout: 240 seconds]
<shevy>
since you will inside of it have instances both of class Board and class Player
bewees2 has left #ruby [#ruby]
<jheg>
I really only wanted the Board class to handle printing out the board and keeping track of squares
<teotwaki>
have a game class, board and player, game holds both board and player objects, and initializes them if appropriate. Players can be told they are playing on a specific board as shortcuts, but board should not be owners of the players.
<shevy>
yeah
momomomomo has joined #ruby
jerius has quit [Remote host closed the connection]
<teotwaki>
is a board composed of players? No. So it should not instantiate them nor take care of their life cycle.
<jheg>
ok so how then can I get the method within the player classes to be able to change the instance var in the Board class?
rigel has joined #ruby
<teotwaki>
@player.take_square @board, number
<jheg>
how to I tell the program that those player classes need to be able to access the Board object
<teotwaki>
or as I said, when you initialise the player object
ndrei_ has joined #ruby
jerius has joined #ruby
<teotwaki>
Player.new @board
Takle has quit [Remote host closed the connection]
sailias has joined #ruby
DaniG2k has quit [Quit: leaving]
<jheg>
sorry what is happening here? @board?
freerobby has joined #ruby
<gregf_>
how about: Game.new(Player.new("Alan", "OH"), Player.new("Ted", "GA"),Board.new(ARGV.shift || "3",ARGV.shift ||"3")).play()
DaniG2k has joined #ruby
cleopatra has joined #ruby
Channel6 has joined #ruby
<shevy>
jheg he meant that inside your class Game, you will have instantiated board as @board = Board.new
whoisjake has joined #ruby
<teotwaki>
class Player; def initialize(board); assign_to board; end; def assign_to(board); @board = board; end; def assigned?; defined?(@board) and !@board.nil?; end; def take_square(number, board = nil); if board.nil? and !assigned?; # raise here, etc...
<jheg>
got you thanks guys
joast has joined #ruby
BTRE has quit [Ping timeout: 240 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
ndrei_ has quit [Quit: leaving]
ndrei has quit [Quit: leaving]
ndrei has joined #ruby
spider-mario has joined #ruby
<waxjar>
a board does not consist of players, but a player consists of a board?
ndrei_ has joined #ruby
ndrei__ has joined #ruby
<jheg>
players share a board
ptrrr has joined #ruby
<apeiros_>
players board shares!
<teotwaki>
waxjar: composition != aggregation
<teotwaki>
in this case, the board can continue to exist with the players changing to another board.
Takle has joined #ruby
clauswitt has quit [Ping timeout: 265 seconds]
<teotwaki>
i've typed board so many times and heard it so many times in my head it doesn't sound like a word anymore.
<jhass>
if you want a no trust design you would have each player their own board as well as master board in the game class. Players then hand out Moves, the Game controller verifies the moves and hands it out to its own board as well as to the other players which update their internal Board
<waxjar>
the player should probably not keep track of the board at all, just mark a square
NoNMaDDeN has joined #ruby
<jhass>
that also would allow AI implementations of Player that have an optimized data structure for their AI
<teotwaki>
waxjar: true, it was just a shorthand to not have to send @board to the take_square() method all the time, but a current_board helper would be more appropriate, I concur.
drewvanstone has joined #ruby
<jhass>
but I guess that's over the top for this one
einarj has quit [Remote host closed the connection]
<teotwaki>
jhass: nice, hadn't thought of that.
<teotwaki>
jhass: is that a common design pattern in game development?
mengu has quit []
divi has joined #ruby
<jhass>
no idea, I'm not a game dev
<jhass>
we had something alike for a reversi game competition at university here
<jhass>
where we would load other teams AIs into our games
corehook has quit [Remote host closed the connection]
lampd1 has joined #ruby
<shock_one>
jhass, you're my hero. I always forget about this method.
wjimenez5271 has joined #ruby
lampd1 has quit [Client Quit]
francisfish has quit [Remote host closed the connection]
MrIlyas has quit [Read error: Connection reset by peer]
stunder has joined #ruby
sargas has quit [Quit: This computer has gone to sleep]
<jheg>
teotwaki: i've typed board so many times and heard it so many times in my head it doesn't sound like a word anymore.
<jheg>
^ Same lol
j2p2 has quit [Ping timeout: 244 seconds]
DaniG2k has quit [Quit: leaving]
ta has joined #ruby
momomomomo has quit [Quit: momomomomo]
freerobby has joined #ruby
rh1n0 is now known as rh1n0_away
Takle has joined #ruby
<teotwaki>
:)
marr has joined #ruby
wjimenez5271 has quit [Ping timeout: 250 seconds]
supersym has joined #ruby
<jheg>
I’m trying to just understand the basics of class relationships before embarking on more complex features
kohgpat has joined #ruby
<jheg>
it’s what and how is accessible from outside classes that I want to better understand
Techguy305 has joined #ruby
BTRE has joined #ruby
jottr has quit [Ping timeout: 272 seconds]
<jheg>
for instance I know if a class inherits from a another class it has access to its methods but what if I ont want to inherit any of its methods and just need to be able to manipulate one of its states
oleo has quit [Quit: Verlassend]
dc_ has joined #ruby
ta has quit [Ping timeout: 250 seconds]
drewvanstone has quit [Ping timeout: 250 seconds]
henesy has joined #ruby
<jhass>
a bit vague, but it sounds like you would extract that method into a mixin
<jheg>
and I’m sure you guys have probs already told me how but it starts to get fuzzy when many bits of syntax are in my noob mind at once :)
workmad3 has joined #ruby
jottr has joined #ruby
<jheg>
well i’d probable do that so both Player and ComputerPlayer class have access to it but they still need access to the instance variable from a different class that they dont inherit from
<jhass>
don't be afraid to make mistakes, they teach you best
<jheg>
certainly making a few of those
einarj has joined #ruby
basichash has joined #ruby
j2p2 has joined #ruby
vimer has joined #ruby
last_staff has quit [Quit: I gots to go]
kevinxu has joined #ruby
i0n has quit [Quit: snooze]
kevinxu is now known as Guest57388
dcunit3d has joined #ruby
gsd has joined #ruby
Guest57388 has quit [Max SendQ exceeded]
anarang has quit [Quit: Leaving]
einarj_ has joined #ruby
oleo has joined #ruby
yfeldblum has joined #ruby
BTRE has quit [Ping timeout: 255 seconds]
msmith_ has quit [Remote host closed the connection]
nkumari has joined #ruby
workmad3 has quit [Ping timeout: 272 seconds]
msmith_ has joined #ruby
nkumari has quit [Remote host closed the connection]
nkumari has joined #ruby
corehook has joined #ruby
kohgpat has quit [Quit: leaving]
oleo has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
einarj has quit [Ping timeout: 272 seconds]
ptrrr has quit [Quit: ptrrr]
kohgpat has joined #ruby
yfeldblum has quit [Ping timeout: 255 seconds]
nvdpl has joined #ruby
jaequery has joined #ruby
nvdpl has quit [Max SendQ exceeded]
oo_ has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
bal has quit [Quit: bal]
nvdpl has joined #ruby
dc___ has joined #ruby
treehug88 has joined #ruby
mikepack has joined #ruby
CorySimmons has joined #ruby
oleo has joined #ruby
Xeago_ has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
dc_ has quit [Ping timeout: 245 seconds]
klmlfl has joined #ruby
tane has quit [Quit: Verlassend]
AFKGeek has quit [Quit: Fades into the shadows]
tgandrews has quit [Quit: tgandrews]
dh64 has joined #ruby
kohgpat has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 240 seconds]
Porpado has joined #ruby
Channel6 has quit [Quit: Leaving]
sambao21 has joined #ruby
sigurding has quit [Quit: sigurding]
rippa has joined #ruby
shock_one has quit [Remote host closed the connection]
fabrice31 has quit [Remote host closed the connection]
kamilc__ has joined #ruby
mjuszczak has joined #ruby
<ericwood>
unacceptable
Liulantao has quit []
<mjuszczak>
Is there an easy way to split and replace in ruby? IE: converting "example.com" to "dc=example,dc=com" which includes splitting on any number of "." and pre-pending "dc=" to each? I know how to split and how to replace but having trouble doing both at the same time.
Axy has joined #ruby
Mia has quit [Read error: Connection reset by peer]
fabrice31 has joined #ruby
kamil has quit [Ping timeout: 244 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
drewvanstone has joined #ruby
Techguy305 has quit [Ping timeout: 265 seconds]
NoNMaDDeN has quit [Remote host closed the connection]
rajeshchawla has quit [Remote host closed the connection]
aspires has quit []
<Grantlyk>
So i've got a Person class and i'm wondering if theirs a good way to write a self.numberOfPeople method so that I can do person = Person.new and then person.numberOfPeople and it says the number created so far
zorak8 has joined #ruby
<canton7>
that stinks
oleo is now known as Guest78773
<canton7>
why do you want that bit of information?
ta has quit [Ping timeout: 264 seconds]
<Grantlyk>
Because i'm learning, anything I learn could be useful in future
aspires has joined #ruby
tanath has joined #ruby
Macaveli has quit [Ping timeout: 255 seconds]
mary5030_ has joined #ruby
Guest78773 has quit [Ping timeout: 256 seconds]
<canton7>
here's a lesson: don't do that ;) it's extremely rare for you to need to know how many of something have been created - I don't think I've ever done it... :P
<canton7>
you could easily write such a method, if you wanted
mary5030_ has quit [Remote host closed the connection]
michaeldeol has quit [Ping timeout: 272 seconds]
<Grantlyk>
I'm not worried about the practicalities of ever needing to do it again, I just want to know how to do it
aspires has quit [Client Quit]
mary5030_ has joined #ruby
<Grantlyk>
I do want to, that's the idea behind it
spyderman4g63 has quit [Read error: Connection reset by peer]
michaeldeol has joined #ruby
mary5030 has quit [Ping timeout: 255 seconds]
roolo has quit [Quit: AAAAaaaaAAAAAAA]
tyll has quit [Ping timeout: 245 seconds]
<centrx>
Grantlyk, I would have methods Person.count and Person.increment_count
chrchr- has joined #ruby
<centrx>
Grantlyk, which use a class instance variable
jherbst has quit [Read error: Connection reset by peer]
<centrx>
Grantlyk, Person.increment_count being called from Person#initialize
i0n has joined #ruby
jherbst has joined #ruby
<Grantlyk>
centrx: Thank you
timonv_ has quit [Remote host closed the connection]
BTRE has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
lxsameer has joined #ruby
aspires has joined #ruby
tyll has joined #ruby
siwica1 has quit [Remote host closed the connection]
vifino has quit [Remote host closed the connection]
mistermocha has joined #ruby
siwica has joined #ruby
njames has joined #ruby
<jaequery>
inside a .erb, can you call methods?
aspires has quit [Client Quit]
x77686d has joined #ruby
<Grantlyk>
centrx: See when i'm making a call to Person.increment_count within Person#initialize, is that done through putting self.increment_count within Person#Initialize
poweratom__ has joined #ruby
Soda has quit [Remote host closed the connection]
michaeldeol has quit [Ping timeout: 256 seconds]
<centrx>
Grantlyk, In #initialize, self is the instance
poweratom__ has quit [Client Quit]
<centrx>
Grantlyk, Use self.class.increment_count or Person.increment_count to reference the class
nkumari has quit [Remote host closed the connection]
<centrx>
Grantlyk, The count has to be tracked in the class, as it counts all instances
lifenoodles has quit [Ping timeout: 258 seconds]
kohgpat has quit [Ping timeout: 272 seconds]
bricker`work has joined #ruby
vifino has joined #ruby
<Grantlyk>
centrx: Yeah that makes sense now, thanks a lot
tvw has quit []
govg has quit [Quit: leaving]
tatsuo has quit [Quit: Leaving...]
SCHAAP137 has joined #ruby
Grantlyk has quit []
Xeago_ has quit [Remote host closed the connection]
nkumari has joined #ruby
tlarevo has joined #ruby
n1lo has joined #ruby
Takle has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
olivier_bK has quit [Ping timeout: 264 seconds]
aspires has joined #ruby
sailias1 has joined #ruby
sailias has quit [Quit: Leaving.]
lifenoodles has joined #ruby
neoxquick has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
<jhass>
jaequery: sure
pontiki has joined #ruby
BTRE has joined #ruby
<pontiki>
hi rubyists
allcentury has quit [Ping timeout: 255 seconds]
mistermocha has quit []
xenomorph is now known as {xenomorph}
{xenomorph} is now known as xenomorph
<jaequery>
jhass: i'd have guessed i call it the same way i'd call instance variables ...
<jhass>
sure
<jaequery>
so if i have, def some_method , inside erb, i do @some_method
wjimenez5271 has quit [Remote host closed the connection]
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
nvdpl has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
airdeluxe has joined #ruby
Eiam has joined #ruby
foooobear has quit [Quit: (null)]
michaeldeol has joined #ruby
rtlong has joined #ruby
<jhass>
no
jottr_ has joined #ruby
benzrf is now known as benzrf|offline
jottr has quit [Read error: Connection reset by peer]
jdj_dk has quit [Remote host closed the connection]
rajeshchawla has joined #ruby
gregf has quit [Quit: WeeChat 1.0.1]
jdj_dk has joined #ruby
Bira has quit [Ping timeout: 264 seconds]
diegoviola has joined #ruby
postmodern has joined #ruby
ta has quit [Ping timeout: 272 seconds]
CustosLimen has quit [Ping timeout: 244 seconds]
aspires has joined #ruby
ta has joined #ruby
allcentury has joined #ruby
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jdj_dk has quit [Ping timeout: 258 seconds]
atomical has joined #ruby
klmlfl_ has joined #ruby
x77686d has quit [Ping timeout: 245 seconds]
kikati has joined #ruby
Xeago has joined #ruby
parduse has quit [Remote host closed the connection]
klmlfl has quit [Ping timeout: 240 seconds]
jasonwc_ has joined #ruby
tgandrews has quit [Quit: tgandrews]
coderhs has joined #ruby
coderhs has quit [Read error: Connection reset by peer]
jottr has joined #ruby
zzzbra has quit [Remote host closed the connection]
maletor has joined #ruby
josephnd1nton has joined #ruby
zzzbra has joined #ruby
rylev has quit [Remote host closed the connection]
deric_skibotn has quit [Ping timeout: 244 seconds]
lukevinc has joined #ruby
klmlfl_ has quit []
klmlfl has joined #ruby
Xeago_ has joined #ruby
deric_skibotn has joined #ruby
jottr_ has quit [Ping timeout: 255 seconds]
disKounted has joined #ruby
aspires has quit []
parduse has joined #ruby
decoponio has quit [Quit: Leaving...]
aspires has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
rshetty has joined #ruby
josephnd1nton has quit [Ping timeout: 258 seconds]
sambao21 has joined #ruby
baweaver has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 264 seconds]
patrick99e99 has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
byprdct has quit [Ping timeout: 255 seconds]
oo_ has joined #ruby
sambao21 has quit [Client Quit]
ghr has joined #ruby
byprdct has joined #ruby
speaking1ode has joined #ruby
<graft>
okay, so ary.uniq.length == ary.length will tell me if ary contains duplicates, but it seems like overkill. what's a faster way?
econerd4ever has joined #ruby
spyderma_ has joined #ruby
adriancb has joined #ruby
rshetty has quit [Ping timeout: 264 seconds]
speakingcode has quit [Ping timeout: 264 seconds]
michael_lee has quit [Quit: Ex-Chat]
ghostlines has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tgandrews has joined #ruby
benzrf|offline is now known as benzrf
spyderm__ has joined #ruby
<tobiasvl>
graft: doubt there is a faster one (except that you don't need to check the length, just compare the arrays), you have to traverse both arrays anyway
sargas has quit [Quit: Leaving]
<graft>
ary.uniq == ary is definitely slower than ary.uniq.length == ary.length
spyderman4g63 has quit [Ping timeout: 258 seconds]
<crome>
graft: that's pretty much the best way to go about it
ghr has quit [Ping timeout: 258 seconds]
econerd4ever has quit [Remote host closed the connection]
<graft>
how can it be the best? I don't need to compress ary to its uniq elements just to know if it has duplicates. if i find even one duplicate, that's enough, so there must be a faster way
<tobiasvl>
graft: hehe, yeah, on second thought that makes sense. you only traverse the one array with comparisons.
rylev has joined #ruby
i0n has joined #ruby
baweaver has joined #ruby
<tobiasvl>
graft: write your own method!
lidaaa has joined #ruby
<graft>
well, yeah, but i like posing these problems to see what people come up with
ghostlines has joined #ruby
govg has quit [Quit: leaving]
ghostlines has quit [Max SendQ exceeded]
sfr^ has quit [Excess Flood]
sdwrage has joined #ruby
sfr^ has joined #ruby
speakingcode has joined #ruby
ghostlines has joined #ruby
<crome>
graft: it's not about "compressing" an array or not, it's about trusting ruby that it knows how to filter out duplicates in an efficient way, perhaps better than what you can come up with
spyderma_ has quit [Ping timeout: 240 seconds]
<graft>
crome: yes, but i didn't want ary.uniq, i just want to know if it contains ANY duplicate elements
j_mcnally has joined #ruby
<graft>
crome: work is being done i don't care about
baweaver has quit [Remote host closed the connection]
econerd4ever has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
<crome>
are you actually contradicting yourself?
speaking1ode has quit [Ping timeout: 272 seconds]
<terrellt>
Why do you need to know if there's duplicates?
<graft>
that was my original purpose
<graft>
given an ary, see ifi t has any duplicates
lukevinc has quit [Quit: ChatZilla 0.9.91 [Firefox 24.8.0/20000101000000]]
<crome>
you seem to care about the work that is being done under the hood as you clearly have a problem with calling uniq on an array
renderful has quit [Remote host closed the connection]
tgandrews has quit [Quit: tgandrews]
econerd4ever has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
rajeshchawla has quit [Remote host closed the connection]
<graft>
you seem to be missing my point, never mind
* crome
doesn't mind
<terrellt>
Basically no matter what you do it's gonna be n^2, might as well do the concise way.
klmlfl has quit [Ping timeout: 256 seconds]
econerd4ever has joined #ruby
djbkd has joined #ruby
<apeiros>
hm? checking array for duplicates O(n^2)?
sambao21 has joined #ruby
<apeiros>
certainly not :)
bmichelsen has quit [Quit: ZZZzzz…]
kikati was banned on #ruby by apeiros [*!~kikati@*]
kikati was kicked from #ruby by apeiros [no spam]
rajeshchawla has joined #ruby
<terrellt>
I guess you could do n + nlogn
oo_ has quit [Ping timeout: 255 seconds]
<apeiros>
hash lookup is O(n)
jenrzzz has joined #ruby
Lucky__ has joined #ruby
<apeiros>
gah
<apeiros>
hash lookup is O(1)
<apeiros>
and array iteration O(n)
xymbol has quit [Quit: Be back later ...]
<apeiros>
so the resulting algorithm is O(n)
Lightsword has quit [Quit: Lightsword]
<terrellt>
Ah - iterating across the array and adding to a hash, if it exists then bail
<terrellt>
Yes, that's O(n)
rajeshchawla has quit [Remote host closed the connection]
econerd4ever has quit [Ping timeout: 240 seconds]
<apeiros>
an ary.uniq uses the same approach
workmad3 has joined #ruby
<apeiros>
so ary.uniq.length == ary.length is O(n) too
aspires has quit []
<terrellt>
There ya go, graft
<apeiros>
and yes, ary.uniq == ary is much more expensive
boombadaroomba has quit [Remote host closed the connection]
jds has quit [Quit: Connection closed for inactivity]
rylev has quit [Remote host closed the connection]
<havenwood>
as would be something like: sort.each_cons(2).all? { |a, b| a != b } }
<apeiros>
as in the case of an array without duplicates, it'll indeed do == on each element in the array (additionally to the uniq)
joonty has quit [Quit: joonty]
<apeiros>
havenwood: sorting is nlogn
<havenwood>
bad sort, no cookie
aspires has joined #ruby
<terrellt>
Hehe
louism2wash has quit [Quit: This computer has gone to sleep]
<apeiros>
unless you cheat (pre-sorted data + algorithm which takes advantage of that)
ghostlines has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
babykosh has joined #ruby
davidhq has joined #ruby
aspiers has quit [Ping timeout: 272 seconds]
wallerdev has joined #ruby
freerobby has quit [Quit: Leaving.]
hiyosi has joined #ruby
freerobby has joined #ruby
divi_ has quit [Ping timeout: 255 seconds]
govg has joined #ruby
deric_skibotn_ has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
deric_skibotn has quit [Ping timeout: 250 seconds]
deric_skibotn_ is now known as deric_skibotn
havenwood has quit [Remote host closed the connection]
baweaver has joined #ruby
boombadaroomba has joined #ruby
fandi has joined #ruby
hiyosi has quit [Ping timeout: 240 seconds]
kasperti_ has joined #ruby
arescorpio has joined #ruby
govg has quit [Quit: leaving]
<waxjar>
wouldn't it be easier to just use a Set in the first place, avoid duplicates altogether?
enape_101 has joined #ruby
ta has quit [Remote host closed the connection]
<enape_101>
How do I make it so that when a subscriber chooses a category, and enters their email address.. They will ONLY receive emails that are relevant to the category they chose? Bare in mind, the category select dropdown, is created with a constant on the category model. I.E CATEGORY_TYPES = {1 => "Fitness"} etc
zzzbra has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 255 seconds]
xrlabs has quit [Read error: Connection reset by peer]
Lingo______ has quit [Ping timeout: 240 seconds]
<jhass>
enape_101: Please do not crosspost without at least telling so. Experience shows that people don't bother to inform the other channels of provided solutions, therefore it is considered rude.
ta has quit [Ping timeout: 255 seconds]
jasonwc_ has quit []
<enape_101>
jhass, my apologies.
divi has joined #ruby
drewvanstone has quit [Ping timeout: 264 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
slester has joined #ruby
zzzbra has joined #ruby
duncannz has joined #ruby
ta has joined #ruby
renderful has joined #ruby
<graft>
apeiros: but i don't have to iterate over the whole array, so i should be able to do this in < O(n)
<terrellt>
graft: Not really how O notation works.
<crome>
and what do you think "each" does on that method?
<crome>
in*
<terrellt>
Worst case is O(n)
<graft>
eh? If that's O(log(n)), that's less than O(n)
rjl has joined #ruby
<graft>
crome: what do you think 'return' does on that method?
govg has joined #ruby
<gr33n7007h>
what about: arr == (arr|arr) or is that just shit
enape_101 has quit []
wjimenez5271 has quit [Read error: Connection reset by peer]
<terrellt>
graft: Test it. Benchmark functions.
<terrellt>
Use a large dataset.
<waxjar>
graft: im guessing #uniq is written in C tho and likely a bit faster, even if your algorithm is theoretically faster
wjimenez5271 has joined #ruby
divi has joined #ruby
<crome>
graft: sorry, I misunderstood you a bit. your method _may_ be faster if the duplicate is to be found early in the array
<graft>
waxjar: uniq is basically doing what i'm doing here, it's not going to be that much faster. it pushes stuff onto a ruby hash
sambao21 has joined #ruby
enape_101 has joined #ruby
<graft>
i'm not sure it's any faster, i think it's just written in C for the sake of it
Bira has quit [Remote host closed the connection]
gregf has joined #ruby
<terrellt>
Well, it bypasses the interpretation step. Again, benchmark it.
byprdct has quit [Quit: sleeping]
fabrice31 has joined #ruby
rylev has quit [Remote host closed the connection]
vifino has quit [Ping timeout: 258 seconds]
<waxjar>
if you do benchmark, pls report back. im curious :D
uber has quit [Ping timeout: 240 seconds]
<terrellt>
Or avoid having to check duplicates, of course, but it doesn't sound like you're solving a business use case.
spider-mario has quit [Remote host closed the connection]
<crome>
I think ruby was written in C only for the sake of it
Takle has joined #ruby
<crome>
Matz knew no better
nvdpl has quit [Quit: ZZZzzz…]
<eam>
what else would it be written in?
drewvanstone has joined #ruby
<crome>
dunno, javascript is all hip nowadays
<terrellt>
Well, he tried to write it in Ruby, but the paradox blew up the world.
ghostlines has joined #ruby
<eam>
barf
ghostlines has quit [Remote host closed the connection]
<benzrf>
terrellt: you think you're joking
aspires has quit []
<benzrf>
terrellt: the coffeescript compiler is in coffeescript, ghc is in haskell, gcc is in c (oh wait is it c++)
uber has joined #ruby
uber has quit [Max SendQ exceeded]
<waxjar>
the rust compiler is written in rust
ndrei_ has quit [Ping timeout: 258 seconds]
aspires has joined #ruby
ndrei__ has quit [Ping timeout: 255 seconds]
timonv_ has joined #ruby
<benzrf>
pypy is in py
<benzrf>
obviously
uber has joined #ruby
<apeiros>
22:35 graft: apeiros: but i don't have to iterate over the whole array, so i should be able to do this in < O(n)
uber has quit [Max SendQ exceeded]
<apeiros>
that's not how big-o works
<apeiros>
in the worst case, you DO have to iterate the whole array
<apeiros>
so it is O(n)
<terrellt>
13:37 terrellt: graft: Not really how O notation works.
ndrei has quit [Ping timeout: 240 seconds]
uber has joined #ruby
uber has quit [Max SendQ exceeded]
Avahey has joined #ruby
fabrice31 has quit [Ping timeout: 245 seconds]
<apeiros>
ah, late to the party :)
uber has joined #ruby
uber has quit [Max SendQ exceeded]
mikepack has quit [Remote host closed the connection]
uber has joined #ruby
uber has quit [Max SendQ exceeded]
Tranquility has quit [Quit: Connection closed for inactivity]
bmichelsen has joined #ruby
uber has joined #ruby
uber has quit [Max SendQ exceeded]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
byprdct has joined #ruby
uber has joined #ruby
uber has quit [Max SendQ exceeded]
agjacome_ has joined #ruby
uber has joined #ruby
uber has quit [Max SendQ exceeded]
baweaver has quit [Remote host closed the connection]
uber has joined #ruby
rkalfane has joined #ruby
boombadaroomba has quit [Remote host closed the connection]
cleopatra has joined #ruby
agjacome has quit [Ping timeout: 272 seconds]
j2p2 has quit [Ping timeout: 244 seconds]
xymbol has joined #ruby
Mars` has quit [Ping timeout: 272 seconds]
econerd4ever has joined #ruby
ghostlines has joined #ruby
FooMunki has joined #ruby
adriancb has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
ta has quit [Remote host closed the connection]
<graft>
yeah, so it's O(n) in the worst case, but not on average
adriancb has joined #ruby
ta has joined #ruby
timonv_ has quit [Remote host closed the connection]
<graft>
depending on the complexity of the dataset (i.e., what's the density of duplicates) the two are quite different in speed
duggiefresh has quit []
josephnd1nton has joined #ruby
<apeiros>
graft: on average, it'll iterate n/2
<graft>
apeiros: again, depending on the complexity of the dataset
<apeiros>
and since a factor is removed when doing the limit, it's still O(n)
<apeiros>
no, not depending on the complexity of the dataset :)
henesy has joined #ruby
<graft>
apeiros: i just tested this :)
<apeiros>
if you have a biased dataset, the average will change
econerd4ever has quit [Remote host closed the connection]
<apeiros>
yes, and still not understood O(n) ;-)
delianides has quit [Remote host closed the connection]
econerd4ever has joined #ruby
delianides has joined #ruby
Mars` has joined #ruby
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
paulfm has quit []
tesaf has quit [Quit: Lost terminal]
j2p2 has joined #ruby
<graft>
seems like if the dataset is not ordered, and p(i==j) = x, it'll stop exponentially fast based on x one way and linearly the other
ta has quit [Ping timeout: 265 seconds]
procat has quit [Ping timeout: 240 seconds]
josephnd1nton has quit [Ping timeout: 255 seconds]
Flowrhent has joined #ruby
allcentury has quit [Ping timeout: 245 seconds]
Flowrhent has left #ruby [#ruby]
jlast has quit [Remote host closed the connection]
drewvanstone has quit [Ping timeout: 264 seconds]
boombadaroomba has joined #ruby
<apeiros>
graft: biased dataset is a factor
tier has quit [Remote host closed the connection]
jlast has joined #ruby
oo_ has joined #ruby
<graft>
well sure, but that means that it's not O(n) in all cases
<apeiros>
i.e. you say it has a 50% chance to hit in the first 10% of items - sure. that means a short-cutting algorithm runs faster. but by a factor. and factors are not part of O(n) notation.
henesy has quit [Ping timeout: 264 seconds]
benzrf is now known as benzrf|offline
<terrellt>
graft: O(n) isn't context sensitive.
<graft>
it's not by a factor, it's exponentially fast as opposed to linear
<apeiros>
algorithm A can run 1000x faster than B on average. but they can still both be O(n).
ghr has joined #ruby
delianides has quit [Ping timeout: 255 seconds]
<apeiros>
then you did a mistake in either measuring or analyzing.
Lightsword has joined #ruby
allcentury has joined #ruby
freerobby has quit [Quit: Leaving.]
<terrellt>
The moment you iterated over the entirety of the dataset it was O(n) at the very least.
<terrellt>
Or rather, the moment you had the potential to iterate over the entirety of the dataset.
<graft>
i.e., if the odds that p(i==j) = x, the odds of my encountering j == i go up exponentially as i iterate. i.e., the odds that i find a match are (1-x)^i
<apeiros>
terrellt: it could even be an algorithm which was guaranteed to only ever iterate n/2 - it's still be O(n)
<graft>
terrellt: absolutely not! that's just O(n) in the worst case
<apeiros>
there is no "O(n) in the worst case"
sambao21 has joined #ruby
nobitanobi has joined #ruby
ghostlines has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sambao21 has quit [Client Quit]
rajeshch_ has joined #ruby
<apeiros>
best case/worst case have their own name
Lightsword has quit [Client Quit]
<apeiros>
(and they too don't care about factors - just to have it said)
grzywacz has joined #ruby
grzywacz has joined #ruby
<graft>
no, but they do care about logs and exponents
<apeiros>
yes. and you have neither here.
i0n has quit [Quit: snooze]
jlast has quit [Ping timeout: 255 seconds]
oo_ has quit [Ping timeout: 264 seconds]
ghr has quit [Ping timeout: 256 seconds]
sambao21 has joined #ruby
<graft>
if my stopping time is a function not of the number of elements in the array but of the density of duplicates in that array, how is it O(n)?
benzrf|offline is now known as benzrf
Photism has joined #ruby
mikepack has joined #ruby
<apeiros>
again: density is a factor
samuel02 has quit [Remote host closed the connection]
ta has joined #ruby
qhartman has joined #ruby
<graft>
yes, but density is not a function of n
<centrx>
I may start using @@class_variables
benzrf is now known as benzrf|offline
<terrellt>
centrs: Only $
<apeiros>
it'd only change if you had a guarantee on "in the first N items of the array - no matter how big it is - there will be a duplicate". but then you'd have O(1) (since you're not dependent on the size of the array anymore)
<terrellt>
Globals only. All the time.
jjasonclark has joined #ruby
<apeiros>
graft: then you're using the term density wrong
<apeiros>
density is x per n
baroquebobcat has joined #ruby
<apeiros>
but I think you're using density correctly. but misunderstand how it works.
mistermocha has joined #ruby
i0n has joined #ruby
allcentury has quit [Ping timeout: 256 seconds]
babykosh has joined #ruby
jenrzzz has joined #ruby
slester has quit [Remote host closed the connection]
drewvanstone has joined #ruby
max96at is now known as max96at|off
i0n has quit [Client Quit]
<eam>
the n in O(n) can be anything
havenwood has joined #ruby
aspires has quit []
charliesome has joined #ruby
i0n has joined #ruby
<nobitanobi>
How can I do the opposite of /mi/ =~ "hi mike"
Lingo______ has joined #ruby
<nobitanobi>
besides doing if !(/mi/ =~ "hi mike")
<apeiros>
!~
<apeiros>
or unless =~
<nobitanobi>
thanks apeiros
m8 has quit [Quit: Sto andando via]
babykosh has quit [Quit: babykosh]
Rahul_Roy_ has quit [Quit: Connection closed for inactivity]
vifino has joined #ruby
babykosh has joined #ruby
<eam>
ruby's socket class is so inadequate
Mateon1 has quit [Ping timeout: 240 seconds]
<apeiros>
thank you. now I hear willie's "adequate" song
<crome>
it still doesn't read after reset?
<crome>
thought they fixed it already, duh
aspires has joined #ruby
melik has joined #ruby
henesy has joined #ruby
<eam>
how am I supposed to work with cmsg structures >+/
kirun has quit [Quit: Client exiting]
aspires has quit [Client Quit]
ta has quit [Remote host closed the connection]
Dieseltime has joined #ruby
ta has joined #ruby
<eam>
not only can I not create them without playing with pack, there's only recvfrom() and no recvmsg()
<crome>
I'm wondering, why can't you use a higher level implementation?
henesy_ has joined #ruby
<eam>
like/
<eam>
?
ht__th has quit [Ping timeout: 265 seconds]
blackmesa has joined #ruby
<crome>
tcpsocket/unixsocket/whateversocket
henesy has quit [Ping timeout: 265 seconds]
<eam>
I'm not sending data, I'm sending ancillary messages
bricker`1ork has joined #ruby
procat has joined #ruby
spyderm__ has quit [Remote host closed the connection]
<eam>
oh, unixsocket implements recvfrom (sigh)
<eam>
why would that not be available in socket?
aspires has joined #ruby
<eam>
erk no recvmsg, so still nogo
ta has quit [Ping timeout: 265 seconds]
mistermocha has quit [Remote host closed the connection]
gregoriokusowski has quit [Quit: gregoriokusowski]
<crome>
ah
bricker`work has quit [Ping timeout: 245 seconds]
<eam>
crome: let's say for example I want to use SCM_CREDENTIALS to authenticate the peer on the other end of the socket
sts has quit [Ping timeout: 264 seconds]
<eam>
I can write ffi but honestly, recvmsg ought to be an available primitive in Socket
xorax_ has joined #ruby
henesy_ has quit [Ping timeout: 250 seconds]
<eam>
I guess I can make a patch
* eam
ratholes
zzzbra has quit [Remote host closed the connection]
Lingo______ has quit [Quit: Be back later ...]
Lingo______ has joined #ruby
klmlfl has joined #ruby
dda has quit [Ping timeout: 240 seconds]
chipotle has quit [Quit: cya]
<sweeper>
eam: surely you're not doing something so weird that zeromq or the like won't suffice?
spookley has joined #ruby
<eam>
I am
andrewlio has quit [Quit: Leaving.]
<eam>
I like to use ruby for short proof of concept snippets
Lingo______ has quit [Ping timeout: 245 seconds]
nateberkopec has quit [Quit: Leaving...]
bricker`work has joined #ruby
sts has joined #ruby
sts is now known as Guest14797
ptrrr has quit [Quit: ptrrr]
jenrzzz has quit [Ping timeout: 258 seconds]
samuel02 has joined #ruby
bricker`1ork has quit [Ping timeout: 272 seconds]
livingstn has quit []
Lingo______ has joined #ruby
eightfold has joined #ruby
<eightfold>
should i sudo when i install gems on os x?
Guest14797 has quit [Ping timeout: 244 seconds]
Bira has joined #ruby
<apeiros>
eightfold: depends on your installation
<eightfold>
apeiros: how?
<apeiros>
but generally consensus is to do a user install of ruby and not use sudo
supersym has joined #ruby
<apeiros>
ah, actually I think rubygems can do a user-install of gems even for a system install of ruby
<eightfold>
apeiros: i don’t want to install ruby via rubygems
<eightfold>
i want to install jekyll
henesy_ has joined #ruby
<apeiros>
you can't install ruby via rubygems. that's not what I said either.
<havenwood>
eightfold: jekyll is a rubygem. rubygems ships with ruby.
<apeiros>
the way you install ruby defines how rubygems installs gems by default.
<apeiros>
if your ruby is a system wide installation of ruby, rubygems will default to system wide gem installations. and those require sudo.
<eightfold>
apeiros: i’m using system default version of ruby
<eightfold>
on yosemite
<apeiros>
ok. that's a system wide install.
<apeiros>
you can try `gem install jekyll --user-install`
<Radar>
eightfold: Install Ruby 2.1.5 through ruby-install.
<apeiros>
you either need a user install of ruby. or you use --user-install.
pietr0 has joined #ruby
ghr has joined #ruby
<eightfold>
apeiros: apparently, looking at uninstaller logs i can see that ~/.gem was created though
<eightfold>
even though it failed
* Radar
taps keyboard
<eightfold>
but i shouldn’t wipe that?
<Radar>
is this thing on?
<eightfold>
to start from zero before doing —user-install?
workmad3 has joined #ruby
<Radar>
eightfold: Please stop what you're doing right now and install ruby-install, then install ruby 2.1.5 using that, then use chruby to auto switch into that Ruby.
rajeshch_ has quit [Remote host closed the connection]
<Radar>
Completely ignore your system Ruby because it is a world of pain.
<Radar>
It's outdated and the permissions are not setup correctly.
benzrf|offline is now known as benzrf
<eightfold>
arghhh
hiyosi has joined #ruby
divi has quit [Ping timeout: 272 seconds]
<eightfold>
i can sense the pain and mess closing in
<apeiros>
of course. because you run around like a blind chicken.
<eightfold>
haha
<eightfold>
yeah, i suppose
<apeiros>
I told you what you need to know.
<eightfold>
i just want to install jekyll. that’s all.
<apeiros>
you have to use it yourself.
<Radar>
eightfold: And I've given you direction how you can do that.
<apeiros>
Radar's suggestion btw. is to do a user install of ruby
<Radar>
eightfold: Setup Ruby correctly on your machine and you won't have problems.
<apeiros>
personally I prefer a user install of ruby. but gem install --user-install should work just fine.
babykosh has quit [Quit: babykosh]
<eightfold>
apeiros: or just do gem install jekyll --user-install =
<eightfold>
?
babykosh has joined #ruby
henesy has quit [Ping timeout: 250 seconds]
<eightfold>
but should i somehow undo the mistake i just did?
<apeiros>
yes. that's how you install a gem without sudo on a system-wide ruby.
<eightfold>
(which was btw recommended by the jekyll developers themselves)
<apeiros>
nothing happened
<apeiros>
you didn't have permissions to let something happen.
dda has joined #ruby
<apeiros>
you forget context.
<eightfold>
apeiros: a dir was creted
ghr has quit [Ping timeout: 255 seconds]
<eightfold>
apeiros: ~/.gem
<apeiros>
the jekyll developers can't possibly account for all possible setups. their recommendation assumes the best-practice - which is a user install of ruby.
<apeiros>
eightfold: that won't hurt you (~/.gem)
workmad3 has quit [Ping timeout: 240 seconds]
devdazed has quit [Quit: Computer has gone to sleep.]
rajeshchawla has joined #ruby
divi has joined #ruby
<apeiros>
IMO ruby (or rubygems actually) could do a better job.
hiyosi has quit [Ping timeout: 258 seconds]
testcore has quit [Remote host closed the connection]
Techguy305 has joined #ruby
lidaaa has quit [Ping timeout: 258 seconds]
rajeshchawla has quit [Remote host closed the connection]
<eightfold>
apeiros: in my (uneducated) opinion i think so too
<eightfold>
:)
<apeiros>
note that if you do a --user-install, the executable will be installed in a dir which is probably not in your $PATH
charliesome has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<eightfold>
apeiros: oh of course, there’s always a but…
<apeiros>
for me (yosemite too) it's ~/.gem/ruby/2.0.0/bin/
tkuchiki has joined #ruby
<apeiros>
so don't forget to add that to $PATH.
<eightfold>
ok
lucyinthesky has left #ruby ["Leaving"]
<eightfold>
apeiros: any other downsides to —user-install?
beef-wellington has quit [Ping timeout: 245 seconds]
<apeiros>
as said, I don't use it myself
agjacome has joined #ruby
Channel6 has joined #ruby
dandaman has joined #ruby
agjacome_ has quit [Ping timeout: 250 seconds]
baweaver has joined #ruby
siso has joined #ruby
<dandaman>
what is the difference between {4=>"Denver", 9=>"Phoenix", 10=>"Houston", 11=>"Dallas"} and [[11, "Dallas"], [4, "Denver"], [10, "Houston"], [9, "Phoenix"]]
<dandaman>
the first one is a hashmap right?
<dandaman>
what is the 2nd one?
<Radar>
First one is a Hash, second one is an Array of Arrays, which can be converted into a Hash with Hash[<that array>]
henesy has joined #ruby
agjacome has quit [Ping timeout: 255 seconds]
oo_ has quit [Ping timeout: 255 seconds]
Azure has joined #ruby
<eightfold>
apeiros: could i use tilde in the $PATH ~/.gem/ruby/2.0.0/bin/
zzzbra has quit [Remote host closed the connection]
<Radar>
thanks apeiros :)
<volty>
yap
rjl has quit [Ping timeout: 264 seconds]
<apeiros>
by the end of this year we'll finally have all apps moved to rails 4.1 and ruby 2.1. finally will be able to use all those goodies :D
Lightsword has joined #ruby
<apeiros>
(well, all except for one - which uses ruby 1.8.1 and rails 1.2.3 - iirc)
rylev has joined #ruby
testcore has joined #ruby
gebbione has joined #ruby
<volty>
I use rbenv and it was almost a nightmare to set it to use shims from apache (btw forgot how I did it)
Kricir has quit [Remote host closed the connection]
babykosh has quit [Quit: babykosh]
procat has joined #ruby
<volty>
what's best out there? just to consider for the next reinstall ?
zorak8 has joined #ruby
<eightfold>
apeiros: which command should i run when i update gems when having used —user-install
<apeiros>
volty: If you use apache - I still find rvm + passenger quite painless.
fabrice31 has joined #ruby
babykosh has joined #ruby
zzzbra has joined #ruby
<apeiros>
eightfold: good question. again, as said, I don't use --user-install. try `gem help update`?
<apeiros>
maybe it's got a --user-install flag too
kapott has quit []
<eightfold>
mmm
<volty>
thx, saved in notes, together with nick
<eightfold>
i’ll search around
bigkevmcd has quit [Ping timeout: 250 seconds]
<volty>
could be nice to be able to run apache in user mode. I guess it is possible but haven't searched for info
duncannz has quit [Ping timeout: 240 seconds]
fabrice31 has quit [Ping timeout: 250 seconds]
sambao21 has joined #ruby
jobewan has quit [Quit: Leaving]
lidaaa has joined #ruby
dkphenom has joined #ruby
banister has joined #ruby
henesy has quit [Ping timeout: 244 seconds]
<volty>
Ops, already as www-data user. So I mean so many system-wide settings shouldn't necessarily require root privileges. Maybe I'd better try to tweak with a www-data or a new ruby-group. (I am afraid of gems having access to the whole system).
o0oo0o has joined #ruby
zzzbra has quit [Remote host closed the connection]
nobitanobi has quit [Remote host closed the connection]
msmith_ has quit [Ping timeout: 244 seconds]
gebbione has left #ruby ["Ex-Chat"]
<apeiros>
volty: I have user installs for ruby with rvm+apache
<apeiros>
different user than the apache user
zzzbra has joined #ruby
hiyosi has joined #ruby
Bira has joined #ruby
nobitanobi has joined #ruby
atmosx has joined #ruby
<atmosx>
hello
supersymmetry has joined #ruby
rajeshchawla has joined #ruby
<atmosx>
can an native englihs speaker exlain to me what piggy-backing means?
<volty>
apeiros: it means that I am going to get rid of rbenv after this final one: so you managed to never be forced to sudo install a gem ?
<atmosx>
effectively piggy-backing a neighbours connection. <--
<graft>
is rubygems.org painfully slow for anyone? can i use a mirror or something?
<apeiros>
volty: normal rvm installation.
<apeiros>
so no sudo, no
<volty>
ok, thx a lot
<atmosx>
volty: I use rvm too, if it needs sudo it asks for it, but it's very rare situation
supersym has quit [Ping timeout: 255 seconds]
jjasonclark has quit [Quit: jjasonclark]
<apeiros>
volty: ah, passenger might require sudo. not the gem, but the apache module. but I guess that's obvious.
zzzbra has quit [Ping timeout: 264 seconds]
renderful has quit [Remote host closed the connection]
Bira has quit [Ping timeout: 272 seconds]
tlarevo has quit [Ping timeout: 256 seconds]
giuseppesolinas has joined #ruby
<volty>
yes, of course. Let rvm be, after lost time with rbenv, thx again all
despai has quit [Quit: This computer has gone to sleep]
Mars` has quit [Quit: WeeChat 1.0.1]
sambao21 has quit [Quit: Computer has gone to sleep.]
nateberkopec has quit [Quit: Leaving...]
agjacome has joined #ruby
jheg has quit [Quit: jheg]
tokik has joined #ruby
banister has quit [Ping timeout: 255 seconds]
zzzbra has joined #ruby
jack_rabbit has joined #ruby
einarj_ has quit [Remote host closed the connection]
Alina-malina has quit [Ping timeout: 272 seconds]
Alina-malina has joined #ruby
t7y9r has joined #ruby
banister has joined #ruby
mr_foobar_baz has joined #ruby
baweaver has quit [Remote host closed the connection]