Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<tectonic>
could use text_attribute or a document store
<tectonic>
mysql might even work at that size
<tectonic>
but not really needed
fishn1x [fishn1x!~fishn1x@adsl-76-192-1-84.dsl.wlfrct.sbcglobal.net] has joined #ruby
<kreantos>
what about mongodb
graft [graft!~graft@adsl-99-184-205-128.dsl.pltn13.sbcglobal.net] has joined #ruby
<graft>
err, so if i have an if statement with multiple && clauses, do i have to have them all on one line?
<apeiros_>
graft: no
<apeiros_>
there's quite little on ruby that you have to have on one line
<graft>
if i try putting them on more than one line i get syntax error: unexpected tANDOP
<apeiros_>
only when stuff becomes ambiguous it must either be on one line or you have to escape the newline (\ as last char)
<apeiros_>
graft: you probably put the && on the next line, right?
<tectonic>
kreantos: i've heard mixed things, but give it a try if you want
<graft>
apeiros_: yeah... just figured that out
<apeiros_>
graft: think about how ruby sees it
<graft>
apeiros_: so i just do if A && \n B && \n C
dcl [dcl!~user@186.214.55.253] has joined #ruby
<apeiros_>
graft: f.ex.
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby
<graft>
cool, thanks
<mifadir>
or just \
<mifadir>
he don't need \n
<mifadir>
like old languages
<apeiros_>
mifadir: he used \n to indicate newlines in his code
<mifadir>
if a==0 \ && b==1puts "OK"
<mifadir>
try this one two
<kreantos>
tectonic, ty for the input
<apeiros_>
mifadir: also, already been said :-p
<mifadir>
sorry, i wasn't here :(
<tectonic>
kreantos: np
MasterIdler__ [MasterIdler__!~MasterIdl@static-66-225-153-161.ptr.terago.net] has joined #ruby
<apeiros_>
mifadir: 01:03 apeiros_: only when … either … or you have to escape the newline (\ as last char)
youdonotexist [youdonotexist!~youdonote@68.178.70.244] has joined #ruby
<mifadir>
last char on the current line, you mean
<mifadir>
??
h4mz1d [h4mz1d!~hamfz@DHCP-214-001.wireless-resnet.ua.edu] has joined #ruby
<apeiros_>
mifadir: of course. \ as last char on the line you want to escape the newline. maybe I should have been more concrete.
hadees [hadees!~hadees@64.132.24.248] has joined #ruby
MekkisFreenode [MekkisFreenode!~MekkisFre@2a00:dd0:0:6:80a6:4fff:fec7:d456] has joined #ruby
hasrb [hasrb!~hasrb@108-85-134-26.lightspeed.austtx.sbcglobal.net] has joined #ruby
<mifadir>
great
<mifadir>
i think this is and old solution derived from c language
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
byronb [byronb!~byronb@c-24-18-227-118.hsd1.wa.comcast.net] has joined #ruby
sdferfx [sdferfx!~jeff@gateway/tor-sasl/sdferfx] has joined #ruby
<sdferfx>
can I get ruby to return a bad exit code when a showstopper exception is thrown?
<apeiros_>
mifadir: probably. there's a couple of languages matz took inspiration from which can do that.
<burgestrand>
sdferfx: exit, it’s a method on kernel, allows you to pass your own exit code
sbanwart_ [sbanwart_!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
adac [adac!~adac@85-127-20-90.dynamic.xdsl-line.inode.at] has joined #ruby
<apeiros_>
sdferfx: unrescued exceptions automatically result in an exit-status != 0
<sdferfx>
burgestrand, so do I have to run the whole thing in a giant begin..rescue block?
<apeiros_>
also, exceptions are raised, not thrown
<fbea>
<< ruby nuby here
<apeiros_>
throw has a different meaning in ruby
drknus [drknus!~user@142.68.215.147] has joined #ruby
<sdferfx>
ok, thanks
<fbea>
why don't I have a gemfile
<fbea>
i created a new app
<fbea>
and i can't find a gemfile
<fbea>
O.o
<apeiros_>
fbea: what do you mean, by "created a new app"?
<apeiros_>
talking about rails?
<deryl>
did you make one? ruby doens't create GEmfile files
<fbea>
rails
<deryl>
rails does
<deryl>
ahh see #rubyonrails
<fbea>
sry
<apeiros_>
fbea: #rubyonrails then
<fbea>
ah kk
<fbea>
thx all
albemuth [albemuth!~albemuth@201.198.78.18] has joined #ruby
<apeiros_>
yw ;-)
<deryl>
and also make sure you give them the rails version. 2.x did NOT crate Gemfiles
<shevy>
you send him to his demise!
<fbea>
oh
<deryl>
thats a 3.x 'feature'
<shevy>
4.x will be The Rails Operating System
<deryl>
hehe
<deryl>
i got into Ruby because of rails.. havne't touched rails in months
<deryl>
been doing straight ruby or cucumber/rspec|bacon test writing
xiaotian [xiaotian!~guoxiaoti@4.30.138.134] has joined #ruby
* mifadir
apeiros_ how a big division can be done ??
<apeiros_>
mifadir: what do you mean by 'big division'?
<mifadir>
biginteger/biginteger
<apeiros_>
what's not working when you just do a/b ?
fixl [fixl!~fixl@203-158-37-72.dyn.iinet.net.au] has joined #ruby
<mifadir>
no no, language make some appximation to value
<shevy>
sure
<apeiros_>
mifadir: hu?
<shevy>
ruby can lie to you
<mifadir>
even (a/b).to_f
<apeiros_>
well, int/int == int, so it'll truncate
<apeiros_>
you want a float result - use .fdiv then
<shevy>
but you can use BigDecimal... like puts BigDecimal.new("1.1") - BigDecimal.new("1.0")
<apeiros_>
a.fdiv(b)
<apeiros_>
or Rational
<shevy>
cool haven't seen fdiv before
<mifadir>
i will see if the convergence is true
<shevy>
5.0.fdiv 2 # => 2.5
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
<mifadir>
i'm looking for better precision
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
<apeiros_>
mifadir: Rational and BigDecimal
<shevy>
sniper mifadir looking for targeted precision is in da house
rickmasta [rickmasta!~rickmasta@pool-71-183-247-164.nycmny.fios.verizon.net] has joined #ruby
hadees [hadees!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
DrKnus [DrKnus!~user@142.68.215.147] has joined #ruby
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
d-snp [d-snp!~d-snp@smurfer.student.utwente.nl] has joined #ruby
DrKnus [DrKnus!~user@142.68.215.147] has quit [#ruby]
* mifadir
better for mifadir to begin deal with ruby-gmp,
youdonotexist [youdonotexist!~youdonote@68.178.70.244] has joined #ruby
stringoO [stringoO!~JLstring@bas1-toronto42-1279599122.dsl.bell.ca] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
sbanwart_ [sbanwart_!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
eywu [eywu!~Adium@97-93-99-217.static.mtpk.ca.charter.com] has quit [#ruby]
SamWhited [SamWhited!~SamWhited@c-71-56-64-198.hsd1.ga.comcast.net] has joined #ruby
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby
hasrb [hasrb!~hasrb@108-85-134-26.lightspeed.austtx.sbcglobal.net] has joined #ruby
cbuxton [cbuxton!~Adium@nat/partnerpedia/x-okirrvhgnyvggrbx] has joined #ruby
clockwize [clockwize!~clockwize@5e0675f5.bb.sky.com] has joined #ruby
a_a_g [a_a_g!~aag@121.246.32.238] has joined #ruby
jackhammer2022 [jackhammer2022!~textual@c-24-34-124-94.hsd1.ma.comcast.net] has joined #ruby
<jackhammer2022>
any suggestions for a gem like 'linalg'
brngardner [brngardner!~brngardne@c-98-192-3-166.hsd1.ga.comcast.net] has joined #ruby
tommyvyo [tommyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
brngardner [brngardner!~brngardne@c-98-192-3-166.hsd1.ga.comcast.net] has joined #ruby
<jensn>
jackhammer2022: There is a GSL gem.
<jensn>
If you need dense stuff.
<jensn>
I don't really know if there are any good libraries in ruby for sparse.
<jackhammer2022>
i want to do singular value decomposition
<jackhammer2022>
linalg does it nicely
<jackhammer2022>
but its a pain to install it in mac
<jackhammer2022>
quickly
<jackhammer2022>
i will check the GSL gem
<jensn>
I don't think that one is super-easy to install either though, since it needs GSL.
scx [scx!~Administr@abub241.neoplus.adsl.tpnet.pl] has joined #ruby
tommyvyo [tommyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
TrevorBramble [TrevorBramble!~tbramble@trevorbramble.com] has quit [#ruby]
radic [radic!~radic@dslb-178-002-223-048.pools.arcor-ip.net] has joined #ruby
<shevy>
sdwrage you mean so that 0 returns false and all else returns true?
<sdwrage>
I got it
<sdwrage>
I should have used be_true
<sdwrage>
instead of eql(true)
<sdwrage>
shevy: thanks anyways :)
nwonknu [nwonknu!~nwonknu@unaffiliated/nwonknu] has joined #ruby
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
orospakr [orospakr!~orospakr@mobotropolis.orospakr.ca] has joined #ruby
justicefries [justicefries!~justicefr@c-24-9-170-34.hsd1.co.comcast.net] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
fullsailor [fullsailor!~fullsailo@ip24-250-174-76.ga.at.cox.net] has joined #ruby
msta [msta!~mike@96-42-46-165.dhcp.ftbg.wi.charter.com] has joined #ruby
<jooles>
anyone?
<nwonknu>
Everyone.
<jooles>
That guy
tommyvyo [tommyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
<jooles>
Seriously though, everything I've found on the net says to make a singleton class you just gotta "require 'singleton'" in the ruby file and then "include Singleton" in your class and then just use Class.instance to create objects. I've done that and I just get "undefined method `instance'"
<jooles>
Am I doing something really obvious wrong?
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-61-141.mco.bellsouth.net] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-61-141.mco.bellsouth.net] has quit [#ruby]
scx_ [scx_!~Administr@eon189.neoplus.adsl.tpnet.pl] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
<jooles>
banisterfiend, Yeah, that works fine but if I create a file logger.rb with that code in it and then in irb run "require 'logger.rb; log = Logger.instance" I get the undefined method error
r0bby [r0bby!~wakawaka@64.134.71.218] has joined #ruby
r0bby [r0bby!~wakawaka@guifications/user/r0bby] has joined #ruby
Sircan [Sircan!~Sircandi@110.137.187.88] has joined #ruby
<jooles>
though, syntactically correct unlike what I just wrote...
<bitops>
if I run this script (ruby 1.8.7) it works fine for about 1000 iterations, but then blows up with "bad file descriptor". Am I missing something here?
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
azbarcea____ [azbarcea____!~quassel@86.125.237.49] has joined #ruby
nwonknu [nwonknu!nwonknu@gateway/shell/anapnea.net/x-ughqakrqcadfrvvi] has joined #ruby
FluxiFlax2023 [FluxiFlax2023!~ali.jawad@193.227.186.146] has joined #ruby
jarin [jarin!~textual@ip68-8-14-186.sd.sd.cox.net] has joined #ruby
p0y [p0y!~p0y@112.210.55.137] has joined #ruby
bairui [bairui!~arthurb@115.239.8.58] has joined #ruby
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby
kenperkins [kenperkins!~textual@50-47-18-37.evrt.wa.frontiernet.net] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
<bairui>
does anyone know how to extend oniguruma with a new syntax flavour?
SegFaultAX [SegFaultAX!~SegFaultA@c-98-248-241-85.hsd1.ca.comcast.net] has joined #ruby
adeponte [adeponte!~adeponte@pool-108-0-196-162.lsanca.fios.verizon.net] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
zakwilson [zakwilson!~quassel@65-122-15-169.dia.static.qwest.net] has joined #ruby
aidanfeldman [aidanfeldman!~aidan@rrcs-208-125-30-245.nyc.biz.rr.com] has joined #ruby
aidanfeldman [aidanfeldman!~aidan@rrcs-208-125-30-245.nyc.biz.rr.com] has quit [#ruby]
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
azbarcea____ [azbarcea____!~quassel@79.114.19.220] has joined #ruby
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
tommyvyo [tommyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
stepitime [stepitime!~stepitime@209-33-232-133.dsl.infowest.net] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
azbarcea__ [azbarcea__!~quassel@79.114.112.242] has joined #ruby
hitekrednek [hitekrednek!~new@static24-72-49-17.r.rev.accesscomm.ca] has joined #ruby
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
skaczor [skaczor!~shogun@mail.prognosoft.biz] has joined #ruby
acts_as_david [acts_as_david!~acts_as_d@c-71-202-155-161.hsd1.ca.comcast.net] has joined #ruby
Gekz [Gekz!~gekz@115-64-60-202.static.tpgi.com.au] has joined #ruby
Gekz [Gekz!~gekz@unaffiliated/gekz] has joined #ruby
p0y [p0y!~p0y@125.212.56.114] has joined #ruby
bairui_ [bairui_!~arthurb@115.239.14.119] has joined #ruby
azbarcea_____ [azbarcea_____!~quassel@79.114.15.178] has joined #ruby
g0kul [g0kul!~gokulnath@117.204.115.57] has joined #ruby
rippa [rippa!~rippa@87-253-29-179.pppoe.yaroslavl.ru] has joined #ruby
g0kul [g0kul!~gokulnath@117.204.115.57] has quit ["Leaving"]
krz [krz!~foobar@unaffiliated/krz] has joined #ruby
enherit [enherit!~enherit@66-214-13-183.dhcp.lnbh.ca.charter.com] has joined #ruby
sudhir [sudhir!~sudhir@120.56.153.12] has joined #ruby
youdonotexist [youdonotexist!~youdonote@68.178.70.244] has joined #ruby
livelace [livelace!~livelace@static-a137.Arkhangelsk.golden.ru] has joined #ruby
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby
drieddust [drieddust!~drieddust@120.56.153.12] has joined #ruby
crodas [crodas!~crodas@git.crodas.org] has joined #ruby
drieddust_ [drieddust_!~drieddust@120.56.153.12] has joined #ruby
pseud0cod3r [pseud0cod3r!pseudocode@gateway/shell/anapnea.net/x-nolmlmiguduwhbuc] has joined #ruby
drieddust_ [drieddust_!~drieddust@120.56.153.12] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
acts_as_david [acts_as_david!~acts_as_d@c-71-202-155-161.hsd1.ca.comcast.net] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
yxhuvud [yxhuvud!mongo@h-5-47.a212.priv.bahnhof.se] has joined #ruby
nivoc [nivoc!~matthias@ipc-hosting.de] has joined #ruby
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
enherit [enherit!~enherit@66-214-13-183.dhcp.lnbh.ca.charter.com] has joined #ruby
thone_ [thone_!~thone@g226050038.adsl.alicedsl.de] has joined #ruby
stayarrr [stayarrr!~olivererx@dslb-188-100-254-093.pools.arcor-ip.net] has joined #ruby
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
LMolr [LMolr!~quassel@87.19.33.245] has joined #ruby
clockwize [clockwize!~clockwize@5e0675f5.bb.sky.com] has joined #ruby
csherin [csherin!~csherin@202.164.151.110] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
bier [bier!~bier@p5085DF48.dip.t-dialin.net] has joined #ruby
jmampost [jmampost!~jmampost@cm238.sigma71.maxonline.com.sg] has joined #ruby
neaer [neaer!~adskjf@118.39.114.41] has joined #ruby
kreantos [kreantos!~kreantos@77.116.126.101.wireless.dyn.drei.com] has joined #ruby
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.186] has joined #ruby
ershad [ershad!~ershad@117.213.43.28] has joined #ruby
fixl [fixl!~fixl@203-158-37-72.dyn.iinet.net.au] has joined #ruby
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
jlogsdon [jlogsdon!~jlogsdon@c-98-207-251-182.hsd1.ca.comcast.net] has joined #ruby
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
LMolr_ [LMolr_!~quassel@87.19.33.245] has joined #ruby
Azure|netbook [Azure|netbook!~azt@cinch/fan/azure] has joined #ruby
Azure [Azure!~azt@cinch/fan/azure] has joined #ruby
VictorMartins [VictorMartins!~VictorMar@87.196.149.191] has joined #ruby
nivoc [nivoc!~matthias@adsl-71-135-62-116.dsl.pltn13.pacbell.net] has joined #ruby
nivoc [nivoc!~matthias@ipc-hosting.de] has joined #ruby
Nss [Nss!~nss@host241-19-dynamic.53-79-r.retail.telecomitalia.it] has joined #ruby
wingie [wingie!~wingie@78-73-98-66-no162.tbcn.telia.com] has joined #ruby
wingie [wingie!~wingie@78-73-98-66-no162.tbcn.telia.com] has quit ["WeeChat 0.3.5"]
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
adeponte [adeponte!~adeponte@pool-173-51-131-197.lsanca.fios.verizon.net] has joined #ruby
CodeZombie [CodeZombie!~CodeZombi@65.19.245.153] has joined #ruby
nicksmith [nicksmith!~nick@173.214.173.94] has joined #ruby
jlogsdon [jlogsdon!~jlogsdon@c-98-207-251-182.hsd1.ca.comcast.net] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
nicksmith [nicksmith!~nick@173.214.173.94] has joined #ruby
Zolrath [Zolrath!~Zolrath@cpe-98-148-138-177.socal.res.rr.com] has joined #ruby
sandstrom [sandstrom!~sandstrom@s213-103-207-56.cust.tele2.se] has joined #ruby
sandstrom [sandstrom!~sandstrom@unaffiliated/sandstrom] has joined #ruby
nd___ [nd___!~nd@mnhm-590e6670.pool.mediaWays.net] has joined #ruby
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
[[thufir]] [[[thufir]]!~thufir@184.65.42.92] has joined #ruby
ishikawa [ishikawa!~ishikawa@gateway/tor-sasl/ishikawa] has joined #ruby
nicksmith [nicksmith!~nick@173.214.173.94] has joined #ruby
medik1 [medik1!~medik@host-95-199-15-48.mobileonline.telia.com] has joined #ruby
eka [eka!~eka@181.28.169.86] has joined #ruby
tyraeltong [tyraeltong!~tyraelton@li381-238.members.linode.com] has joined #ruby
nicksmith [nicksmith!~nick@173.214.173.94] has joined #ruby
Nss_ [Nss_!~nss@host241-19-dynamic.53-79-r.retail.telecomitalia.it] has joined #ruby
Houdini [Houdini!~Adium@h81-88-114-126.rev.domonet.ru] has joined #ruby
g0kul [g0kul!~gokulnath@117.207.165.218] has joined #ruby
cyb3r3li0g [cyb3r3li0g!~cyb3r3li0@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
shevy [shevy!~shevy@194-166-100-6.adsl.highway.telekom.at] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
nicksmith [nicksmith!~nick@173.214.173.94] has joined #ruby
Deesl [Deesl!~bsdboy@unaffiliated/deesl] has joined #ruby
cyb3r3li0 [cyb3r3li0!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
cyb3r3li0g [cyb3r3li0g!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
cyb3r3li0g [cyb3r3li0g!~eguzman@c-69-254-128-192.hsd1.nm.comcast.net] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
nicksmith [nicksmith!~nick@173.214.173.94] has joined #ruby
jamw [jamw!~j@cpc11-orpi3-2-0-cust53.2-3.cable.virginmedia.com] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
samu [samu!~s@unaffiliated/samaelszafran] has quit [#ruby]
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
kaspernj_ [kaspernj_!~kaspernj@dslb-088-075-127-236.pools.arcor-ip.net] has joined #ruby
adac [adac!~adac@85-127-20-90.dynamic.xdsl-line.inode.at] has joined #ruby
norex [norex!~quassel@41-133-238-154.dsl.mweb.co.za] has joined #ruby
pna [pna!~pna@96.44.163.76] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby
cemycc [cemycc!~cemycc@79.112.115.53] has joined #ruby
Mchl [Mchl!~Mchl@h1881165560.rev.rootvps.pl] has joined #ruby
jbpros [jbpros!~jbpros@57-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
drieddust [drieddust!~drieddust@59.177.44.212] has joined #ruby
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby
drieddust_ [drieddust_!~drieddust@59.177.44.212] has joined #ruby
senny [senny!~senny@84-72-61-96.dclient.hispeed.ch] has joined #ruby
whack [whack!~jls@carrera.databits.net] has joined #ruby
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
whack [whack!~jls@carrera.databits.net] has quit [#ruby]
tvo [tvo!~tvo@5354CF57.cm-6-5d.dynamic.ziggo.nl] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
driedust__ [driedust__!~drieddust@120.56.148.77] has joined #ruby
csherin [csherin!~csherin@202.164.151.110] has joined #ruby
drieddust [drieddust!~drieddust@120.56.148.77] has joined #ruby
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
sandstrom [sandstrom!~sandstrom@s213-103-207-56.cust.tele2.se] has joined #ruby
sandstrom [sandstrom!~sandstrom@unaffiliated/sandstrom] has joined #ruby
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
kaidw [kaidw!~kaidw@113.57.222.48] has joined #ruby
niklasb [niklasb!~codeslay0@p5B31127C.dip0.t-ipconnect.de] has joined #ruby
cousine [cousine!~cousine@196.221.245.118] has joined #ruby
Faris [Faris!~amnay@41.140.175.233] has joined #ruby
VictorMartins_ [VictorMartins_!~VictorMar@87-196-107-112.net.novis.pt] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
Jakee` [Jakee`!~Jakee`@5ad317fe.bb.sky.com] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
drieddust [drieddust!~drieddust@120.59.21.206] has joined #ruby
drieddust_ [drieddust_!~drieddust@120.59.21.206] has joined #ruby
codecop [codecop!~codecop@78.61.251.3] has joined #ruby
codecop_ [codecop_!~codecop@78.61.251.3] has joined #ruby
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
geaif [geaif!~geaif@xdsl-188-155-129-176.adslplus.ch] has joined #ruby
ikaros [ikaros!~ikaros@dslb-094-219-214-087.pools.arcor-ip.net] has joined #ruby
josemota [josemota!~jose@2.81.130.56] has joined #ruby
_2easy [_2easy!~nofuture@89-79-244-137.dynamic.chello.pl] has joined #ruby
mengu_ [mengu_!~mengu@unaffiliated/mengu] has joined #ruby
bastilian [bastilian!~bastilian@chello062178156107.9.14.vie.surfer.at] has joined #ruby
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
faber [faber!~faber@ppp-131-41.26-151.libero.it] has joined #ruby
KDiddy [KDiddy!~kdiddy@p4FEE8F52.dip0.t-ipconnect.de] has joined #ruby
arvindravi [arvindravi!~arvind@115.241.53.148] has joined #ruby
<arvindravi>
hello all,newbie here. I'm trying to write a function that will calculate the number of mondays between two given dates,the logic seems simple using the monday? method that the date class provides,can someone tell how it has to be written?
<apeiros_>
arvindravi: how about you try to come up with something and then ask a specific question?
<apeiros_>
you know, I'm sure it wasn't your intention, but asking as you did now makes it seem you want us to write it for you…
cemycc [cemycc!~cemycc@79.112.113.100] has joined #ruby
ershad [ershad!~ershad@117.213.43.28] has joined #ruby
<apeiros_>
arvindravi: nice. from what I see I'd say it works. do you have questions regarding your implementation? the same algorithm as yours can be expressed more concisely the way rippa showed.
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
jbpros [jbpros!~jbpros@57-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
<arvindravi>
apeiros_: thanks,i'm sorry for jumping right here before I even tried. I've got a problem in line no.5,doesnt ruby accept "+=" ?
<apeiros_>
arvindravi: it does, but mdays isn't defined prior to that
<apeiros_>
so you end up trying to do nil += 1, and nil doesn't know what to do with +
<apeiros_>
add a 'mdays = 0' to the begin of your method
lukesaunders [lukesaunders!~luke@5e087961.bb.sky.com] has joined #ruby
<arvindravi>
apeiros_: ah,thank you so much!
<arvindravi>
and I'm sorry again,for making it sound like wanting you to write.
<apeiros_>
no worries
ChampS666 [ChampS666!~ChampS@p54B4DB2E.dip.t-dialin.net] has joined #ruby
<Companion>
any one knows a page with an explanation of format strings?
<Hanmac>
Companion: try "ri String.format"
<Companion>
in irb?
<Hanmac>
no in shell
<Companion>
[companion@cube tutorials]$ ri String.format
<Companion>
Nothing known about String
<shevy>
ri sucks anyway
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby
<shevy>
Companion I have an alias in bash that just prints this:
<Hanmac>
i like ri, rvm is that what sucks
<shevy>
'%3s' % '1' will become ' 1'
<Companion>
tried to google string formats all I get is 'how to soulve this issue' on ruby forums
<apeiros_>
Companion: you need to install the docs
<shevy>
and the format code is very easy to understand
<apeiros_>
Companion: with rvm, do: rvm docs generate
<shevy>
it should follow in tradition with sprintf()
<apeiros_>
Companion: alternatively see ruby-doc.org and/or rdoc.info for online docs. google is a poor solution for things like this.
<shevy>
Companion, it is always good to trace back the origin of sprintf()
<shevy>
in this case, good old ancient C
<rippa>
%d = Decimal (Integer)
openros [openros!~rosarioar@41.204.136.91] has joined #ruby
<shevy>
you know, fossil coders like Linus use it
kaidw [kaidw!~kaidw@69.172.214.106] has joined #ruby
<shevy>
oh
<Companion>
shevy, how do I do that? :)
<Companion>
shevy, I would never beat Linux tho :p
<shevy>
Linus
<Companion>
Linus xD
<shevy>
but you already got %s working
<Companion>
X = automatic :)
<Companion>
and %d :D
<Companion>
how I thought %d = Number %s = String (line of text)
<shevy>
well your problem is solved then right!
<Companion>
Sweet
* Companion
is still looking for a mentor for ruby :')
<shevy>
ruby is so easy that you can learn it best by writing scripts
<shevy>
and you learn from mistakes too
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
<Companion>
shevy, when doing 1 hour of tutorials I wrote a facebook poke script (that pokes people back between 60 secconds after running the script and 600 secconds (10 minutes))
davidpk [davidpk!~r00t@soho89-16-224-130.sohonet.co.uk] has joined #ruby
<Companion>
shevy, kinda pointless but it works :)
<shevy>
well you learn quickly
<Companion>
Tbh I took an old python script and reformed the code :<
<shevy>
haha
<Companion>
but it works :')
<shevy>
the languages are somewhat similar
<Companion>
yea
<Companion>
its verry simular tho but kinda hilarious when you compare 2 codes and you can assemble it into 1 ruby code
<shevy>
what I think python lacks is aliasing
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
<shevy>
or perhaps it has that hmm...
<shevy>
>>> quit
<shevy>
Use quit() or Ctrl-D (i.e. EOF) to exit
<Companion>
shevy, the only thing I am doubting
<shevy>
I will never be able to understand that
<Companion>
puts "Born in %s %s time: %s" % [born_in, street, time] <--- the last %s for time
<Companion>
Could be a %d too
<shevy>
it knows that "quit" as input isn't proper, so it displays me an annoying message, when I instead want it to simply exit
<Companion>
but it could start calculating it
<shevy>
well it must be a string or?
<Companion>
it must be an output of time
<shevy>
because you display it in a "" string object
<Companion>
I coulda also use |time| or what ever
<shevy>
yeah but the value is stored in the variable called time
<Companion>
Hrm
<Companion>
I am going to try to make a echo of date and time or what ever
<Companion>
in string formats
openros [openros!~rosarioar@41.204.136.91] has quit [#ruby]
<Companion>
give me a sec
<shevy>
Time.now.to_s should work
Azure_ [Azure_!~Azure@reenigne.net] has joined #ruby
Jakee` [Jakee`!~Jakee`@5ad317fe.bb.sky.com] has joined #ruby
<Companion>
So now the good question is will I be able to put 2 puts in 1 line and bring the Time and Date in 1 single line
<burgestrand>
AH, NOT A THREE-LINER AGAIN! D:
<Companion>
*dives into Gedit*
<Companion>
burgestrand, noooooo!!!
* Companion
is a three-line sterio type
<burgestrand>
Companion: now we have to whack you with a towel
<Companion>
burgestrand, I preffer chains with broken glass bottles
<burgestrand>
Companion: you should try java then!
<Companion>
burgestrand, NO! :(
<burgestrand>
D:
<shevy>
lol
<shevy>
wait wat
<shevy>
2 puts in one line?
* Companion
grabs its book and crawls into a corner
<Companion>
shevy, If I put a comma like: ,
<Companion>
am I able to expand the puts?
<shevy>
wat
<shevy>
you can use , with print
<shevy>
print "abc",variable,"efgh"
<shevy>
puts does not like that
<Companion>
ARGH
<shevy>
puts "abc"+variable+"efgh"
<Companion>
Why I need 2 puts
<shevy>
or
<Companion>
:@
<shevy>
puts "abc#{variable}efgh"
<shevy>
wat
<Companion>
I can do it with a single puts and single t.strf
<shevy>
wat
<shevy>
you can use #{} inside strings to expand
<shevy>
#{t.strf}
<shevy>
puts "We rule the world at: #{t.strf}"
<Companion>
What I tried: puts t.strftime("The time is: %H:%M:%S %p"), puts t.strftime("The date is: %d-%m-%Y")
<burgestrand>
puts "hello", "world" # => works just fine
shadow338 [shadow338!~shadow338@su-nat.int.smq.datapipe.net] has joined #ruby
<Companion>
I could better do: puts t.strftime("The time is: %H:%M:%S %p and the date is: %d-%m-%Y")
<shevy>
oh
<Companion>
:')
<shevy>
indeed though it appends a newline
* Companion
is starting to understand
<shevy>
what will this output:
<shevy>
puts "hello\n","world"
<shevy>
I tell you
<shevy>
it outputs
<shevy>
wat
<Companion>
when doing puts ("Hello my name is: "), puts ("%s.) % name
<Companion>
it would show it in 2 lines
<shevy>
no please
<shevy>
dont use the , with puts
<Companion>
shevy, thats what I just learned :P
<shevy>
someone kills a kitten every time that happens
<shevy>
not from me!
<Companion>
no :P
<shevy>
I assign burgestrand as your teacher!
* shevy
goes to eat something.
<Companion>
I just learned you can use same value with various of args on different sections of your line
<shadow338>
when I ran my ruby script keeps complaing that 'rake' does not exist, dispisting the fact that that gems is alrady installed and PATH's are ok
<Companion>
shevy, I have a burgestrand for lunch
<Companion>
I bet burgestrand is dutch or flemish
<burgestrand>
A whole stand? You must’ve been awfully hungry
<Companion>
haha :')
<Companion>
brb smoke
<Companion>
Ruby makes me happy and die earlyer
Skaag [Skaag!~Skaag@cpe-67-247-51-89.nyc.res.rr.com] has joined #ruby
davidpk [davidpk!~r00t@soho89-16-224-130.sohonet.co.uk] has joined #ruby
<shadow338>
Could not find rake-0.9.2.2 in any of the sources
<shadow338>
Run `bundle install` to install missing gems.
<shadow338>
I get that.
<burgestrand>
shadow338: what does "gem list rake | grep 0.9.2.2" tell you?
<shadow338>
let me check that
<burgestrand>
or even "gem list -d rake | grep 0.9.2.2"
<shadow338>
I'm very new to ruby. Remind me, do I need to run that as my app user or root?
<burgestrand>
shadow338: the same user you run your script as
<shadow338>
gotcha
<shadow338>
let me check
<burgestrand>
shadow338: I assume you’ve ran "bundle install" as that user already?
<shadow338>
I most sure I did
<shadow338>
but let me run again
<shadow338>
does not return anything
<shadow338>
that gem list coomand
<shadow338>
weird...
<shadow338>
gonna try 'bundle install' again
<shadow338>
\then
<burgestrand>
shadow338: could also try "bundle list rake"
<shadow338>
sure
<shadow338>
1sec
<shadow338>
Enter your password to install the bundled RubyGems to your system:
<shadow338>
ugh
<shadow338>
what password is that one?
<shadow338>
where is defined?
<shadow338>
]$ bundle list rake
<shadow338>
Could not find rake-0.9.2.2 in any of the sources
<burgestrand>
shadow338: it’s your users’ password
<burgestrand>
shadow338: your installation of ruby seem to require different privileges than your current user has to install gems on your system
<shadow338>
ok
<burgestrand>
shadow338: either that or your root password
<shadow338>
gonna try both
rebagliatte [rebagliatte!~rebagliat@186.8.211.237] has joined #ruby
<shadow338>
dam I dont have any of the password
<shadow338>
gonna ask for them.
MrGando [MrGando!~MrGando@pc-137-179-83-200.cm.vtr.net] has joined #ruby
<MrGando>
Hey guys , where I can find the meaning of all the operators like this one ( ||= )
cousine [cousine!~cousine@196.221.245.118] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
niklasb [niklasb!~codeslay0@p5B31127C.dip0.t-ipconnect.de] has joined #ruby
ershad [ershad!~ershad@117.213.43.28] has joined #ruby
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
fr0gprince_mac [fr0gprince_mac!~fr0gprinc@178-85-90-223.dynamic.upc.nl] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
virunga [virunga!~virunga@151.64.43.221] has joined #ruby
mephux [mephux!~mephux@li246-165.members.linode.com] has joined #ruby
jbpros_ [jbpros_!~jbpros@57-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
mephux_ [mephux_!~mephux@unaffiliated/mephux] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
stayarrr [stayarrr!~olivererx@dslb-188-100-254-093.pools.arcor-ip.net] has joined #ruby
rebagliatte [rebagliatte!~rebagliat@186.8.211.237] has joined #ruby
nd_____ [nd_____!~nd@mnhm-4d01be8f.pool.mediaWays.net] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@75-170-158-134.desm.qwest.net] has joined #ruby
davidpk [davidpk!~r00t@soho89-16-224-130.sohonet.co.uk] has joined #ruby
Xerife [Xerife!~Soarez@a79-169-26-117.cpe.netcabo.pt] has joined #ruby
sandstrom [sandstrom!~sandstrom@c213-89-142-16.bredband.comhem.se] has joined #ruby
sandstrom [sandstrom!~sandstrom@unaffiliated/sandstrom] has joined #ruby
<Companion>
Any one knows how to fix errors like this: `*': String can't be coerced into Fixnum (TypeError)
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
<Companion>
Since some thing is 'missing' to me
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
<Companion>
its a conversion between inches and centimeters and in reverse
<Companion>
its about: inc_in_cent = inch * cent
<Companion>
found it
senny [senny!~senny@84-72-61-96.dclient.hispeed.ch] has joined #ruby
conor_ireland [conor_ireland!~conor_ire@89.100.121.49] has joined #ruby
bastilian [bastilian!~bastilian@chello062178156107.9.14.vie.surfer.at] has joined #ruby
zakwilson [zakwilson!~quassel@72.158.101.205] has joined #ruby
ChampS666 [ChampS666!~ChampS@p54B4C1C6.dip.t-dialin.net] has joined #ruby
mickn [mickn!~mickn@unaffiliated/mickn] has joined #ruby
<Companion>
<3 ruby
cousine [cousine!~cousine@196.221.245.118] has joined #ruby
<UdontKnow>
your comparison is a bit unfair. should be ruby > *
MrGando [MrGando!~MrGando@pc-137-179-83-200.cm.vtr.net] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
tvo [tvo!~tvo@5354CF57.cm-6-5d.dynamic.ziggo.nl] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
<shevy>
Companion your object wants specific input
jfoley [jfoley!~jfoley@c-67-173-240-154.hsd1.co.comcast.net] has joined #ruby
<shevy>
otherwise you confuse it
<shevy>
a string object does not like it if you append Fixnums to it
<shevy>
so you typically either use #{} or you just call a certain method. like .to_s
<shevy>
string = 'abc'; number = 5; string + number.to_s
<shevy>
Companion, the other way works too. If you have a string, you can convert it to a number... an integer, like "5".to_i
<shevy>
hmm there is also Integer()
<shevy>
though I have to say, I think in 5 years ruby... I used Integer() perhaps only 3 times or something like that
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
frogstarr77 [frogstarr77!~frogstarr@lan.viviotech.net] has joined #ruby
fr0gprince_mac [fr0gprince_mac!~fr0gprinc@178-85-90-223.dynamic.upc.nl] has joined #ruby
cmasseraf [cmasseraf!~cmasseraf@187.106.201.26] has joined #ruby
brandon` [brandon`!~user@h225.210.117.75.dynamic.ip.windstream.net] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
brandon` [brandon`!~user@h225.210.117.75.dynamic.ip.windstream.net] has quit [#ruby]
<Companion>
shevy, it was caused by " or '
<Companion>
shevy, hows your game going? :)
Z2FyZA_ [Z2FyZA_!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby
bbttxu [bbttxu!~adam@pool-71-170-1-72.dllstx.fios.verizon.net] has joined #ruby
giftae [giftae!~giftae@pool-108-56-214-175.washdc.fios.verizon.net] has joined #ruby
<giftae>
i cant wrap my head around the benefit of class (@@) or instance (@) variables as compared to a 'normal' variable, if that makes sense. anybody care to pound this into my head?
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
GiambalaGiambala [GiambalaGiambala!~virunga@151.64.47.180] has joined #ruby
<giftae>
nevermind my last, i found a decent article that i think will spoon feed me this information
dhodgkin [dhodgkin!~dhodgkin@cpe-76-178-249-57.maine.res.rr.com] has joined #ruby
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
seivan [seivan!~seivan@cm242.eta204.maxonline.com.sg] has joined #ruby
stepitime [stepitime!~stepitime@209-33-232-133.dsl.infowest.net] has joined #ruby
frogstarr78 [frogstarr78!~frogstarr@lan.viviotech.net] has joined #ruby
<Companion>
giftae, srry that I dint replied still a newbie :(
davidpk [davidpk!~r00t@soho89-16-224-130.sohonet.co.uk] has joined #ruby
davidpk [davidpk!~r00t@soho89-16-224-130.sohonet.co.uk] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-218-131.hsd1.mi.comcast.net] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<apeiros_>
arvindravi: you're welcome. you can improve the algorithm btw.
<apeiros_>
you can directly calculate the number of days, you don't need to count them.
<apeiros_>
oh, nice interface
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<Companion>
apeiros_, to who you're talking? o.0
frogstarr78 [frogstarr78!~frogstarr@lan.viviotech.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<apeiros_>
Companion: nickname in first message. always.
<Companion>
apeiros_, I havent seen him talking o.0
<apeiros_>
well, ok, if somebody just recently asked something and it is an obvious response, I do omit the nick sometimes.
<burgestrand>
Companion: was a while ago :)
<Companion>
ah :')
<burgestrand>
About an hour and a half
phantomfake [phantomfake!~i@pool-71-190-229-236.nycmny.fios.verizon.net] has joined #ruby
<Companion>
I noticed it :')
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
wataken44 [wataken44!~wataken44@FL1-122-133-57-198.kng.mesh.ad.jp] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
philcrissman [philcrissman!~philcriss@c-174-53-217-149.hsd1.mn.comcast.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
`brendan [`brendan!~b@66-208-246-34-ubr02b-waldlk01-mi.hfc.comcastbusiness.net] has joined #ruby
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
davidpk [davidpk!~r00t@soho89-16-224-130.sohonet.co.uk] has joined #ruby
<arvindravi>
apeiros_: sorry,was awayy. thanks,how do I do it without counting them btw?
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
<apeiros_>
arvindravi: days = Date.civil(year_b, month_b, day_b) - Date.civil(year_a, month_a, day_a); days.div(7). now all you have to do is adjust for the first/last week in the interval.
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<apeiros_>
i.e. in a duration of every multiple N of 7 days, there's guaranteed exactly N of each weekday. but for the remainder you have to check.
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
<arvindravi>
what does the div method do?
wenbert [wenbert!~wenbert@180.190.159.38] has joined #ruby
<apeiros_>
arvindravi: do you know ri?
<apeiros_>
in your shell, type: ri Numeric#div
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<arvindravi>
yes,got it
bairui [bairui!~arthurb@115.239.14.119] has quit ["WeeChat 0.3.6"]
drknus [drknus!~user@142.68.215.147] has joined #ruby
niklasb [niklasb!~codeslay0@p5B31127C.dip0.t-ipconnect.de] has joined #ruby
<nfxgosu>
#i have a few sets; if *#{Set}*.proper_subset? entire_set; puts "#{Set}"; else; puts "Set not found"; end; #what should be in between the asterisks
<arvindravi>
apeiros_: thanks,yet again! =)
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby
Skaag [Skaag!~Skaag@cpe-67-247-51-89.nyc.res.rr.com] has joined #ruby
td123 [td123!~tom@archlinux/trusteduser/td123] has joined #ruby
<td123>
anyone have a tool or system for managing dotfiles in a seperate directory?
xissburg [xissburg!~xissburg@187.3.208.149] has joined #ruby
mk03 [mk03!~mk03@112.136.51.23.er.eaccess.ne.jp] has joined #ruby
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
lolcat_ [lolcat_!511e2139@gateway/web/freenode/ip.81.30.33.57] has joined #ruby
<lolcat_>
hello! any padrino lovers here?
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
msch [msch!~msch@static.74.108.46.78.clients.your-server.de] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<msch>
does anyone know if Array#& is guaranteed to preserve ordering? docs don't say
<apeiros_>
in KRI it afaik is, but given that that's undocumented, I wouldn't rely on that behaviour.
<apeiros_>
it also is in MRI
<msch>
apeiros_: do you know of another way i can get that behavior that doesn't rely on undocumented features?
td123 [td123!~tom@archlinux/trusteduser/td123] has quit ["WeeChat 0.3.6"]
<apeiros_>
you want the result to be in the order of the first operand?
<rippa>
msch: sort it based on first array
wroathe [wroathe!~wroathe@173-17-249-11.client.mchsi.com] has joined #ruby
<apeiros_>
you can reimplement Array#& in a way that's guaranteed to retain order.
<msch>
apeiros_: ok, but there's nothing in the stdlib
<apeiros_>
it's not too difficult. all you need is to construct a lookup hash.
<msch>
rippa: ok. was hoping for something in the stdlib. thanks!
<apeiros_>
well, all you need for it is in core.
LMolr [LMolr!~quassel@adsl-ull-18-226.42-151.net24.it] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
Micka [Micka!52e8e3b3@gateway/web/freenode/ip.82.232.227.179] has joined #ruby
wroathe [wroathe!~wroathe@173-17-249-11.client.mchsi.com] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@75-170-158-134.desm.qwest.net] has joined #ruby
jbpros [jbpros!~jbpros@57-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
arvindravi [arvindravi!~arvind@115.242.254.40] has joined #ruby
Jakee` [Jakee`!~Jakee`@5ad317fe.bb.sky.com] has joined #ruby
mweichert [mweichert!~mweichert@184.151.63.209] has joined #ruby
ank [ank!~ank@c-67-172-16-188.hsd1.pa.comcast.net] has joined #ruby
dcl [dcl!~user@187.11.68.187] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<mweichert>
hi guys! I'm trying to understand EventMachine's defer mechanism. I thought that defer performs an operation in a new thread to avoid blocking the reactor. However, I always appear to be blocking the reactor: http://pastie.org/3270643
csavola [csavola!~csavola@CPE0021e9f7ea74-CM001404933e00.cpe.net.cable.rogers.com] has joined #ruby
Phrogz [Phrogz!~phrogz@184-96-128-49.hlrn.qwest.net] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
<burgestrand>
mweichert: next_tick is a one-off operation, its not periodic
<mweichert>
ah
<mweichert>
add_periodic_timer
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby
<mweichert>
burgestrand: so to convert non-EM aware libraries one must use defer, correct?
<mweichert>
burgestrand: or is there a better approach?
<burgestrand>
mweichert: was a long time since I used eventmachine for real, but yeah, EM::defer will be a helpful tool in dealing with non-EM-aware libraries
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
aeden [aeden!~aeden@mon34-1-88-167-222-77.fbx.proxad.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
idarkside [idarkside!~YourNick@5e04aec4.bb.sky.com] has joined #ruby
<Companion>
burgestrand, is there a ruby offtopic channel?
<burgestrand>
Companion: you mean like this one?
<Companion>
burgestrand, then off topic :P
<Companion>
owned by Ruby
<Companion>
working with strings and texts now :')
<burgestrand>
Companion: not as far as I know, I just use this (and the other #ruby-lang) channel for that as well, if somebody minds they’re welcome to ask you to take it somewhere else but until then why not :)
<Companion>
alright :)
<Companion>
I am mostly in #Archlinux-offtopic blowing off some steam during the day :)
Pathou [Pathou!~pat95660@156.30-224-89.dsl.completel.net] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@75-170-158-134.desm.qwest.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
ulritx [ulritx!~eneko@80.Red-83-35-26.dynamicIP.rima-tde.net] has joined #ruby
bastilian [bastilian!~bastilian@chello062178156107.9.14.vie.surfer.at] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
Xerife [Xerife!~Soarez@a79-169-26-117.cpe.netcabo.pt] has joined #ruby
juarlex [juarlex!~juarlex@201.124.237.11] has joined #ruby
shikamaru [shikamaru!~shikamaru@mandriva/developer/shikamaru] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@75-170-158-134.desm.qwest.net] has joined #ruby
pradeepto [pradeepto!~quassel@kde/pradeepto] has joined #ruby
virunga [virunga!~virunga@151.64.35.56] has joined #ruby
aeden [aeden!~aeden@mon34-1-88-167-222-77.fbx.proxad.net] has quit [#ruby]
p0y [p0y!~p0y@125.212.56.150] has joined #ruby
hackeron [hackeron!~hackeron@gentoo/user/hackeron] has joined #ruby
Jackneill [Jackneill!~Jackneill@adsl240027.pool.invitel.hu] has joined #ruby
Jackneill [Jackneill!~Jackneill@unaffiliated/jackneill] has joined #ruby
senny [senny!~senny@84-72-61-96.dclient.hispeed.ch] has joined #ruby
azbarcea__ [azbarcea__!~quassel@79.114.89.32] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
yekta [yekta!~yekta@c-24-1-182-219.hsd1.il.comcast.net] has joined #ruby
bbttxu [bbttxu!~adam@pool-71-96-208-205.dfw.dsl-w.verizon.net] has joined #ruby
_|christian|_ [_|christian|_!~christian@190.232.98.61] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
sbanwart_ [sbanwart_!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
hadees [hadees!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
dasfugufish [dasfugufish!~Adium@64-184-237-212.mammothnetworks.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
crescendo [crescendo!~eric@cpe-065-190-084-025.nc.res.rr.com] has joined #ruby
crescendo [crescendo!~eric@unaffiliated/crescendo] has joined #ruby
emocakes [emocakes!~om@p4FEA58A5.dip.t-dialin.net] has joined #ruby
kah_ [kah_!63fa8ad0@gateway/web/freenode/ip.99.250.138.208] has joined #ruby
<kah_>
What does this mean.. I type the command rvm gemset use project --- and get "Gemsets can not be used with non rvm controlled rubies (currently)."
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<kah_>
I'm trying to install rails on ubuntu.
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
seivan [seivan!~seivan@cm242.eta204.maxonline.com.sg] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@bb220-255-71-35.singnet.com.sg] has joined #ruby
<kah_>
I type the command rvm gemset use project --- and get "Gemsets can not be used with non rvm controlled rubies (currently)." Anyone?
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
GiambalaGiambala [GiambalaGiambala!~virunga@151.64.61.8] has joined #ruby
sbanwart_ [sbanwart_!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<Phrogz>
kah_: Are you using rvm use system ?
tomzx [tomzx!~tomzx@dsl-136-201.aei.ca] has joined #ruby
<kah_>
after using ubuntu chown to set the permissions to my user, I then used rvm gemset create project
<kah_>
i now want to use that project
<kah_>
so i used the command rvm gemset use project
<kah_>
and boom!
<kah_>
Phrogz: I do not believe I am using rvm use system, not familiar with it..
<Phrogz>
kah_: I know very little about rvm, but you can tell rvm to use your system ruby, or another built-in ruby not installed by rvm. I'm assuming that this is what you are experiencing, that your rvm is set to use an rvm that is not installed by it.
maletor [maletor!~maletor@c-69-181-24-86.hsd1.ca.comcast.net] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
<kah_>
Phrogz: What might a command like telling rvm to use your system ruby look like? As a little background I am following this http://warmwaffles.posterous.com/43361189
Pathou [Pathou!~pat95660@156.30-224-89.dsl.completel.net] has quit [#ruby]
ulritx [ulritx!~eneko@70.Red-79-155-21.dynamicIP.rima-tde.net] has joined #ruby
Transformer [Transformer!~Transform@ool-4a59e397.dyn.optonline.net] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
<Phrogz>
kah_: rvm use system is how you tell it to use the built-in; I'm not sure if there are other commands to tell it to use a different Ruby. Instead, why not ensure that rvm has built and is using a ruby?
Xerife [Xerife!~Soarez@a79-169-26-117.cpe.netcabo.pt] has joined #ruby
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
h4mz1d [h4mz1d!~hamfz@c-68-62-113-11.hsd1.al.comcast.net] has joined #ruby
geekbri [geekbri!~geekbri@pool-108-49-79-18.bstnma.fios.verizon.net] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
<kah_>
Phrogz: How do I ensure that rvm has built and is using a ruby?
<apeiros_>
kah_: rvm does not use ruby
<apeiros_>
it only builds and provides it for you
<Phrogz>
kah_: What version of Ruby do you want rvm to build and control?
<kah_>
well I installed 1.9.2 and 1.9.3.. (looking to install rails)
<apeiros_>
and you can check by doing either of `which ruby` or `ruby -v`
<apeiros_>
rvm use 1.9.3 # will select a ruby version for you
<kah_>
it says ruby found are 1.8 and 1.9.1
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<Phrogz>
kah_: Then you need to do rvm install 1.9.3
<kah_>
i did
<Phrogz>
…then why is it saying it can only find 1.9.1?
<Phrogz>
Do rvm list and what does it say?
<kah_>
I am wondering the same thing.. not quite sure
<kah_>
ruby-1.9.2-p290
<kah_>
and ruby-1.9.3-p0
<kah_>
it says default ruby not set
<kah_>
but i just set it
<kah_>
using rvm --default 1.9.2
<Phrogz>
Type irb what version are you using?
<hron84>
kah_: rvm list known <= this says you what rubies available
<hron84>
kah_: rvm list rubies <= this says what rubies are installed
<Phrogz>
hron84: But we wanted to know which he had installed.
<hron84>
rvm use
adac [adac!~adac@85-127-20-90.dynamic.xdsl-line.inode.at] has joined #ruby
<kah_>
irb sets my command line to 1.9.2-p290 :001>
<hron84>
Phrogz: i typing slowly. sry
<kah_>
hron84: yeah, so I have 1.9.2 and 1.9.3 installed, which I did by using rvm install 1.9.2 and rvm install 1.9.3
<hron84>
rvm use 1.9.
<hron84>
dohh
<hron84>
kah_: rvm use 1.9.3
<hron84>
kah_: then the active ruby becomes 1.9.3
<kah_>
how do i get out of irb?
<hron84>
Ctrl+D
<Companion>
kah_, ^D
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
<hron84>
if you using linux
<kah_>
im using virtualbox in windows 7 for ubuntu
<kah_>
yes linux
<hron84>
or just exit
<hron84>
how can i call a method in module what not defined with self.name, but i wouln't like include? #send ?
idletom [idletom!b@173-30-162-172.client.mchsi.com] has joined #ruby
<Companion>
ubuntu... yech
* Companion
is listening to: The Wrong Company by Flogging Molly :: Spotify - A world of music ::
<hron84>
module Foo; def bar; end ; end <= I would like call Foo.bar somehow.
<kah_>
permission denied... so I'll use chown to set my permissions..
<hron84>
:)
<hron84>
dont use sudo rvm, just rvm
<kah_>
I don't understand how I have permission for the directory... and not it's sub directories
<kah_>
it's focked
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<majnun>
its sub
<kah_>
majnun: I don't quite understand could you say that again?
nwonknu [nwonknu!nwonknu@gateway/shell/anapnea.net/x-brhoxlanvqagcpjt] has joined #ruby
<hron84>
kah_: i think he said that for me
<kah_>
I mean, please could you explain it in a different way
<kah_>
oh,,
<majnun>
i said it for kah_, and i was being a grammar nazi
<majnun>
can't be helped
<Phrogz>
hron84: What do you want to be the context for your send?
<kah_>
majnun: appreciate it.
<Phrogz>
hron84: Or let me ask: why would you want do to this, and not include it?
pseud0cod3r [pseud0cod3r!pseudocode@gateway/shell/anapnea.net/x-fexgotojcdfhymmm] has joined #ruby
<hron84>
Phrogz: i am at a middle of rspec test, and i don't know how can i include it.
<hron84>
i worked around with an empty class what includes it.
<hron84>
but i would like know the correct answer
<Phrogz>
hron84: There is no correct answer, because it's not functionality you're normally supposed to be able to do.
<Phrogz>
'instance methods' of modules are designed to be only used when the module is included into another class, or extending an existing object.
<Phrogz>
hron84: So you could slightly more simply do: foo = Object.new; foo.extend MyModule
<hron84>
Phrogz: thanks! I searched this.
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.45] has joined #ruby
<hron84>
majnun: searched is correct? My english is not too well... :)
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<Phrogz>
hron84: A native English speaker might say "Thanks, I was looking for this" or "Thanks, I tried searching for this"
<Phrogz>
You could also say "Thanks, I searched for this", but it has a slightly different meaning/feeling to it.
<Phrogz>
Or you might say, "Ah, thanks, that's what I was looking/searching for."
<deryl>
even "I researched this earlier." works as well
<deryl>
ahh present tense. nm
<Phrogz>
Depends on whether you're trying to say "I promise that I did my homework and already tried to find the answer" or if you're trying to say "Ah, that sounds like what I needed!"
<hron84>
Phrogz: thanks
<deryl>
hron84: in english, anything that ends in 'ed' generally is past tense
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<deryl>
something you already did
<hron84>
in hungarian, we say this with a past tense, as i currently not searching, but talking with you.
<deryl>
yeah even in english if it ends in 'ing' it means its taking place right now
Illiux [Illiux!~nol@fq2-wireless-pittnet-47-145.wireless.pitt.edu] has joined #ruby
<Phrogz>
Not if you say "was searching", which means "in the past I was doing it currently"
<deryl>
you can modify that so its past tense with something like "I spent a lot of time searching for that."
<deryl>
Phrogz: hehe yeah was getting to that. not feeling good so being a slow typer
jbpros [jbpros!~jbpros@57-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
<kah_>
Seriously, wtf is going on with rvm
<kah_>
i set my permissions use
<kah_>
use rvm getset use project
sean_ [sean_!~seanmccan@d173-181-72-140.abhsia.telus.net] has joined #ruby
<kah_>
and i get fuckin "unrecognized command line argument: 'getset' ( see: 'rvm usage' ) ...
<Phrogz>
kah_: I'd start over. Implode rvm and install from scratch, without any sudo commands.
<kah_>
alright I'll give it a go
<hron84>
kah_: ? i do not know anything about rvm getset
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
<hron84>
kah_: but keep in my mind: rvm has a lot of changes between 1.9 and 1.10 as the release notes said for me.
<deryl>
hron84: the hardest part about english is two things. 1) We have words that sound the same, are spelled differently, and mean different things like taut and taught, (one means a tight thing like a rope, the other is the past tense of teach), and 2) we have words that are slang that don't appear in the dictionary but are used in everyday speech.
<deryl>
makes it really hard for people learning it :)
<deryl>
kah_: I'm on the RVM project. we do not have a getset
<deryl>
we have a gemset
<deryl>
M not T
<hron84>
kah_: if you starting learn rails now, use railscasts and ruby on rails guides. With rvm, i currently use only rvm use <rubyver> and it is enough for a lot of cases
<kah_>
sorry
<kah_>
yes gemset!
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
<deryl>
and *I* stand corrected. michal added a 'use' to gemset sub command.
<deryl>
kah_: what are you trying to do specifically?
<kah_>
I just want to install ruby on rails and start building an application
<kah_>
to be honest I'm pretty lost..
<kah_>
I've tried several different installations
<deryl>
and do NOT use 'sudo' with rvm. ONLY when doing a multi-user install is sudo used. after that its ALWAYS rvmsudo. and you don't need to use it if you ahve yourself in the rvm group (if this is a multi-user install which resides in /usr/local/rvm)
<kah_>
and i can't seem to get anywhere
<kah_>
ok I won't use sudo anymore
<deryl>
kah_: see the bottom of the troubleshooting page on the rvm site. i have a script there to completely remove RVM for you. run it and then log OUT of that shell and thenback in to make the environment clean
<deryl>
then, are you trying to do a personal install or a multi-user install?
<kah_>
rvm implode?
Illiux [Illiux!~nol@fq2-wireless-pittnet-47-145.wireless.pitt.edu] has joined #ruby
<deryl>
well yu can do that. my script just manually deletes everything to ensure ALL traces are gone
<kah_>
I'm assuming personal install since I'm the only developer
<deryl>
s/yu/you/
<deryl>
kah_: ok, the personal will install into $HOME/.rvm then
<kah_>
do you have any suggestions on what to follow/
<deryl>
do this... gimme a sec and I'll make you a gist.github.com script you can run to dleete everything, and one to do the install
<deryl>
yeah the rvm.beginrescueend.com/rvm/install for SINGLE user installs
<deryl>
aka the one WITHOUT the sudo in the command
<geekbri>
is it possible with ruby and RVM for each user to have their own gemset isolated from each other?
<deryl>
geekbri: yes
<deryl>
its not very good right now but the docs show you how to do that.
<kah_>
deryl: ok I'll wait on the script
<deryl>
RVM v2 will do it better. its just really hard to backport that smartly into 1.x
<kah_>
thanks for the help
<geekbri>
deryl: Are the docs on the RVM site? I round the multiuser install instructions but it wasn't clear to me exactly how to set it up properly.
<deryl>
kah_: np. :-)
<deryl>
geekbri: yea. sec
<hron84>
hmm... migrating to rails 3 is a feature or a fix? #git-branch-naming
acts_as_david [acts_as_david!~acts_as_d@c-71-202-155-161.hsd1.ca.comcast.net] has joined #ruby
<geekbri>
deryl: thanks much, ive been trying to get it right for a couple days and ive been floundering a bit :)
<kah_>
maybe just chown for the environments sub of ruby-rvm?
<deryl>
kah_: no offense but I don't support other people's tutorials at all
<deryl>
msot get it wrong
<deryl>
err most
<kah_>
ok, so let's do it your way
<kah_>
if you have a moment
<deryl>
yeah give me a sec
<kah_>
ok
<deryl>
I hav about 8 minutes before I hav ea conference and i gotta get geekbri the info
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby
<geekbri>
for which i will be greatly indebted to him :)_
n3m [n3m!~bla@188-22-24-249.adsl.highway.telekom.at] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
<deryl>
rvm user gemsets
<deryl>
To use only gemsets from user home run:
<deryl>
rvm user gemsets
<geekbri>
so
<deryl>
you need rvm 1.10.2 for it
<geekbri>
you run that per user?
<deryl>
1.9 doesn't do that iirf
<deryl>
right
<deryl>
each user has to run that command
<deryl>
see: rvm help user
<geekbri>
but you can't do that in ruby 1.9.x ?
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
<deryl>
It is also possible to add this settings as default for new user accounts:
<deryl>
sudo rvm user [all|gemsets] --skel
<deryl>
no no RVM 1.9.x
<deryl>
not ruby
<geekbri>
ok well I'll just make sure to use at least rvm 1.10.x
<deryl>
yeah just do this: rvm get head && rvm get stable
<deryl>
get head just makes sure you have the most current, and then rvm get stable will make sure you're following the stable branch
<geekbri>
deryl: awesome, so im guessing i'll have to setup some default directory structure and .rvmrv in /etc/skel?
<deryl>
great thing about rvm is you can install/reinstall multiple times over itself and not affect your tree :)
<deryl>
nope. run that sudo command i just pasted. all NEW users will then set how you want
<geekbri>
deryl: wow rally? do i need to do rvmsudo or regular sudo?
<deryl>
use 'all' for making each user have their ruby and gemsets in their dir, and 'gemsets' for just their gemsets
<deryl>
use rvmsudo for that if you already have it installed.
<deryl>
rvmsudo ensures that RVM is definitely in the env
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
<Telmo>
I hate accessing ORacle DBs with ruby
<geekbri>
deryl: ok ok, so i think i've got this, basically i just install rvm via sudo (this will do the multi user install) then after its installed i just run sudo rvm user all --skel
<deryl>
sorry if this seems a bit convoluted. i've been away from the project working on other paid things so I missed quite a bit of new options
<geekbri>
deryl: and then all users will install ruby and their gems inside their own .rvm directory and not populate the global space
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
<deryl>
right but ONLY use 'all if you want each user to have their rubies as well as their gemsets in their homedirs
<geekbri>
deryl: thats ok you've been a great help. I know what i want but figuring out how to do it has been a bit confusing :)
<deryl>
which basically negates the reason to do a multi in the first place but whatever
<geekbri>
deryl: yes that is defintley what i want, but youre saying using gemsets instead of all will share version of ruby but split off gemsets?
<geekbri>
deryl: oh heh, good point.
<deryl>
geekbri: *I* would do sudo rvm user gemsets --skel
<deryl>
right
<geekbri>
deryl: ok i'll mess with both in a VM. Sounds great to me
<deryl>
exactly what i'm saying
<deryl>
now, MAKE SURE each user is in the rvm group
<deryl>
without being in the rvm group tthey'll get shitloads of permission errors
<deryl>
not what you want
ulritx [ulritx!~eneko@140.Red-83-43-112.dynamicIP.rima-tde.net] has joined #ruby
<geekbri>
deryl: right, makes sense. any other gotchas?
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
<deryl>
yeah, users can screw themselves if they start muckin with their $HOME/.rvmrc file with things like rvm_path etc
<deryl>
and remember that due to how UNIX GROUPS work, any user can upgrade, delete, downgrade rubies in the global space
<deryl>
its not an rvm thing, its a unix groups thing
ikaros [ikaros!~ikaros@dslb-094-219-214-087.pools.arcor-ip.net] has joined #ruby
<geekbri>
deryl: thats ok, the users are actually going to be some managed ones.
<deryl>
i'll clarify. user in the rvm group can much with the global rubies.
<deryl>
err userS in the rvm group that is
<geekbri>
deryl: but by DEFAULT they will be installing into their OWN gemsets though right? so if they do gem install rake, it will installe rake for THEM not for everybody?
<deryl>
right. bear in mind that we put rake in the global gemset already
<geekbri>
deryl: yeah sorry, it was just the first gem that came to mind when i was typing gem install in my example :-P
<deryl>
we moved rake and bundler into the 'default' gemset, and rake into the 'global'
<deryl>
so if you don't want that, remove it from global.gems file
<deryl>
global.gems is what gets preloaded for every new ruby installed
<geekbri>
deryl: ok understood, i'll make sure to check that file and see if its the proper version of rake and ok for global install. User gemsets override globally installed ones?
<deryl>
f'default.gems' is used when you do NOT specify a gemset in a command like rvm use 1.9.2 rather than rvm use 1.9.2@mygemset
<kah_>
deryl: in the mean time is there anything you recommend me reading / looking into/
<kah_>
?
<deryl>
kah_: yeah, read each and every section under Rubies and Gemsets as well as Workflow on the rvm site
<kah_>
kk, I'll get cracking
<deryl>
read it a couple times if you have to. 99.999% of our problem reports stem from users NOT reading the docs
<deryl>
and thats my singular pet peeve :)
<geekbri>
deryl: this works for all future users setup not just existing ones right?
tdubz [tdubz!~tdubellz@freenode/staff/tdubellz] has joined #ruby
Xerife [Xerife!~Soarez@a79-169-26-117.cpe.netcabo.pt] has joined #ruby
<deryl>
does nothing for existing users (the --skel command) existing users have to run the rvm user gemsets command themselves
<deryl>
there is no real way to sanely and safely apply that to existing users
<geekbri>
deryl: right, that makes sense. i can't think of a way to do it either other than just writing a script to sudo as those users and run that command.
jbw [jbw!~jbw@dsl-044-084.cust.imagine.ie] has joined #ruby
<deryl>
geekbri: yeah and if they have a custom rvmrc already, you can bork their shit. we don't wanna cause that :)
jbpros [jbpros!~jbpros@57-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
robyurkowski [robyurkowski!~robyurkow@216.252.93.17] has joined #ruby
<geekbri>
deryl: yeah. very very true :)
<deryl>
what admins do.. thats on them hehe
<geekbri>
;)
<deryl>
i'm crazy, not stupid :)
<geekbri>
the eternal struggle, ops vs dev :-P
<deryl>
yep
ikaros [ikaros!~ikaros@dslb-094-219-214-087.pools.arcor-ip.net] has joined #ruby
<geekbri>
enjoy your conferece :)
zastaph [zastaph!zastaph@unaffiliated/zastaph] has joined #ruby
<geekbri>
thanks for the help.
<deryl>
not a problem :)
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
mpabst [mpabst!~mpabst@c-67-188-8-151.hsd1.ca.comcast.net] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
maletor [maletor!~maletor@c-69-181-24-86.hsd1.ca.comcast.net] has joined #ruby
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby
yekta [yekta!~yekta@c-24-1-182-219.hsd1.il.comcast.net] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
LiquidInsect [LiquidInsect!~billabney@c-98-208-52-180.hsd1.ca.comcast.net] has joined #ruby
cemycc [cemycc!~cemycc@79.112.109.87] has joined #ruby
nopper [nopper!~nopper@ns.patched.biz] has joined #ruby
arex\ [arex\!q@158.36.150.14] has joined #ruby
<arex\>
Reading a 300 MB file into an array results in a 1GB array. Does that make sense?
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby
<rippa>
depends on how you store whatever you read
wroathe [wroathe!~wroathe@173-17-249-11.client.mchsi.com] has joined #ruby
<arex\>
rippa: f.each_line { |line| array << line }
LMolr [LMolr!~quassel@adsl-ull-18-226.42-151.net24.it] has joined #ruby
<rippa>
doesn't make much sense then
<yxhuvud>
depends on how long the lines are
<arex\>
yxhuvud: pretty short, it's a word list
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
<arex\>
is there a better way of loading a file into memory in Ruby?
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<rippa>
read it all into a string
<yxhuvud>
how much does it take if you just read the file into memory? does it take much more than the 300mb?
ylluminate [ylluminate!~ylluminat@rrcs-24-123-53-166.central.biz.rr.com] has joined #ruby
<arex\>
yxhuvud: you mean as a string?
<yxhuvud>
yes. f.read
<arex\>
i'll try. 1 sec
<arex\>
it takes 300 MB, the same as the file size
<arex\>
but as an array it's 1 GB :P
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-61-141.mco.bellsouth.net] has joined #ruby
acts_as_david [acts_as_david!~acts_as_d@c-71-202-155-161.hsd1.ca.comcast.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
drknus [drknus!~user@142.68.215.147] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-61-141.mco.bellsouth.net] has quit [#ruby]
somnium [somnium!~somnium@77.53.201.199] has joined #ruby
stringoO [stringoO!~JLstring@bas1-toronto42-1279599687.dsl.bell.ca] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
GoogleGuy [GoogleGuy!~ChromeOS@unaffiliated/googleguy] has joined #ruby
jetblack [jetblack!~jetblack@99-32-20-118.lightspeed.elgnil.sbcglobal.net] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
<arex\>
looks like a hash was a tiny bit cheaper - only 927 MB
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
tdubellz [tdubellz!~tdubellz@freenode/staff/tdubellz] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
drknus [drknus!~user@142.68.215.147] has joined #ruby
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
akem [akem!~akem@253.195.84.79.rev.sfr.net] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
banseljaj [banseljaj!~imami@42.83.85.44] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
<banseljaj>
Hi Guys. I want to know which GUI toolkit to use for rapid application development? Say, if i wanted to create a very simple data entry system? Which would be recommended?
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
jbpros [jbpros!~jbpros@57-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
wroathe [wroathe!~wroathe@173-17-249-11.client.mchsi.com] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has quit [#ruby]
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
kidoz [kidoz!~kidoz@85.159.44.109] has joined #ruby
acts_as_david [acts_as_david!~acts_as_d@75-149-43-78-SFBA.hfc.comcastbusiness.net] has joined #ruby
Quintus_q [Quintus_q!~quintus@dtmd-4db2d01d.pool.mediaWays.net] has joined #ruby
vinix [vinix!~vinix@122.176.229.11] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
_2easy [_2easy!~nofuture@89-79-244-137.dynamic.chello.pl] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
pantsman [pantsman!~pantsman@2.25.208.173] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
tdubz_ [tdubz_!~tdubellz@freenode/staff/tdubellz] has joined #ruby
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby
pantsman [pantsman!~pantsman@2.27.109.195] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
LMolr [LMolr!~quassel@adsl-ull-18-226.42-151.net24.it] has joined #ruby
dubellz [dubellz!~tdubellz@freenode/staff/tdubellz] has joined #ruby
VictorMartins [VictorMartins!~VictorMar@87-196-107-112.net.novis.pt] has joined #ruby
sean_ [sean_!~seanmccan@d173-181-72-140.abhsia.telus.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
trend [trend!~trend@76.91.169.147] has joined #ruby
cooper [cooper!~mitchell@unaffiliated/furryfishy] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
silky [silky!~silky@pool-74-108-142-22.nycmny.fios.verizon.net] has joined #ruby
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby
Paoc_ [Paoc_!~paoc@pc-162-161-164-190.cm.vtr.net] has joined #ruby
Phrogz_ [Phrogz_!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
_|christian|_ [_|christian|_!~christian@190.232.98.61] has joined #ruby
banseljaj [banseljaj!~imami@42.83.85.36] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
Phrogz [Phrogz!~Phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
Murr_ [Murr_!~murr@84-73-204-122.dclient.hispeed.ch] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
Murr_ [Murr_!~murr@84-73-204-122.dclient.hispeed.ch] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby
Murr_ [Murr_!~murr@84-73-204-122.dclient.hispeed.ch] has joined #ruby
sonkei [sonkei!~sonkei@d14-69-26-171.try.wideopenwest.com] has joined #ruby
iBog [iBog!~iBog@206.188.130.222.ppp.northrock.bm] has joined #ruby
<iBog>
hello
<apeiros_>
olà
<iBog>
what type of applications is ruby suitable for?
<apeiros_>
ruby is a general purpose language, so in principle any.
<apeiros_>
practically it's not well suited for high-performance/ultra-low-latency work
<iBog>
I'm starting to wireframe a web application I want to have developed. just decidig what platform/language would make the most sense
<apeiros_>
it's also not well suited for resource-restricted envs
noname [noname!~textual@c-67-171-131-23.hsd1.wa.comcast.net] has joined #ruby
<apeiros_>
for web-development it's one of the best tools, if not the best tool available
<iBog>
what would be some of the most widely used?
ctp [ctp!~ctp@nl.gigabit.perfect-privacy.com] has joined #ruby
<iBog>
ok… I'll keep that in mind. maybe look for a ruby developer
<apeiros_>
the most widely used languages for web apps are probably php, ruby, java, asp, maybe even in that order.
<iBog>
thanks
<Phrogz>
But don't pick a php developer :)
<apeiros_>
don't pick to be a java developer either
<apeiros_>
oh, python is popular too
<iBog>
Phrogz: why not php? you biased for ruby?
<apeiros_>
I think IFF you use another language than ruby, at least use python
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<apeiros_>
iBog: I did 6-7y of php before and partially while doing ruby
<apeiros_>
php SUCKS ASS, mkay?
<apeiros_>
perl - from which it derived - was and is a better tool
<Phrogz>
We are mostly biased in here, but informedly so. PHP is a terrible language. As a sweeping generalization, most PHP developers are also clueless, poor at programming.
<iBog>
but ruby is not suitable for high performance?
<apeiros_>
iBog: webapps aren't high performance
<iBog>
agreed
<apeiros_>
unless you're one of the 0.001% websites out there like twitter or google
<iBog>
not me
<apeiros_>
correct, not you. :)
<Phrogz>
Depends on how high "high" is. Ruby is not appropriate for high speed medical simulations. Ruby is appropriate for almost all web applications.
<iBog>
I do not have delusions of grandeur
<apeiros_>
and even if - unless you start out at a billion requests per day, ruby is still great to grow there in the first place. you can still change gradually.
<apeiros_>
much more efficient.
<apeiros_>
twitter did it too, and they did well to do so.
jhunter [jhunter!jfigga@c-67-169-75-5.hsd1.ca.comcast.net] has joined #ruby
<Phrogz>
Ruby makes your developers very fast.
<iBog>
and what is ajax?
<apeiros_>
they used rails to get a quick and easy start, and they phased ruby out of performance sensitive areas when they grew into billions of messages per day.
_2easy [_2easy!~nofuture@89-79-244-137.dynamic.chello.pl] has joined #ruby
<apeiros_>
ajax is a technique to use javascript to load additional data/content
<Phrogz>
Ajax is using JavaScript to fetch smaller resources client side instead of fetching entire new pages with each request.
<apeiros_>
Phrogz: s/smaller// :)
<apeiros_>
I use ajax to load "the whole fucking rest", which is often like 50x bigger than the initial request ;-)
<Phrogz>
:) I'm typing on a phone ATM; should type less anyway :)
<apeiros_>
:-p
<iBog>
and how does ruby differ from ruby on rails?
<apeiros_>
iBog: ruby is the language
<apeiros_>
ruby on rails is a webframework written in ruby.
<apeiros_>
so ruby on rails is to ruby, what django is to python, or what drupal is to php…
<iBog>
ok
<apeiros_>
you do know google and wikipedia, right?
<iBog>
ok… so I'll continue with my wire framing… the workflow… and data structures
<iBog>
asp: yes… thats the end of my basic questions :)
<iBog>
I'll use google to fill in the blanks about those languages
<apeiros_>
asp?
<iBog>
just trying to determine what the options may be
<iBog>
apeiros_:
<iBog>
type
<iBog>
o
<apeiros_>
ah
<iBog>
:)
<Phrogz>
.net is _an_ option. Not a good one IMHO
<iBog>
that works on linux?
<apeiros_>
I'm obviously biased, but the options in descending order are IMO: ruby, python, perl, php, java
DFa [DFa!~DFa@AStrasbourg-252-1-111-151.w109-217.abo.wanadoo.fr] has joined #ruby
<iBog>
perfect!
<apeiros_>
depending on the size of your project, I'd recommend sinatra or ruby on rails as a framework when using ruby.
<DFa>
Hello
<apeiros_>
note that the *setup* of ruby/ruby-on-rails stack tends to take more effort than php, as there are less pre-done packages.
<iBog>
apeiros_: since I'm not a hardcore developer… any suggestions on how to find a developer and ensure the code is well structured and documented so others can also work on it?
mk03 [mk03!~mk03@112.136.51.23.er.eaccess.ne.jp] has joined #ruby
<DFa>
I've to select an object (color) in an array according to a value between 0 & 100, do yo know how to do that correctly ?
<apeiros_>
iBog: sorry, no, I never stood on that side
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
<apeiros_>
there are a couple of websites dedicated to find devs, don't know them by heart
<burgestrand>
it’s awfully hard to make a good decision if you don’t know the field yourself
<burgestrand>
but it would not be a bad idea to take up coding, even if it’s just to learn what all the things mean, iBog
<iBog>
apeiros_: I've seen sites for finding devs. I know some indian developers will quote low… but I don't know how to personally judge the work
<apeiros_>
iBog: only advice I can give (from my experience of trying to hire devs for my employer) - we're living in a time of self-overestimation. most candidates we had vastly overestimated their own capabilities.
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
<apeiros_>
iBog: oh, make sure you have people you can visit personally. the less experience you have the more important that is.
<iBog>
burgestrand: I did some dev in university, pascal and smalltalk. also done rexx and other scripting. nothing serious
<apeiros_>
blending is easier over distance.
<Quintus_q>
DFa: Have a look at the Enumerable#find method: ary.find{yourcriteria}
<iBog>
I know the application I'm designing. Which is why I'm wire framing it all
flak [flak!~rippa@93-181-235-196.adsl.yaroslavl.ru] has joined #ruby
<iBog>
thanks for the advice guys
<ctp>
Hi folks. Anyone of you has a recommendation for me how to check if a data block is enclosed by valid <html></html> tags?
<DFa>
Quintus_q, my problem is that I don't know the size of the array, and I've to choose the closest color according to the value ; (value can be between 0 & 100), I'm not sure find can help me :s
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
<ctp>
so it should fail when there's something like "<html>lotoffoobar"
pantsman [pantsman!~pantsman@2.27.109.132] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
<ctp>
*missing </html>
<DFa>
for instance, if value = 20 & colors.length = 5, I should chose colors[1]
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
<Quintus_q>
DFa: What about iterating through the array and picking a value if it is closer than the one you previously found? At the end of the iteration you will end up with the closes one possible.
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<Phrogz>
ctp: must it start and end with those, or just have those somewhere in the middle?
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby
<ctp>
Phrogz: <html should be somewhere cause of <!DOCTYPE as first line in many pages. </html> should be the last line
<DFa>
something like: value = @Value / 100 * @Colors.length and then look for the closest color id ?
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<Phrogz>
valid = str =~ %r{<html>.+?</html>.*\z}
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<Phrogz>
Oops; try again:
<Quintus_q>
DFa: So your problem isn't picking the value out of the array, but rather the actual comparison of the colors?
krz [krz!~foobar@unaffiliated/krz] has joined #ruby
<Phrogz>
%r{<html[^>]*>[\d\D]+?</html>.*\z}
<Phrogz>
Try that, ctp.
idletom [idletom!b@173-30-162-172.client.mchsi.com] has joined #ruby
<ctp>
Phrogz: huuh, seems cryptic :) mni thx :)
<DFa>
I'm not very fluent in english, sorry. I'm working on a "Bar" in a script for RPG Maker, this bar can have differents colors (for instance in an HP bar, it will be red under 33%, orange between 33 & 66 and green over 66 % )
lupine_85 [lupine_85!~lupine_85@2001:41c8:51:8::10] has joined #ruby
acts_as_david [acts_as_david!~acts_as_d@75-149-43-78-SFBA.hfc.comcastbusiness.net] has joined #ruby
lupine_85 [lupine_85!~lupine_85@unaffiliated/lupine-85/x-7392152] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
<apeiros_>
Phrogz: '<html>foo<!-- </html> -->'
<apeiros_>
also, [\d\D] - isn't that equivalent to . ? :)
<Phrogz>
And this, children, I'd why we don't use regex yo parse HTML.
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<Phrogz>
apeiros_: I never remember between JS and ruby when . can match a newline with or without /m
<apeiros_>
ctp: use e.g. nokogiri to parse the html and check for errors
<Quintus_q>
DFa: So you effectively have 3 colors: red, orange and green, stored in an array @colors, right? How about a simple case then: case percent_hp_here; when 0..33 then @colors[0]; when 33..66 then @colors[1]; else @colors[2]; end.
<apeiros_>
Phrogz: in ruby, . only matches newlines with //m
daniel_hinojosa [daniel_hinojosa!~danno@67-0-117-93.albq.qwest.net] has joined #ruby
<Phrogz>
Problem is that Nokogiri.html is permissive.
<apeiros_>
I think you can check whether it had errors
<Phrogz>
And Nokogiri.XML not permissive enough
<DFa>
Quintus_q because I want to make an extensible class, I don't want to make one class by type of bar just because they need different color and different number of color
<apeiros_>
and depending on what you want you can either use the sanitized html nokogiri gives you or blow up if it reports errors
<ctp>
apeiros_ + Phrogz: i don't need to validate the html doc, only to check if its opened and closed. nokogiri is fine but i need some really performant way to check hundreds of docs per sec
<apeiros_>
ctp: that IS a validation
<apeiros_>
whether you're prepared to admit it or not :)
<Phrogz>
Can you? And it will yell about . HTML("<p>hi</p>")?
<ctp>
apeiros_: hm, i'll try both
* Phrogz
can't test on the phone
<apeiros_>
ctp: also before prematurely optimizing, maybe check whether nokogiri ain't fast enough.
<ctp>
yepp
<apeiros_>
I found it took less than 1ms to performe xsd validations on some medium sized xml docs.
<apeiros_>
*perform
<Quintus_q>
DFa: I'm sorry, I don't get your problem it seems. Sorry if I can't help you.
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
chalky [chalky!~4eek@41-133-175-232.dsl.mweb.co.za] has joined #ruby
mikepack [mikepack!~mikepack@c-174-51-77-22.hsd1.co.comcast.net] has joined #ruby
<msch>
does a class get a callback when another class inherits from it?
Paoc_ [Paoc_!~paoc@pc-162-161-164-190.cm.vtr.net] has joined #ruby
LnL [LnL!~LnL@d54C4DBC4.access.telenet.be] has joined #ruby
tvw [tvw!~tv@e176006226.adsl.alicedsl.de] has joined #ruby
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
<Quintus_q>
DFa: After some thinking I think I understand... So, you have the percent of the hp, and now you want the percent of the indices in the array, i.e. mapping 100% of the HP to the last index of the array, 50% of the HP to the middle index, 0% to the first, etc.
<msch>
apeiros_: thanks, didn't find it on ruby-doc.org
<Quintus_q>
DFa: Mh, you have to call #round there somewhere, otherwise you'll be passing a float to Array#[].
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
daniloisr [daniloisr!bd48b036@gateway/web/freenode/ip.189.72.176.54] has joined #ruby
dpiwowarski [dpiwowarski!~dpiwowars@195.187.156.125] has joined #ruby
<dpiwowarski>
Hi.
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
at5l [at5l!~at5l@unaffiliated/at5l] has joined #ruby
<gigamonkey>
hmmm. Is there a deep reason Ruby (1.9.3) requires a magic encoding comment to specify the encoding of a source file when LANG is set? Or that's just the way things are?
<gigamonkey>
I guess maybe source files are likely to be passed from machine to machine and should just work.
<apeiros_>
good guess
<apeiros_>
there is some way to set the default, I don't know it by heart because I think it's stupid to use it. for the very reason you just cited.
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby
<DFa>
Quintus_q it seems to work well using floor, thanks a lot
<daniloisr>
Hi everybody, I'm using rvm and I need the ruby header files (like /usr/lib/ruby/1.8/i686-linux/rubyio.h), there is a way to get them by rvm?
<dpiwowarski>
I have a text in UTF8 which contains czech diacritics. I need to convert these diactrcritics to the regular english letters. I.e 'ą' -> 'a'. I don't want to write a regexp. Do you know any gem which could do it?
<Quintus_q>
DFa: You're welcome :-)
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby
Boohbah [Boohbah!boohbah@gateway/shell/anapnea.net/x-gwnkpxpbfwtvzgbh] has quit [#ruby]
adeponte [adeponte!~adeponte@pool-173-51-131-197.lsanca.fios.verizon.net] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
raffivar [raffivar!~mcriddles@IGLD-84-229-201-153.inter.net.il] has joined #ruby
xsdg [xsdg!~xsdg@SIPB-VM-99.MIT.EDU] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
<Quintus_q>
Thank you :-). Some notes on your coding style: Don't use camelCase. In Ruby, you normally use snake_case. Also, instance variables should be written entirely in lowercase, and when a method doesn't receive any arguments, you can ommit the (). Then, do avoid global variables. If you need something globally available, either use constants or class/module methods.
<Quintus_q>
...you can even ommit the () for nearly every method call, but usually they're just ommit for so-called "decorators" such as #puts or #attr_accessor plus the no-args case.
<arex\>
I have an array in Ruby containing a million strings with only the letters LUDS. Can I translate this into some other format or datastructure to save memory?
ilyam [ilyam!~ilyam@c-67-188-113-128.hsd1.ca.comcast.net] has joined #ruby
<arex\>
i did to_sym on everything, but I didn't save THAT much
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby
draginx [draginx!~Adium@unaffiliated/draginx] has joined #ruby
<draginx>
Is there a nice ruby gem that can calculate 100."+15%" ?
<Phrogz>
arex\: zip?
<DFa>
Quintus_q, what's the difference between camelCase & snake_case ?
<arex\>
DFa: thisIsCamelCase this_is_snake_case
aetaric [aetaric!~aetaric@74-130-83-237.dhcp.insightbb.com] has joined #ruby
<arex\>
Phrogz: what? really?
Nies [Nies!~Nies@43.Red-79-159-149.staticIP.rima-tde.net] has joined #ruby
pdtpatrick_ [pdtpatrick_!~pdtpatric@ip72-211-207-15.oc.oc.cox.net] has joined #ruby
<Phrogz>
arex\: For storage, or for processing? If processing, no, there's not a zip datastructure that lets you iterate the array of strings in memory.
<Phrogz>
Which memory are you trying to save? Serialized disk bytes, or ruby interpreter RAM bytes?
<arex\>
Phrogz: i'm going to process the array, but i'd rather unpack while iterating
<arex\>
RAM
<DFa>
Ahh
<arex\>
Phrogz: looking at String#pack - could that work?
<dpiwowarski>
heftig: thank you. Works like a charm.
<DFa>
what are the advantages of using snake case ?
<Phrogz>
DFa: Convention; no advantages.
<arex\>
DFa: it's convention - "how it's done" :P
<Phrogz>
Indeed, it's one more keypress.
<apeiros_>
draginx: what?
herval [herval!~Adium@187.114.193.196] has joined #ruby
<draginx>
apeiros_: I have a small database that has like "{"attributes":"+15%"}
<draginx>
and basically I need ot take an Integer and add +X%
<apeiros_>
draginx: *(1+p/100)
<Phrogz>
draginx: That's some pretty trivial math there.
<draginx>
no no
<draginx>
like convert that "+15%" string
<arex\>
Phrogz: If I could compress each array element when creating it, then uncompress when I was processing it, that would be awesome
<draginx>
into the actual equation
<apeiros_>
draginx: that's trivial too
<draginx>
how would I do it?
<apeiros_>
you'd get the +15 and convert it to int/float
<draginx>
well how do I get the +15? =/
<Phrogz>
arex\: You have only four characters total? How many letters in a string?
<apeiros_>
if you know that it'll just always be the "%" at the end, just chomp("%")
<draginx>
yeah it could be +15% or +200
<apeiros_>
draginx: well, maybe, just maybe, you should have specified that before
<arex\>
Phrogz: I was thinking there has to be a better way to store strings of only 4 possible characters. 8 chars on average, but i dont want an upper limit on the characters
<apeiros_>
anything else you forgot to say?
<Phrogz>
draginx: Specify all the possible forms it could be.
<draginx>
right my only concern atm is 100."+15%" and converting that to an Int with the final result
<draginx>
+15%, +25%, +10%, −5%, and -X and +X (replace X with digits from 1 to 10 digits)
<Phrogz>
arex\: You can use two bits to identify which of the four characters it is, which is 25% of the ascii representation.
<apeiros_>
as said, chomp the %, convert to int, use the basic math formula *(1+p/100)
<draginx>
or 1 to x digits
<Phrogz>
draginx: This is really, really simple code. You've been in this channel a long time. Can you program anything handling strings?
<draginx>
I can
<draginx>
but was wondering if there was a nice library
* Phrogz
has short patience with "programmers" who can't break down a simple problem into 2-3 steps and then figure out how to accomplish each step.
<draginx>
so if I had something more complex
<draginx>
id have that as well :)
<arex\>
Phrogz: yes. how do i make a "binary string" or whatever? say l = 00, u = 01, d = 10, s = 11
<Phrogz>
More complex like what?
<draginx>
order of operations, etc.
<Phrogz>
draginx: "etc." has no meaning when we don't have any idea what class of operations you are considering.
<Phrogz>
Perhaps you don't, either.
<Phrogz>
I don't see how "order of operations" applies to { "attribute": "+15%" }
<draginx>
Phrogz: you're right I don't, as I said "so if"
<draginx>
*facepalm*
<apeiros_>
draginx: ok, it took me ~20s
<Phrogz>
So, if there's a library that handles "+15%" as well as an undetermined number of other features that might somehow be related.
<apeiros_>
and it works
<apeiros_>
so if I can do it in 20s, you surely can do in a quarter of an hour and ask for improvements…
<draginx>
apeiros_: whatd u use? a switch/case?
<apeiros_>
if/then/else
<draginx>
LMAO
<draginx>
ok nvm guys
<apeiros_>
you only have two cases. unless you "forgot" something again.
<apeiros_>
you've *percent and ±value
<Phrogz>
How about _,op,amount = mystr.match(/([+-])(\+d)%/); diff = val*amount.to_f/100; if op=="+" then val += diff else val -= dif; end
nwonknu [nwonknu!nwonknu@gateway/shell/anapnea.net/x-brhoxlanvqagcpjt] has quit [#ruby]
<apeiros_>
val being the left operand?
<apeiros_>
Phrogz: you don't need to handle +/-
<apeiros_>
that's done by Kernel#Float already
<Phrogz>
apeiros_: Silly me
<Phrogz>
val += val*mystr[ /[+-]\d+(?:\.\d+)?/ ].to_f/100; ?
<Phrogz>
Oh, I see, didn't realize the % at end was optional. Hence the if.
<apeiros_>
^^
<apeiros_>
I only checked for =~ /%$/
<arex\>
If L = 00, U = 01, D = 10, S = 11, then LUDS = 00011011. How do I represent that in Ruby?
lewix [lewix!~lewix@bas1-toronto04-2925396554.dsl.bell.ca] has joined #ruby
lewix [lewix!~lewix@unaffiliated/lewix] has joined #ruby
adac [adac!~adac@85-127-20-90.dynamic.xdsl-line.inode.at] has joined #ruby
<msch>
Phrogz_: i want some method that's defined in a class know from which module it was called
<Phrogz_>
arex\: Or "%02b" % n
<arex\>
Phrogz_: Thanks! Trying to hack something out :)
<Phrogz_>
(If you want to save one character :)
mahlon [mahlon!mahlon@martini.nu] has joined #ruby
emocakes [emocakes!~om@p4FEA58A5.dip.t-dialin.net] has joined #ruby
odinswand [odinswand!~luke@27-32-234-171.static.tpgi.com.au] has joined #ruby
acts_as_david [acts_as_david!~acts_as_d@c-71-202-155-161.hsd1.ca.comcast.net] has joined #ruby
mikeycgto [mikeycgto!~mikeycgto@ool-4571cba8.dyn.optonline.net] has joined #ruby
mikeycgto [mikeycgto!~mikeycgto@pdpc/supporter/active/mikeycgto] has joined #ruby
<shevy>
even the last unworthy character will be saved
<shevy>
this is ruby!
oner [oner!~om@p4FEA58A5.dip.t-dialin.net] has joined #ruby
robyurkowski [robyurkowski!~robyurkow@216.252.93.17] has joined #ruby
Tinuk [Tinuk!~fox@178-26-92-180-dynip.superkabel.de] has joined #ruby
<arex\>
Phrogz_: best way to go from "00000000" to an actual byte?
<Phrogz_>
.to_i(2)
<arex\>
hmm, ok, but i can't do "0000000000000000".to_i(2).to_s(2) and get "0000000000000000", so maybe i do really need to get the length into my bitstring?
ctp_ [ctp_!~ctp@dslc-082-083-157-081.pools.arcor-ip.net] has joined #ruby
ctp- [ctp-!~ctp@213.163.64.43] has joined #ruby
vraa [vraa!~vraa@99-20-202-44.lightspeed.hstntx.sbcglobal.net] has joined #ruby
<Phrogz_>
arex\: "%08b" % n will give you a zero-padded 8-char string. However, for your packing/unpacking, I think you want to ensure that you are always handling one byte (no more than 8 bits) at a time.
<shevy>
I find this all very complicated
mikeric [mikeric!~mike@S0106c03f0e8b23f3.vc.shawcable.net] has joined #ruby
milkpost_ [milkpost_!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
<Phrogz_>
arex\: I assume you're going to store your 'compacted' data as a binary string, an actual String that you can call each_byte on.
nivoc [nivoc!~matthias@ipc-hosting.de] has joined #ruby
<arex\>
Phrogz_: i'd like that, but so far i have only been able to build the ascii string
<Phrogz_>
arex\: Well, just keep asking questions :)
Xerife [Xerife!~Soarez@a79-169-26-117.cpe.netcabo.pt] has joined #ruby
inteq [inteq!~justin.si@adsl-98-88-29-211.asm.bellsouth.net] has joined #ruby
jackhammer2022 [jackhammer2022!~textual@c-24-34-124-94.hsd1.ma.comcast.net] has joined #ruby
<shevy>
arex\, you should indent case/when on the same lines
<Phrogz_>
arex\: First, decide how you want to encode each of "LUD", "LUDS", "LUDSU". My thoughts are that the first is a single byte where the last two bits are 01, the second is two bytes where the last two bits of the second byte are 11 (which means to ignore *four* characters)
<shevy>
I mean same indent levels
<Phrogz_>
And the last is two bytes again, where the last two bits of the second byte are 10 (which means to ignore 3 characters)
<Phrogz_>
arex\: For fun, I'm going to make my own implementation along those lines.
<shevy>
hehe
<arex\>
Phrogz_: :D
odinswand [odinswand!~odinswand@27-32-234-171.static.tpgi.com.au] has joined #ruby
<arex\>
Phrogz_: The way I have encoded my string, will I have trouble decoding it because I don't know the string's length?
<apeiros_>
str.length, no?
<Phrogz_>
arex\: The way I'm going to do it the last two bits of the last byte always indicate how many characters to ignore in that byte.
<apeiros_>
or .bytesize
<arex\>
apeiros_: The way I have done it, bitstring is a Fixnum
<apeiros_>
a fixnum ain't a string
<arex\>
I know
<apeiros_>
also unless by fixnum you mean integer, you do have an upper bound
<arex\>
hmm that's true
<apeiros_>
Phrogz_: interesting, why the last two bits and not the first two?
c0rn [c0rn!~c0rn@adsl-69-110-13-69.dsl.pltn13.pacbell.net] has joined #ruby
<Phrogz_>
apeiros_: No reason.
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
<Phrogz_>
Less shifting, I'm guessing.
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
emocakes [emocakes!~om@p4FEA58A5.dip.t-dialin.net] has joined #ruby
hasrb [hasrb!~hasrb@108-85-134-26.lightspeed.austtx.sbcglobal.net] has joined #ruby
tubgoat_ [tubgoat_!~tubgoat@gateway/tor-sasl/tugboat] has joined #ruby
visof [visof!~visof@unaffiliated/visof] has joined #ruby
Illiux [Illiux!~nol@fq2-wireless-pittnet-47-145.wireless.pitt.edu] has joined #ruby
idletom [idletom!b@173-30-162-172.client.mchsi.com] has joined #ruby
adeponte [adeponte!~adeponte@pool-173-51-131-197.lsanca.fios.verizon.net] has joined #ruby
mpapis [mpapis!~mpapis@cust27-176.p6.gorzow.infineo.pl] has joined #ruby
<shevy>
why not the middle two bits!!!
conor_ireland [conor_ireland!~conor_ire@89.100.121.49] has joined #ruby
blueadept [blueadept!~blueadept@72.21.137.199] has joined #ruby
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
wroathe [wroathe!~wroathe@173-17-249-11.client.mchsi.com] has joined #ruby
conntrack [conntrack!~tor@pdpc/supporter/professional/conntrack] has joined #ruby
<Phrogz_>
This is retarded; what's an elegant way to map [0,1,2,3] to [4,1,2,3] ?
<Phrogz_>
mod shouldn't be this hard.
akem [akem!~akem@unaffiliated/akem] has joined #ruby