<DreamingRainne>
Like for RAII? That could be handy sometimes, yeah.
<eam>
es
<eam>
pretty optimistic on rust in that regard
<DreamingRainne>
Then again, you do have stuff like File.open taking a block, which can serve the same purpose a lot of the time.
<eam>
kinda yeah but try doing that with any moderate complexity
<Wixy>
Hey guys. I'm not sure if I can do this here, is there a better channel to hire programmers? We're looking for people to work on rails projects? pm your github username! we're hiring! :)
terrellt has quit [Quit: Leaving...]
b00stfr3ak has joined #ruby
echooo has joined #ruby
nanoyak has joined #ruby
Bumptiou_ has quit [Ping timeout: 255 seconds]
<DreamingRainne>
I wrote something a while back that worked with files on disk and cached them in memory. A "flush to disk if edited" destructor would've been nice.
kldskp has joined #ruby
nanoyak has quit [Client Quit]
<DreamingRainne>
I tried working with weak-references and finalizers, but, the object is already destructed by the time the finalizer gets to run, which kinda defeats the purpose.
<eam>
"solve it with a block" is soooorta another way of saying "manage your own resource lifecycle since the gc is totally inadequate"
<eam>
gc kinda almost but not really makes sense for pure memory resources, but the problem is memory is not the only managed resource
<DreamingRainne>
As it is, I wound up coming up with a Hash + linked-list structure that did exactly what I was after. (Lookup by name (Hash), order by access time, can limit the size and auto-flush the ones that run off the end due to being old.)
dmitrykorotkov has joined #ruby
<eam>
and it's completely inadequate for almost any non-memory resource
<eam>
like a descriptor
* DreamingRainne
nods.
<DreamingRainne>
I've never really trusted GC that much, myself. I figure, if the GC can figure out when the object is eligible to be reaped, so can whatever it is that *makes* it eligible and it should do it on the fly.
<DreamingRainne>
Another program I wrote, had an image shown with a Gtk::Image, and it auto-resized it as the window resized so that it filled the area it was in. Doing so required scale()ing the image as the window size changes.
<eam>
ran out of memory?
<DreamingRainne>
Okay, fine, but I pretty much had to call GC.start (or whatever it is) every time, otherwise they'd all accumulate in memory.
SilkFox_ has joined #ruby
<benzrf>
DreamingRainne: youre basically saying 'if the computer can figure it out, so can i, therefore i should do it'
<eam>
yes, I had the same problem when I was first learning ruby - 1.4 or 1.6?
b00stfr3ak has quit [Read error: Connection reset by peer]
<DreamingRainne>
benzrf: No, it shouldn't call for any change in user code. It'd still all be internal.
<benzrf>
oh, you mean for that lib
<benzrf>
mb ok
<DreamingRainne>
But it'd allow for more options for the user, such as RAII/destructors.
ascarter has quit [Ping timeout: 256 seconds]
<eam>
I wrote a comic book reader that would page through .zip files of jpgs and render them, each image was about 10mb SDL surface
volk_ has joined #ruby
kldskp has quit [Ping timeout: 256 seconds]
Takle has quit [Ping timeout: 256 seconds]
<eam>
and 2/3 of the way through a comic X started to stutter and eventually swap death
parduse has quit []
nanoyak has joined #ruby
<eam>
java has the same problem really, there are no good GC implementations for high performance / low latency
Jetchisel has quit [Read error: Connection reset by peer]
jonr22 has quit [Ping timeout: 245 seconds]
Zenigor has quit [Ping timeout: 250 seconds]
bmurt has quit []
oo_ has quit [Remote host closed the connection]
Sawbones has quit [Ping timeout: 260 seconds]
Lemur has quit [Ping timeout: 240 seconds]
Grantlyk has joined #ruby
hgl has joined #ruby
RandyT has quit [Ping timeout: 244 seconds]
cashnguns has quit [Remote host closed the connection]
oo_ has joined #ruby
RandyT has joined #ruby
x1337807x has joined #ruby
koderok has joined #ruby
felgenh3 has joined #ruby
Vile` has quit [Remote host closed the connection]
aspires has quit []
justinv has joined #ruby
Vile` has joined #ruby
Cache_Money has joined #ruby
justinv has quit [Remote host closed the connection]
ziyadb has quit [Quit: Connection closed for inactivity]
jdj_dk has quit [Ping timeout: 260 seconds]
InfraRuby has joined #ruby
philcris_ has quit [Remote host closed the connection]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MatthewsFace has quit [Quit: This computer has gone to sleep]
philcris_ has joined #ruby
rismoney1_ has quit [Ping timeout: 250 seconds]
Wolland_ has quit []
freerobby has joined #ruby
GriffinHeart has joined #ruby
philcris_ has quit [Ping timeout: 240 seconds]
InfraRuby has left #ruby [#ruby]
omosoj has quit [Quit: Leaving]
SilkFox_ has joined #ruby
tjr9898 has quit [Remote host closed the connection]
philcris_ has joined #ruby
tjr9898 has joined #ruby
AlexRussia has quit [Ping timeout: 250 seconds]
braincrash has quit [Quit: bye bye]
Deele has quit [Ping timeout: 244 seconds]
kldskp has joined #ruby
kaspergrubbe_ has joined #ruby
AlexRussia has joined #ruby
bronson has quit [Quit: bronson]
mlr has joined #ruby
Lemur has joined #ruby
SilkFox_ has quit [Ping timeout: 256 seconds]
braincrash has joined #ruby
davispuh has quit [Ping timeout: 245 seconds]
jamesfor_ has quit []
kldskp has quit [Ping timeout: 245 seconds]
mgaulton-uwaterl has joined #ruby
theharshest has quit [Quit: This computer has gone to sleep]
mbuf has joined #ruby
kaspergrubbe_ has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
_m_g_ has quit [Ping timeout: 260 seconds]
bobdobbs has joined #ruby
ffranz has quit [Quit: Leaving]
mbuf has quit [Read error: Connection reset by peer]
ki0 has joined #ruby
d4nk has quit [Ping timeout: 255 seconds]
whyy has joined #ruby
koderok has quit [Ping timeout: 240 seconds]
michaeldeol has joined #ruby
jdj_dk has joined #ruby
ki0 has quit [Ping timeout: 255 seconds]
d4nk has joined #ruby
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davedev2_ has joined #ruby
Sid05 has quit [Quit: Sid05]
<cajone>
Guys I have a tuple collection [["2004",3],["1909",18],["1952",103],...] any ideas how I can sort this so that the strins dates are in order?
<cajone>
string*
totem has joined #ruby
jxf has joined #ruby
totem has quit [Max SendQ exceeded]
vsoftoiletpaper has quit []
davedev24_ has quit [Ping timeout: 250 seconds]
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
freerobby has quit [Quit: Leaving.]
vsoftoiletpaper has joined #ruby
vsoftoiletpaper has quit [Remote host closed the connection]
Sawbones has joined #ruby
philcris_ has quit [Remote host closed the connection]
<heftig>
cajone: sort_by
totem has joined #ruby
totem has quit [Max SendQ exceeded]
Grantlyk has quit [Remote host closed the connection]
Sawbones has quit [Client Quit]
totem has joined #ruby
Panicky has quit [Read error: Connection reset by peer]
Sid05 has joined #ruby
totem has quit [Max SendQ exceeded]
robbyoconnor has quit [Quit: Konversation terminated!]
totem has joined #ruby
<ericwood>
you can pass sort_by a block and tell it what to compare
<ericwood>
pretty nifty!
<pipework>
truly
joakim__ has joined #ruby
<DreamingRainne>
cajone: Or, for that collection, a simple .sort should do it. Arrays are compared (to each other) by their first elements, then second elements, and so on.
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
InfraRuby has joined #ruby
Sid05_ has joined #ruby
<gr33n7007h>
cajone, so basically a [["2004",3],["1909",18],["1952",103]].sort should do it
arup_r has quit [Ping timeout: 264 seconds]
eka has joined #ruby
Bumptious has quit [Remote host closed the connection]
<cajone>
Thanks guys for all comments, still failed on both sort and sort_by, but I discovered that one of the tuple pairs in the collection had a value of 'nil' and I guess this is throwing the issue I was having, I would guess that I would need to pre-process this nil out of the tuple pairing before passing the object to sort
Atttwww has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
Bumptiou_ has joined #ruby
fantasticsid has joined #ruby
<DreamingRainne>
Well, you're probably better off figuring out how it got there in the first place, and fixing it there.
silentpost has quit [Quit: silentpost]
<DreamingRainne>
Like, if you're reading the data from a file and try to split() a blank line and get nils out of it without checking. Or something.
livingstn has quit [Ping timeout: 256 seconds]
<cajone>
DreamingRainne: yeah the data was pulled out of a sql table I will try fix at source
threesixes has quit [Remote host closed the connection]
<arup_r>
How ?
<arup_r>
inside the block
jack_rabbit has quit [Quit: Leaving]
Morkel has quit [Quit: Morkel]
dumdedum has joined #ruby
gauravagarwalr has quit [Ping timeout: 272 seconds]
joonty has joined #ruby
gauravagarwalr has joined #ruby
tjr9898 has quit [Ping timeout: 245 seconds]
olivier_bK has joined #ruby
krisquigley has joined #ruby
InfraRuby has left #ruby [#ruby]
iteratorP has quit [Remote host closed the connection]
mr_foobar_baz has joined #ruby
InfraRuby has joined #ruby
chrishough has quit [Quit: chrishough]
maximeshr has joined #ruby
taiansu has left #ruby ["Leaving..."]
timonv_ has quit [Remote host closed the connection]
Atttwwww has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
noop has joined #ruby
abuzze_ has joined #ruby
abuzze_ has quit [Remote host closed the connection]
Atttwww has quit [Ping timeout: 255 seconds]
<jhass>
arup_r: the second case doesn't throw an exception
abuzze_ has joined #ruby
<jhass>
that's just the stderr output of cat
Nahra has joined #ruby
dangerou_ has joined #ruby
morenoh150 has quit [Ping timeout: 240 seconds]
<arup_r>
yes
ch077179 has joined #ruby
abuzze has quit [Ping timeout: 264 seconds]
<arup_r>
jhass: I am looking for a way
<arup_r>
to catch the exception
luckyruby has quit [Quit: Leaving...]
<arup_r>
if you look into the simple a.rb
<jhass>
the one at the top?
<arup_r>
you can see the Exception class which I am actually looking to get inside the #popen
morenoh150 has joined #ruby
<arup_r>
first one is just an example
Neozonz has quit [Ping timeout: 264 seconds]
<arup_r>
test.rb is a code
<jhass>
there's no exception in the popen example
<arup_r>
stderr is giving the exception message corretcly
<arup_r>
#cat: a.txt: No such file or directory
<arup_r>
I got ...
<jhass>
why don't you just check if the file exists before trying to open it
<jhass>
return unless File.exist?('a.txt')
<arup_r>
I am just looking to hack the exception name
<jhass>
File.exists? ? I always forget
<arup_r>
That's just an example
<jhass>
you what?
<arup_r>
it could be any Unix exception
<sevenseacat>
its not an exception
<jhass>
there are no such things as a "unix exception"
<arup_r>
You are not getting me
rdark has joined #ruby
<sevenseacat>
you're not getting anything
<arup_r>
May be my fault
<arup_r>
sevenseacat: Leave it.. I will think and will show you.. how to do.. Thanks
<sevenseacat>
lol okay
<arup_r>
What I gave..is just an example
<arup_r>
I can put any command..
<arup_r>
but while stderr will print something.. means there is anything wrong
<arup_r>
But I thought I will track it using status code..
krisquigley has quit [Remote host closed the connection]
<arup_r>
But it is also helpless
SegFaultAX has quit [Excess Flood]
dangerou_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SegFaultAX has joined #ruby
dangerou_ has joined #ruby
vinleod_ has joined #ruby
iteratorP has joined #ruby
marr has joined #ruby
sepp2k has joined #ruby
dawkirst_ has joined #ruby
sevenseacat1 has joined #ruby
Arkaniad|Laptop has joined #ruby
bal has quit [Ping timeout: 264 seconds]
sepp2k1 has quit [Ping timeout: 264 seconds]
sevenseacat has quit [Ping timeout: 264 seconds]
radic has quit [Ping timeout: 264 seconds]
sirecote has quit [Ping timeout: 264 seconds]
cephalostrum has quit [Ping timeout: 264 seconds]
kenneth has quit [Ping timeout: 264 seconds]
ccooke has quit [Ping timeout: 264 seconds]
gwb3 has quit [Ping timeout: 264 seconds]
alex-i has quit [Ping timeout: 264 seconds]
wwalker has quit [Ping timeout: 264 seconds]
SirFunk has quit [Ping timeout: 264 seconds]
DanKnox has quit [Ping timeout: 264 seconds]
GeekOnCoffee has quit [Ping timeout: 264 seconds]
jpic has quit [Ping timeout: 264 seconds]
zenspider has quit [Ping timeout: 264 seconds]
v0n has quit [Ping timeout: 264 seconds]
thoolihan has quit [Ping timeout: 264 seconds]
QKO has quit [Ping timeout: 264 seconds]
minecoins has quit [Ping timeout: 264 seconds]
tiguser has quit [Ping timeout: 264 seconds]
moshee has quit [Ping timeout: 264 seconds]
wlanboy has quit [Ping timeout: 264 seconds]
wlanboy has joined #ruby
wlanboy has joined #ruby
dawkirst has quit [Ping timeout: 266 seconds]
vinleod has quit [Ping timeout: 266 seconds]
GlenK has quit [Ping timeout: 266 seconds]
Wixy has quit [Ping timeout: 266 seconds]
Sauvin has quit [Ping timeout: 266 seconds]
and has quit [Ping timeout: 266 seconds]
tcstar has quit [Ping timeout: 266 seconds]
nemesit|znc has quit [Ping timeout: 266 seconds]
crazed has quit [Ping timeout: 266 seconds]
existensil has quit [Ping timeout: 266 seconds]
headius has quit [Ping timeout: 266 seconds]
rageberry has quit [Ping timeout: 266 seconds]
pontiki has quit [Ping timeout: 266 seconds]
flagg0204 has quit [Ping timeout: 266 seconds]
ptierno has quit [Ping timeout: 266 seconds]
urtokk has quit [Ping timeout: 266 seconds]
oddraisi1 has quit [Ping timeout: 266 seconds]
camt has quit [Ping timeout: 266 seconds]
Muz has quit [Ping timeout: 266 seconds]
gzl has quit [Ping timeout: 266 seconds]
GGMethos has quit [Ping timeout: 266 seconds]
okinomo has quit [Ping timeout: 266 seconds]
jeekl has quit [Ping timeout: 266 seconds]
gtc|ghost has quit [Ping timeout: 266 seconds]
yazgoo_ has quit [Ping timeout: 266 seconds]
terlar has quit [Ping timeout: 266 seconds]
b1nd has quit [Ping timeout: 266 seconds]
stian has quit [Ping timeout: 266 seconds]
nomadic has quit [Ping timeout: 266 seconds]
gwb3 has joined #ruby
banjara has joined #ruby
radic has joined #ruby
wwalker has joined #ruby
ki0 has quit [Remote host closed the connection]
ptierno has joined #ruby
zenspider has joined #ruby
stian has joined #ruby
oddraisin has joined #ruby
gzl has joined #ruby
camt has joined #ruby
jpic has joined #ruby
GlenK has joined #ruby
flagg0204 has joined #ruby
SirFunk has joined #ruby
okinomo has joined #ruby
okinomo has joined #ruby
Muz has joined #ruby
DanKnox has joined #ruby
gtc has joined #ruby
mityaz has quit [Ping timeout: 264 seconds]
QKO has joined #ruby
Port3M5[Work] has quit [Ping timeout: 264 seconds]
GeekOnCoffee has joined #ruby
existensil has joined #ruby
ki0 has joined #ruby
Shidash has quit [Ping timeout: 240 seconds]
alex-i has joined #ruby
nomadic has joined #ruby
ccooke has joined #ruby
tcstar has joined #ruby
moshee has joined #ruby
sirecote has joined #ruby
pontiki has joined #ruby
cephalostrum has joined #ruby
kenneth has joined #ruby
Sauvin has joined #ruby
nemesit|znc has joined #ruby
yazgoo_ has joined #ruby
Port3M5[Work] has joined #ruby
vinleod_ is now known as vinleod
v0n has joined #ruby
bal has joined #ruby
jeekl has joined #ruby
terlar has joined #ruby
crazed has joined #ruby
headius has joined #ruby
rageberry has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Wixy has joined #ruby
b1nd has joined #ruby
and has joined #ruby
Wixy has quit [Changing host]
Wixy has joined #ruby
minecoins has joined #ruby
mityaz has joined #ruby
autochthon has joined #ruby
abuzze has joined #ruby
Sauvin has quit [Client Quit]
<jhass>
arup_r: if you just want to know if the command failed, check for non-zero exitstatus
urtokk has joined #ruby
tiguser has joined #ruby
sevenseacat1 is now known as sevenseacat
Sauvin has joined #ruby
<arup_r>
jhass: Yes I am also thinking so.. There not more than that I can do
dawkirst_ has quit [Client Quit]
GGMethos has joined #ruby
dawkirst has joined #ruby
morenoh150 has quit [Ping timeout: 240 seconds]
<jhass>
but as said, prior to running a command in most cases you want to check that the requirements for it are fulfilled, like a file you call with it exists (or doesn't exist if it should create it) etc.
Takle has quit [Remote host closed the connection]
hgl_ has joined #ruby
tkuchiki_ has joined #ruby
<gaussblurinc1>
jhass: second is pretty
jackneill has joined #ruby
SilkFox_ has joined #ruby
hgl has quit [Ping timeout: 240 seconds]
bnjamin has joined #ruby
bnjamin has quit [Client Quit]
bnjamin has joined #ruby
autochthon has quit [Remote host closed the connection]
banjara has joined #ruby
tkuchiki has quit [Ping timeout: 260 seconds]
Neozonz has joined #ruby
Neozonz has joined #ruby
tkuchiki_ has quit [Ping timeout: 240 seconds]
SilkFox_ has quit [Ping timeout: 255 seconds]
dangerou_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bnjamin has quit [Ping timeout: 244 seconds]
banjara has quit [Ping timeout: 260 seconds]
teddyp1c_ has quit []
<wasamasa>
lol
Neozonz has quit [Ping timeout: 240 seconds]
lanox has joined #ruby
jayunit100 has joined #ruby
lkba has joined #ruby
gogohome has quit [Quit: gogohome]
GriffinH_ has quit [Remote host closed the connection]
blackmesa has quit [Quit: WeeChat 0.4.3]
InfraRuby has joined #ruby
tjr9898 has joined #ruby
tkuchiki has joined #ruby
Takle has joined #ruby
ch077179 has quit [Ping timeout: 260 seconds]
gogohome has joined #ruby
Neozonz has joined #ruby
phutchins has joined #ruby
bMalum has joined #ruby
GriffinHeart has joined #ruby
Neozonz has quit [Ping timeout: 255 seconds]
TorpedoSkyline has joined #ruby
Cereal` has joined #ruby
MartinCleaver has joined #ruby
sts_ has joined #ruby
<sts_>
hello folks. can i find out which hostname was used when talking to the server in a sintra application?
Neozonz has joined #ruby
patrick99e99 has joined #ruby
clauswitt has joined #ruby
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Ayey_ has joined #ruby
Neozonz has quit [Ping timeout: 255 seconds]
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bluOxigen has joined #ruby
shredding has quit [Quit: shredding]
narendraj9 has quit [Quit: Connection closed for inactivity]
krz has quit [Quit: WeeChat 0.4.3]
SegFaultAX has quit [Excess Flood]
patrick99e99 has quit [Ping timeout: 272 seconds]
SegFaultAX has joined #ruby
phoo1234567 has joined #ruby
phoo1234567 has quit [Max SendQ exceeded]
phoo1234567 has joined #ruby
silentpost has joined #ruby
iamjarvo has joined #ruby
Sgeo has quit [Read error: Connection reset by peer]
anarang has quit [Ping timeout: 240 seconds]
sk87 has joined #ruby
Neozonz has joined #ruby
mostlybadfly has joined #ruby
arup_r has quit [Remote host closed the connection]
Hobogrammer has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
dangerou_ has joined #ruby
<sts_>
found it
<sts_>
:)
<jhass>
share it ;)
britneywright has joined #ruby
Xeago has quit [Remote host closed the connection]
Neozonz has quit [Ping timeout: 264 seconds]
silentpost has quit [Quit: silentpost]
Xeago has joined #ruby
arup_r has quit [Ping timeout: 245 seconds]
ferr has joined #ruby
r0f0 has joined #ruby
<r0f0>
do_sqlite3 is not installing on my system
Takle has quit [Remote host closed the connection]
<r0f0>
In am on windows7, and tring gem install do_sqlite3
chipotle has quit [Quit: cya]
Zenigor has joined #ruby
SilkFox_ has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
amystephen has joined #ruby
banjara has joined #ruby
InfraRuby has left #ruby [#ruby]
dangerousdave has quit []
Hanmac has quit [Remote host closed the connection]
amacou has joined #ruby
SilkFox_ has quit [Ping timeout: 244 seconds]
ferr has quit [Remote host closed the connection]
Takle has joined #ruby
ferr has joined #ruby
banjara has quit [Ping timeout: 255 seconds]
alexju has joined #ruby
anarang has joined #ruby
max06 has joined #ruby
smooks has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Neozonz has joined #ruby
Neozonz has joined #ruby
Neozonz has quit [Changing host]
Maitiu has joined #ruby
Neomex has joined #ruby
Hanmac has joined #ruby
arup_r has joined #ruby
arup_r has quit [Remote host closed the connection]
top4o has joined #ruby
arup_r has joined #ruby
jayunit100 has quit [Quit: jayunit100]
Neozonz has quit [Ping timeout: 255 seconds]
shredding has joined #ruby
sjuxax has joined #ruby
paulfm has joined #ruby
dumdedum has quit [Quit: foo]
<sjuxax>
Hi all. I'm using bunny with rabbitmq. I want to process up to four messages at once. It's not clear to me whether I need to explicitly make my own Threads or whether Bunny will do that itself. Does anyone know?
InfraRuby has joined #ruby
amacou has quit [Remote host closed the connection]
arup_r has quit [Ping timeout: 272 seconds]
ferr has quit [Remote host closed the connection]
ferr has joined #ruby
hamakn has quit [Remote host closed the connection]
timonv_ has joined #ruby
ferr has quit [Remote host closed the connection]
mr_foobar_baz has joined #ruby
EasyCo has quit [Quit: Connection closed for inactivity]
ferr has joined #ruby
DivineEntity has quit [Quit: leaving]
Neozonz has joined #ruby
Dwarf has quit [Ping timeout: 260 seconds]
ferr has quit [Remote host closed the connection]
ferr has joined #ruby
TheNumb has quit [Read error: Connection reset by peer]
<gaussblurinc1>
I need help with module dependency and project refactoring. could anybody help me with it?
TheNumb has joined #ruby
Morkel has joined #ruby
<shevy>
gaussblurinc1 require what you need in the files where you need them
Neozonz has quit [Ping timeout: 240 seconds]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
lanox has quit []
fgo has quit []
<gaussblurinc1>
shevy: yeah, I understand a principle of modules but I can't resolve my folder tree in right way. ok, suppose, that I have a component that solve one task perfectly. do I need to make 'moduleDependency.rb' file which contains all dependencies?
devoknievo_ has quit [Quit: Computer has gone to sleep.]
amacou has joined #ruby
<shevy>
the simplest way is to require what you need in the file where you make use of it
<shevy>
if different files share a subpopulation of those files, you could put it into a standalone file
devoknievo_ has joined #ruby
troulouliou_dev has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
toertore has joined #ruby
SpaceKookieII has joined #ruby
<SpaceKookieII>
Hey guys, I have a question how I can do something with .split(...): http://pastebin.com/xmbvhmX5
<SpaceKookieII>
I get the above string and want to split it, excluding things that are in ' ... ' because there MIGHT be spaces in there I don't want to include. Is that possible?
<banister>
anyone here familiar with nokogiri?
<ddv>
yes
toretore has quit [Ping timeout: 260 seconds]
<banister>
ddv how would i select all "<project>" nodes here? doing: doc.css("project") just gives me one node…
<banister>
ddv i'm happy using anything that works
bmurt has joined #ruby
<ddv>
you can use the expression //projects
whyy has joined #ruby
<ddv>
project*
Dwarf has joined #ruby
<jhass>
gaussblurinc1: usually as shevy said you require everything one file needs at the top of it, duplicates in other files don't matter. If there's stuff that's literally used everywhere a common pattern is to put it into lib/my_module.rb if your module has the namespace of MyModule (with more files in lib/my_module/a.rb ...). my_module.rb would also require the parts of the library that are needed to use it so you can just require 'my_module' on the caller side
<SpaceKookieII>
Anyone know about my question? /:
<shevy>
SpaceKookieII I dont get the question
<shevy>
you want to split, but not on what you pass to split() ?
GriffinHeart has joined #ruby
<SpaceKookieII>
What? No
<shevy>
that is a weird name for an @ivar btw
<shevy>
cmd.split(@SOMETHING)
jxf has quit [Ping timeout: 250 seconds]
<SpaceKookieII>
Do you see the output? I am asking…what do I need to split or how could I use Regex to get it to split the right way
<SpaceKookieII>
Splitting the commands but leaving the path in ' ' intact
Neozonz has joined #ruby
<SpaceKookieII>
<-- Has never worked with regex before so has no idea how to use them
lw has joined #ruby
<shevy>
I don't see a simple metric for how you want to split on that
<banister>
ddv i did that and i still only get one node
<shevy>
because you actually do want to split on ' ' but not when a preceding \ exists
<banister>
ddv doc.xpath("//project").count #=> 1
tanmay__ has quit [Remote host closed the connection]
tanmay_ has quit [Read error: Connection reset by peer]
<banister>
ddv yet there's heaps of project nodes there if you look at the xml i linked
<shevy>
in a regex it might be doable, there is the optional pattern match... I think it is via ?
<gaussblurinc1>
jhass: ok, but what about components of 'my_module'? how should they use common parts of project?
<SpaceKookieII>
Well...if it's possible it would be nice if split would just take anything that is in single-quotes as one thing and ignore it.
<shevy>
another solution is to .split, and then apply a .map or .join to rejoin only when the entry before had a trailing \ character
whyy has quit [Ping timeout: 240 seconds]
<shevy>
yeah it should be doable via a regex
<shevy>
.split(/?\\ /)
<shevy>
something like that
<ddv>
banister: weird it should work, maybe a namespace issue?
<shevy>
or a (|)
<crome>
shevy: we don't use perl, tx
<shevy>
well regexes are equally ugly everywhere
magikfx has joined #ruby
<Hanmac>
hey banister you are the head of pry right? i cant install "pry-full" on my system
<shevy>
SpaceKookie, you can always try to build up your regex via http://rubular.com/
<banister>
Hanmac pry-full is a clusterfuck
<SpaceKookieII>
Ah cool.split(/?\\ /) worked
<shevy>
really?
<shevy>
cool
<banister>
Hanmac try pry-suite or something or pry-plus
<SpaceKookieII>
Ah and thanks for the link
<Hanmac>
then you should solv it ;P
ferr has quit [Read error: Connection reset by peer]
<shevy>
I did not even test it hahahaha
<jhass>
gaussblurinc1: I'm not sure what you're asking. A dependency of a file is a dependency of a file and thus you require it at the top. Where it originates doesn't matter
<SpaceKookieII>
xD
<shevy>
but rubular.com is great, I use it when I test regexes
<SpaceKookieII>
Thanks for the link. I've never really done regexes so I need some practise :p
<SpaceKookieII>
Thanks :)
<ddv>
banister: can you try this before calling xpath? doc.remove_namespaces!
<banister>
ddv i fixed it, i was reading from the wrong file ;)
<banister>
ddv: thanks
<shevy>
regexes are like a mini programming language on their own
<ddv>
banister: ok nice
<ddv>
just don't try to parse html with regexes
<shevy>
haha
<apeiros>
just don't try to parse non-regular languages with regular expressions ;-)
<shevy>
hmm
<SpaceKookieII>
Noted :p
Neozonz has quit [Ping timeout: 264 seconds]
comma8 has joined #ruby
Dwarf has quit [Ping timeout: 250 seconds]
<Hanmac>
banister: "pry-plus" not installable: debugger-1.6.8 "/usr/local/lib/ruby/2.2.0/fileutils.rb:1391:in `initialize': No such file or directory @ rb_sysopen - ./220/ruby_debug.h"
ferr has joined #ruby
<apeiros>
I'm surprised .split(/?\\ /) works. as far as I see it, /?\\ / is not even a valid regex
<banister>
Hanmac some plugins won't work with dat shit
<banister>
Hanmac just use normal pry
<Hanmac>
yeah, lastest pull ;P
<SpaceKookieII>
But the sun sucks :p
<banister>
Hanmac what other plugins do u want?
<jhass>
gaussblurinc1: in a normal structure that would be lib/helpers/helpers.rb, lib/component_a.rb lib/component_a/first_part.rb and lib/component_a/second_part.rb and in second_part.rb you'd require 'helpers/helpers' since lib/ would be in the $LOAD_PATH
<Hanmac>
banister: i did wanted to install as much of pry as possible, because i did test one of my newest scripts, it does turn your installed gems into a dot graph
jbwiv has quit [Read error: Connection reset by peer]
<banister>
Hanmac hehe
amundj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<banister>
Hanmac just install them manually then :P
amundj has joined #ruby
amundj has quit [Client Quit]
<banister>
Hanmac i'll get round to fixing it soon, soon as i move onto ruby 2.1+ @ work
Dwarf has joined #ruby
<gaussblurinc1>
jhass: wait-wait, and where load path would be updated to required?
<shevy>
well, playing with the \ can be a bit annoying
<gaussblurinc1>
jhass: and where this file will appear? it should be somewhere at the beginning of compilation/interpretation. so, it should be imported before all
<shevy>
>> x = "vault create '~/Documents/Important\\ Files/' default true"; puts x
perrier has quit [Remote host closed the connection]
<jhass>
SpaceKookieII: build a regex that matches the parts that you want and use .scan
<jhass>
instead of building one that matches the parts you don't want and splitting on them
whyy has joined #ruby
DaniG2k has joined #ruby
perrier has joined #ruby
Neozonz has quit [Ping timeout: 272 seconds]
ferr has quit [Remote host closed the connection]
SilkFox_ has joined #ruby
hamakn has joined #ruby
ferr has joined #ruby
mary5030 has joined #ruby
braincra- has joined #ruby
comma8 has quit [Ping timeout: 260 seconds]
banjara has joined #ruby
<gaussblurinc1>
jhass: it should be very abstract and general to appear at the first place. so, it must appears in every component_module.rb, so, every component_module will loaded it first? so, best place is it put it on the one level with all components (lib/common_header.rb) and include in every component?
<jhass>
gaussblurinc1: "it" the load path modification? no
Zebroid has joined #ruby
sailias has joined #ruby
Ayey_ has quit [Ping timeout: 272 seconds]
whyy has quit [Ping timeout: 260 seconds]
<gaussblurinc1>
jhass: yes and why no?
alexju has quit [Remote host closed the connection]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
gaussblurinc1: you don't have a file that bootstraps your application? That you call to run it? Or a file that is required by all files you call to run your application?
SilkFox_ has quit [Ping timeout: 255 seconds]
banjara has quit [Ping timeout: 240 seconds]
jxf has joined #ruby
joonty has quit [Quit: Leaving]
advorak has joined #ruby
Zebroid has quit [Ping timeout: 256 seconds]
<gaussblurinc1>
jhass: yes, I don't have such file, uh
<SpaceKookieII>
Okay right......
mongag has joined #ruby
<SpaceKookieII>
[\\]\s|[\S] finds all the characters I want but .scan(/[\\]\s|[\S]/) returns them to me character by character....
Grantlyk has quit [Remote host closed the connection]
<SpaceKookieII>
What is that magic before the regex?
o0oo0o has joined #ruby
<jhass>
the regex starts here: scan(/already insde the regex
n1lo_ has joined #ruby
<SpaceKookieII>
Ah right. Well okay what does ?:\\ and the "+" at the end do ?
kevkev_ has quit [Quit: Computer has gone to sleep.]
kaiwren has quit [Quit: kaiwren]
xlogic has joined #ruby
o0oo0o has quit [Client Quit]
<SpaceKookieII>
I would swap the \w for \S because things like "~" can be included in paths but it works :)
<jhass>
mongag: if you want to call it that way (call with . not with :: btw.) you need to define it with def self.prepare_html. If you want it to be available for inclusion and direct call you need to write module_function before it
davedev24_ has joined #ruby
anarang_ has joined #ruby
Neozonz has quit [Ping timeout: 264 seconds]
livingstn has joined #ruby
n1lo has quit [Ping timeout: 240 seconds]
<mongag>
jhass thanks
jayunit100 has joined #ruby
anarang has quit [Ping timeout: 240 seconds]
<Hanmac>
banister: and? did you look at my gemtree script? do you like it? maybe you have questions about the coloration of your installed gems?
Arkaniad|Desktop has quit [Ping timeout: 260 seconds]
qba73 has quit []
hellangel7 has quit [Remote host closed the connection]
DaniG2k has quit [Ping timeout: 264 seconds]
shredding has quit [Quit: shredding]
<gr33n7007h>
apeiros, you are f*cking brilliant :)
<apeiros>
brilliantly, no? but how could you know? have we met? :-p
smooks has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
raparkhurst has quit [Remote host closed the connection]
cocotton has joined #ruby
cocotton has quit [Remote host closed the connection]
<SpaceKookieII>
apeiros: I solved it with this: /(?:\\ |[\S])+/
cocotton has joined #ruby
hellangel7 has joined #ruby
<SpaceKookieII>
But thanks for the help everybody :P I wish my introduction to regex would have been a little bit less difficult but oh well :p
<apeiros>
SpaceKookieII: again, wrapping \S in [] is pointless. [\S] is *identical* to \S
alem0lars has joined #ruby
SilkFox has joined #ruby
abdulsattar has quit [Ping timeout: 255 seconds]
<SpaceKookieII>
Ah thanks, the original had \w\/ but as I replaced \w with \S I could remove the \/. Anyways, thanks
cpruitt has joined #ruby
spastorino has joined #ruby
mijicd has joined #ruby
Zebroid has joined #ruby
<flughafen>
i have a questiona bout this function: http://bpaste.net/show/mjEPoDK2R0Feap9KP7H1/ when I call it, the first argument I pass goes to hostname for some reason instead of command... i had this function working seemingly ok, without the ignore_err, but the way the arguments are being read is weird.
hellangel7 has quit [Remote host closed the connection]
iamjarvo has joined #ruby
arya_ has joined #ruby
dangerou_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex88 has joined #ruby
<flughafen>
when I call it sshcmd(ignore_err = true, "some cmd") host becomes the ignore_err
jottr has joined #ruby
sambao21 has joined #ruby
<flughafen>
do i need to make command = "" and pass command = "/some/cmd"
dangerousdave has joined #ruby
momomomomo has joined #ruby
philcris_ has joined #ruby
axl_ has quit [Quit: axl_]
<drizz>
flughafen: how exactly are you calling sshcmd()?
thomasxie has joined #ruby
<jhass>
flughafen: those are defaults, not named arguments
<jhass>
when you do foo(bar = 'baz') you assign 'baz' to bar. since the assignment is an expressions and it's value is the assigned value, 'baz' also becomes the first argument to the method foo
freerobby has joined #ruby
thomasxie has quit [Remote host closed the connection]
dangerousdave has joined #ruby
<flughafen>
before i added the ignore_err it seemed to work as expected
<jhass>
so essentially you do ignore_err = true; sshcmd(ignore_err, "path/to/bin")
anarang_ has joined #ruby
anarang_ has quit [Read error: Connection reset by peer]
<jhass>
mongag: it passes any given arguments to new and calls execute on the new instance returned by new
<jhass>
the new is the same new that you know from MyClass.new
tobago has quit [Remote host closed the connection]
xlogic has joined #ruby
<mongag>
Can you explain me in a nutshell what's the purpose of that?
<toretore>
MyClass.execute its shorter than MyClass.new.execute
descala has quit [Ping timeout: 250 seconds]
atraylen has joined #ruby
jshultz has joined #ruby
Sid05 has joined #ruby
<jhass>
yeah, just a convenience wrapper
<jamesfordummies>
it's essentially defining a 'static' or 'class' method that does the same thing as the instance version. when called, it creates a throwaway instance to call with
bradleyprice has quit [Remote host closed the connection]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
descala has joined #ruby
jxf has joined #ruby
Ayey_ has joined #ruby
xkami has quit [Remote host closed the connection]
danijoo has quit [Read error: Connection reset by peer]
mlr has joined #ruby
o0oo0o has joined #ruby
danijoo has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
agrinb has joined #ruby
Morkel has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
Morkel_ has joined #ruby
Kricir has joined #ruby
icarus has joined #ruby
bal has quit [Quit: bal]
shredding has joined #ruby
JohnFord has joined #ruby
<Hanmac>
last week i did while driving i did see some cows that looked like they did eat tons of oreo snacks ... head and back was black, but the middle was a wide white ring ... like [black][white][black] ;P
blackoperat has quit []
Dreamer3 has joined #ruby
justinv has quit [Remote host closed the connection]
jprovazn has quit [Quit: Leaving]
Nilium has quit [Ping timeout: 255 seconds]
atmosx has joined #ruby
justinv has joined #ruby
GriffinHeart has joined #ruby
<icarus>
good morning all
razum2um has quit [Quit: Leaving.]
<atmosx>
hello
<atmosx>
it's 18:08 here icarus
mois3x has joined #ruby
cmarques has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
Pharaoh2 has quit [Remote host closed the connection]
Grantlyk has joined #ruby
banjara has joined #ruby
DaniG2k has quit [Quit: leaving]
SilkFox_ has quit [Ping timeout: 244 seconds]
speaking1ode is now known as speakingcode
sambao21 has quit [Quit: Computer has gone to sleep.]
maximski has joined #ruby
Sie00 has quit [Remote host closed the connection]
philcris_ has quit [Remote host closed the connection]
philcris_ has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
sk87 has joined #ruby
Blaze_Boy has quit [Ping timeout: 240 seconds]
maximski has quit [Client Quit]
jmbrown412 has joined #ruby
jamesfordummies has quit [Ping timeout: 240 seconds]
banjara has quit [Ping timeout: 264 seconds]
michaeldeol has joined #ruby
icebourg has joined #ruby
freerobby has quit [Quit: Leaving.]
alexju has quit [Remote host closed the connection]
justinv has quit [Remote host closed the connection]
philcris_ has quit [Ping timeout: 255 seconds]
agrinb_ has joined #ruby
comma8 has joined #ruby
atraylen has joined #ruby
Deele has quit [Ping timeout: 244 seconds]
<icarus>
ah! nvm it is already sold out
sambao21 has joined #ruby
jespada has quit [Ping timeout: 250 seconds]
qba73 has joined #ruby
claymore has quit [Quit: Leaving]
elaptics is now known as elaptics`away
gauke has quit [Quit: gauke]
agrinb has quit [Ping timeout: 245 seconds]
atraylen has quit [Client Quit]
Grantlyk has quit [Remote host closed the connection]
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bricker`LA has quit [Ping timeout: 255 seconds]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chrishough has joined #ruby
Zebroid has quit [Remote host closed the connection]
Grantlyk_ has joined #ruby
Sie00 has joined #ruby
Lexun has joined #ruby
endash has joined #ruby
pandaant has quit [Remote host closed the connection]
atraylen has joined #ruby
mlr has quit [Ping timeout: 245 seconds]
maestrojed has joined #ruby
sergiomiranda has joined #ruby
spyderman4g63 has joined #ruby
justinv has joined #ruby
comma8 has quit [Ping timeout: 250 seconds]
yeticry has quit [Ping timeout: 255 seconds]
mordof_work has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rippa has joined #ruby
bMalum has quit [Quit: Computer has gone to sleep.]
razum2um has joined #ruby
Blaze_Boy has joined #ruby
bMalum has joined #ruby
supermarkettoday has joined #ruby
yeticry has joined #ruby
nfk has joined #ruby
supermarkettoday has quit [Remote host closed the connection]
jespada has joined #ruby
alexju has joined #ruby
agjacome has joined #ruby
freerobby has joined #ruby
kldskp has quit [Quit: Computer has gone to sleep.]
_JamieD_ has joined #ruby
bMalum has quit [Ping timeout: 250 seconds]
agrinb_ has quit [Remote host closed the connection]
gaussblurinc1 has quit [Quit: Leaving.]
larissa has quit [Quit: Leaving]
Pharaoh2 has joined #ruby
doev has quit [Ping timeout: 256 seconds]
<icarus>
hello #ruby
<icarus>
ive got probably a more classic programming problem that im stuck on
renderful has joined #ruby
<icarus>
i basically have a for loop... "for i in array do ..."
clauswitt has joined #ruby
<icarus>
but i have a var in that for loop j that needs to iterate += 1 with each pass inside that for loop
<icarus>
im now sure how to do it
luckyruby has joined #ruby
hgl_ has quit [Quit: Computer has gone to sleep.]
rbartos has joined #ruby
hgl_ has joined #ruby
jdj_dk has joined #ruby
achoom has joined #ruby
agrinb has joined #ruby
achoom_ has joined #ruby
abdulsattar has quit [Ping timeout: 272 seconds]
<Hanmac>
icarus: look at enum.each_with_index
<_JamieD_>
Hi all, firstly I’m not a statistics guy so I’m not familiar with a lot of the terms used. I’m trying to normalize some data but not really sure what I’m doing. I have a number of users, each user has a certain number of likes, currently the user with the most number of likes has 228951 likes. What I want to do is give each user a score between 0-20 based on how many likes they have. I don’t know the total number of
<_JamieD_>
users. What would be the best way to caluculate this score and is there a gem that could help me out? I’ve search but not found anything, but that may be because I don’t know the correct term to search for. Thanks
itspots has joined #ruby
itspots has quit [Changing host]
itspots has joined #ruby
Xeago has quit [Remote host closed the connection]
cocotton has quit [Remote host closed the connection]
jonahR has joined #ruby
lmickh has joined #ruby
kevind has joined #ruby
max06 has quit [Quit: Leaving.]
<icarus>
Hanmac: thanks for the tip, checking it out
<apeiros>
_JamieD_: I doubt that there's a gem for for something like that
gauravagarwalr has quit []
justinv has quit [Remote host closed the connection]
zkay11 has joined #ruby
<apeiros>
_JamieD_: so that score should be relative to the other users? like 0 == the least likes, 20 == the most likes?
<Hanmac>
_JamieD_: depends, is the score depending on the one with the most likes? or on lables like 10.000 50.000 and so on, does the score marks are going liniar with equal sections, or expotential with growing sections? ...
agrinb has quit [Read error: Connection reset by peer]
hgl_ has quit [Ping timeout: 256 seconds]
<_JamieD_>
I thought there probably wouldn’t be a gem, but you never know unless you ask :)
agrinb has joined #ruby
<Hanmac>
i wouldnt be much suprised if there is a rails function for that
maestrojed has quit [Quit: Computer has gone to sleep.]
<_JamieD_>
it will probably have to be non liniar as the user with the most likes will increase over time. 0 == no likes and I would think no user would have a score of 20
patrick99e99 has joined #ruby
havenwood has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
<_JamieD_>
although the person with the most likes would be close to 20
agrinb has quit [Read error: Connection reset by peer]
<apeiros>
(likes / max_likes) * 20
ghostmoth has joined #ruby
james has joined #ruby
freerobby has quit [Quit: Leaving.]
agrinb has joined #ruby
<apeiros>
that'll give you a linear score with 0 likes = score of 0
iamjarvo has joined #ruby
james is now known as Guest55167
<Mon_Ouie>
Although if you place parentheses like this with an integer as an amount of likes, you'd always get 0 or 20
Zenigor has quit [Remote host closed the connection]
LekeFly has quit [Ping timeout: 244 seconds]
<apeiros>
Mon_Ouie: Mon_Bot is gone, right? So I can repurpose the instance?
<Mon_Ouie>
apeiros: Yup ;)
<apeiros>
nice
<Hanmac>
apeiros: charliesome again
<apeiros>
Mon_Ouie: it was a whooping $1.70 :D
<Hanmac>
nice ... then it was more worth than most politicans ;P
<apeiros>
_JamieD_: note that you can let the DB perform the calculation
<charliesome>
apeiros: if you wanted to sponsor a second evaluator machine for eval.in i wouldn't be opposed :p
<apeiros>
_JamieD_: it's most likely faster at it than you using ruby
<mordof_work>
aahhh wordml why does it have to suck so much x.x;;;
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
Morkel_ has quit [Quit: Morkel_]
gaussblurinc1 has joined #ruby
patrick99e99 has quit [Ping timeout: 244 seconds]
DreamingRainne has joined #ruby
iamjarvo has quit [Client Quit]
<_JamieD_>
I think I’ll need to weight it so that, for example, 5 users with likes of 0, 10, 50, 100, 5000 would produce scores out of 20 something similar to 0, 5, 10, 14, 18, something along those lines
cocotton has joined #ruby
<apeiros>
mordof_work: what's wordml?
cocotton has quit [Remote host closed the connection]
<mordof_work>
apeiros: the inner workings of an Office Word document
<apeiros>
_JamieD_: I think you should make up your mind then and ask again when you know what you want :-p
cocotton has joined #ruby
<apeiros>
mordof_work: aaaahahahahahaha, you poor sould :D
<apeiros>
*soul
nfk has quit [Ping timeout: 240 seconds]
SegFaultAX has quit [Excess Flood]
<mordof_work>
apeiros: current task is to add a bit of content to our Word report generator, and i'm "corrupting the file" and am trying to figure out why it's seeing it as corrupted.. haha.. i know right
<mordof_work>
so bad
abdulsattar has joined #ruby
SegFaultAX has joined #ruby
InfraRuby has left #ruby [#ruby]
qba73 has quit []
<apeiros>
mordof_work: can't use ODF?
<mordof_work>
apeiros: nope
<_JamieD_>
apeiros: my mind is made up now, as the example :)
goshdarnyou has joined #ruby
Lexun has quit [Quit: Manjaro-KDE user leaving!]
dru_ is now known as dru
Doc_X has quit [Quit: 0.4.3]
top4o has joined #ruby
<_JamieD_>
If only I could remember everything from back in school math class I’d be fine
agrinb has quit [Remote host closed the connection]
Grantlyk_ has quit [Remote host closed the connection]
<apeiros>
I have to admit that I totally don't understand your example
seamon has joined #ruby
<apeiros>
but I have to commute now anyway :)
<DreamingRainne>
_JamieD_: Well, I only showed up in time to see the 0/10/50/100/500 thing translate to 0/5/10/14/18, but that looks like a logarithmic scale to me. Like, 5*log10(n) type stuff.
<mordof_work>
apeiros: i don't mind doing stuff like this.. it's just tedious to try and find the problem when all word gives me is "The file is corrupted. Would you like to repair?" lol
* mordof_work
pulls some of his hair out
agrinb has joined #ruby
maximski has joined #ruby
duper` has joined #ruby
<apeiros>
mordof_work: have fun ;-)
<mordof_work>
haha, i shall.
dukedave has left #ruby [#ruby]
troyready has joined #ruby
duper has quit [Ping timeout: 256 seconds]
larsam has joined #ruby
Blaze_Boy has quit [Quit: Leaving]
jdj_dk has quit [Ping timeout: 250 seconds]
nfk has joined #ruby
nfk has quit [Read error: Connection reset by peer]
Spami has quit [Quit: This computer has gone to sleep]
Doc_X has joined #ruby
apeiros has quit [Remote host closed the connection]
cocotton has quit [Read error: Connection reset by peer]
<_JamieD_>
DreamingRainne: that sounds like it could be. when I have a score of 1, the value 1 unit is comparatively large. When I have a score 5000 the value of 1 unit is comparatively small. Is that the kind of thing?
apeiros has joined #ruby
cocotton has joined #ruby
shredding has quit [Quit: shredding]
<DreamingRainne>
Well, 5*log10(n) would translate 10, 100, 1000, 10000 to 5, 10, 15, 20. x10 in the left set = +5 in the right set.
amacou has quit [Remote host closed the connection]
Lexun has joined #ruby
pietr0 has joined #ruby
livingstn has quit []
toastynerd has joined #ruby
agrinb has quit [Ping timeout: 250 seconds]
<icarus>
Hanmac: woohoo!
<icarus>
worked great
<icarus>
thanks a lot
michaeldeol has joined #ruby
<DreamingRainne>
Reduces an exponential scale to a linear scale, more tangible. Multiplication to addition.
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
nfk has joined #ruby
<_JamieD_>
is that what you suggested initially?
<workmad3>
_JamieD_: that's a logarithmic graph
mattstratton has joined #ruby
<DreamingRainne>
Looks like log5(n), since 5 -> 1
Grantlyk has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
<DreamingRainne>
However, the out won't max out at 1.0 unless the inputs max out at 5. After all, 25 (5^2) -> 2
namxam has quit []
<Mon_Ouie>
Not sure that's a log function. You said you wanted results out of 20, so I assume you don't want any n that gives a result greater than 20?
klaut has quit [Remote host closed the connection]
<DreamingRainne>
But that looks like the general sort of thing you're going for; where you have to add more and more to the input in order to produce the same change in the output. Like accelerating experience-point requirements in RPGs.
<Mon_Ouie>
i.e. there should be a horizontal asymptote at score = 20
<_JamieD_>
ah great, I am not great at the math/stats side of things so I get totally lost with all the terms
kevind has quit [Quit: kevind]
Zenigor has joined #ruby
<workmad3>
Mon_Ouie: heh :) I was about to mutter vague stuff about treating 20 as infinity :)
alex88 has quit [Quit: Leaving...]
klaut has joined #ruby
* DreamingRainne
familiarized herself with log scales like that when working with tabletop-RPG stuff a while back. Hehe.
sambao21 has quit [Quit: Computer has gone to sleep.]
<workmad3>
Mon_Ouie: which would have been the wrong terms :)
SegFaultAX has quit [Excess Flood]
<DreamingRainne>
As for asymptotic things, well, only an input of Infinity will map fully to 1.0, on any scale that maxes out at 1.0.
<_JamieD_>
Mon_Ouie: yes thats correct, no result greater than 20
SegFaultAX has joined #ruby
<workmad3>
_JamieD_: do you want the values to change based on the current max though?
timonv_ has quit [Remote host closed the connection]
<DreamingRainne>
Or to 20.0, whatever scale you're using. Only max input -> max output, and only Infinity is a max input.
bricker`work has joined #ruby
<_JamieD_>
workmad3: yes it will need to change based on the current max
freerobby has joined #ruby
<DreamingRainne>
What's the purpose of all this, anyway? Like, *is* it an experience-point thing? Or what?
<workmad3>
_JamieD_: so if you had 1,2,3,4,5, that should be 4,8,12,16,20, but 1,20,50,100,200 should be 0.1, 2, 5, 10 and 20?
<Mon_Ouie>
You could have something like 20*(1 - e^(-t/τ))
<Mon_Ouie>
That's equal to 0 for t = 0 and grows closer and closer to 20 without ever quite reaching it (but if you use #round, you will get values equal to 20 at some point)
<workmad3>
DreamingRainne: yeah, I'm trying to get whether he wants normalised linear scaling or something else (I'm guessing something else by current descriptions, but just double-checking) :)
<DreamingRainne>
Well, he's been linking to curved graphs; yours simply turns one line into another.
phinfonet has quit []
codecop has quit [Remote host closed the connection]
klaut has quit [Ping timeout: 260 seconds]
codecop has joined #ruby
InfraRuby has joined #ruby
closer has quit [Ping timeout: 272 seconds]
agrinb has joined #ruby
SilkFox_ has joined #ruby
<_JamieD_>
so what I’m trying to do is give each user a score out of 100 (could be any max I guess but 100 seemed sensible). There are a number of metrics I’m using to build the over all score, some boolean, some numeric. So for instance, if a user has a website address they get 5 points or 0 if not. Then for the likes they can get a score between 0-20 based on how many likes. There are a number of different metrics all of which are
<_JamieD_>
these 2 types. A perfect score would be 100, although no use would ever have a perfect score due to using a non-linear curve. Does that make sense?
<_JamieD_>
I may be going about this in totally the wrong way though
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<DreamingRainne>
Well, if users can theoretically max out all their input scores, I think it should be reflected by getting a max output score, the full 100.
maestrojed has joined #ruby
<DreamingRainne>
Maybe representing the output as a percentage. Like, you've got 40% of all the points you could be getting.
theharshest has joined #ruby
<workmad3>
_JamieD_: yeah, I'd go with DreamingRainne here... and also add the suggestion that non-linear metrics in a user-scoring system would probably confuse and annoy users
closer has joined #ruby
<DreamingRainne>
Then you get a Platinum Trophy when you hit 100%. Hehe.
agrinb has quit [Client Quit]
patrick99e99 has joined #ruby
<_JamieD_>
ok, sounds like a sensible idea
<DreamingRainne>
Mmhmm. If you do something that turns 5% completion to 6%, it should also turn 95% completion to 96%. (Rounding notwithstanding.)
<DreamingRainne>
As opposed to like, adding 10 if you do it early but 1 if you do it late.
<_JamieD_>
although these scores would never be seen by users, it’s gong to be just a way of ranking them
<workmad3>
_JamieD_: for something unbounded, like counting 'likes', you could consider something like awarding points based on their percentile rank
theharshest has quit [Client Quit]
banjara has joined #ruby
<DreamingRainne>
Well, if it's just for comparing one to another, there's no reason not to use a linear scale, or even map them down internally. Rather than having to translate an input score into an output comparator, just compare the input scores directly, no function needed.
SilkFox_ has quit [Ping timeout: 240 seconds]
gaussblurinc1 has quit [Quit: Leaving.]
<DreamingRainne>
Whether you use n or log(n), if input1 > input2, then output1 > output2.
<_JamieD_>
workmad3: percentile’s have always confused me, along with all the other maths stuff for that matter :)
<workmad3>
DreamingRainne: I'd guess some level of normalisation would still be needed
BBBThunda has joined #ruby
bradleyprice has joined #ruby
<DreamingRainne>
Actually, using a log(n) scale for n likes sounds like a good idea. Like, you get another 10 points every time it doubles, or something.
<workmad3>
_JamieD_: percentiles are easy... they're percentages on a population ;) so the top 1 percentile of likes would be the 10 users with the most likes out of 1000
<_JamieD_>
DreamingRainne: I’m not sure comparing them directly would work. I want certain things to have more weighting than others
Lexun has quit [Ping timeout: 256 seconds]
zz_anildigital is now known as anildigital
<DreamingRainne>
After all, a big popular site probably gets lots of new likes, but a new site will notice one more like.
banjara has quit [Read error: Connection reset by peer]
<workmad3>
_JamieD_: (i.e. 1000 users, top 10 likes are the 1st percentile)
banjara has joined #ruby
<_JamieD_>
workmad3: ash, trouble is I don’t know the total number of users
Takle_ has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<workmad3>
_JamieD_: you'll know the number of users when calculating the metric though, right?
<workmad3>
_JamieD_: or rather, your algorithm will?
saarinen has joined #ruby
poguez_ has joined #ruby
<_JamieD_>
nope, they will come in via external api queries in batches, I’ll never know the total number of users available
theharshest has joined #ruby
banister has joined #ruby
ryanleesipes has joined #ruby
SCHAAP137 has joined #ruby
<workmad3>
_JamieD_: ok... I'd go with DreamingRainne then and use a log scale for something unbounded, so you can slow the rate of point acquisition from there
<_JamieD_>
and I want to avoid recalculating a users score when other factors unrelated to that user change
<DreamingRainne>
Yeah, it shouldn't have to read the entire database to update one user.
<workmad3>
_JamieD_: you'd end up with a potentially unbounded total score though... but again, if you don't want to recalculate scores that would probably make sense anyway
comma8 has joined #ruby
lkba has quit [Read error: Connection reset by peer]
<DreamingRainne>
Well, something like log10(n) will put a practical cap on things. After all, there's only 7 billion people in the world, log10 of which is around 9.8 or so.
<DreamingRainne>
(10 billion happens to have 10 zeroes on it, so its log10 = 10)
ssvo has joined #ruby
<DreamingRainne>
You'd only get to 11 there by having the equivalent of 10 Earths.
<DreamingRainne>
So there's still a practical upper limit, and it still (by definition!) grows exponentially beyond that.
<workmad3>
DreamingRainne: future-proofed!
cocotton has quit [Remote host closed the connection]
<Mon_Ouie>
What if we start communicating with the Intergalactic Superempire?
cocotton has joined #ruby
<DreamingRainne>
log10( every IPv6 address, which is 2^128 ) = 38.5.
<workmad3>
DreamingRainne: and sounds like what _JamieD_ wanted too, now I re-read it... first 10 like (say) get you more points than the next 10... and if you have 5000 likes, 10 more gets you very little in terms of extra ranking
kldskp has joined #ruby
<DreamingRainne>
And there's enough IPv6 addresses for every atom on Earth to have 40000 of them.
<DreamingRainne>
So, in theory, it's unbounded. In practice, no need to worry. Hehe.
<_JamieD_>
workmad3: yes that’s exactly it
banjara has quit [Quit: Leaving.]
maestrojed has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie>
The inverse exponential also works that way though (and is bounded)
<DreamingRainne>
Sounds like a perfect application of log scales.
banjara has joined #ruby
jdj_dk has joined #ruby
octoberry has quit [Ping timeout: 260 seconds]
comma8 has quit [Ping timeout: 250 seconds]
cocotton_ has joined #ruby
<DreamingRainne>
Doesn't necessarily have to be log10, it could be log2 or log5.7 or whatever. Point is that it's still a log scale.
cocotton has quit [Read error: Connection reset by peer]
darkxploit has joined #ruby
Grantlyk has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
nitin_ has joined #ruby
nitin_ has quit [Read error: Connection reset by peer]
mlr has joined #ruby
<DreamingRainne>
You can figure out the parameters you want by thinking about an example change and the results you'd like to see from that.
<Mon_Ouie>
I mean 1 - e^-x
<DreamingRainne>
Like, if a site goes from 100 to 200 likes, how many more points should it get? Or from 100 to 1000?
<workmad3>
DreamingRainne: I'd have figured it out from 'how many likes == 1 point' personally
<DreamingRainne>
Like, if 100->200 likes should result in 5 more points, that's 5*log2(n)
<_JamieD_>
what would be an appropriate log to use? My mind is trying to get around what these methods actually do still. For instance, I have likes and a comments count. I want likes to have twice as much weighting as comments
darkxploit has joined #ruby
<DreamingRainne>
The other, if 100->1000 should result in 5 more points, that's 5*log10(n)
nitin_ has joined #ruby
<DreamingRainne>
In either case, 1 like = 5 points, in those examples.
sambao21 has quit [Quit: Computer has gone to sleep.]
<workmad3>
_JamieD_: what do you want x to be? :)
<DreamingRainne>
Er, N likes = 5 points, rather, where you're doing 5*logN(n)
<Mon_Ouie>
_JamieD_: log is the inverse of exponentiation. If y = 10^x, log10(y) = x
alem0lars has quit [Quit: Going AFK...]
nitin_ has quit [Client Quit]
<workmad3>
_JamieD_: or was that the other way around? :)
phutchins has joined #ruby
<Mon_Ouie>
(e.g. log10(100) = 2, log10(0) = 1)
<DreamingRainne>
_JamieD_: Yeah, just do something like n = likes * (comments/2)
wallerdev has joined #ruby
darkxploit has quit [Max SendQ exceeded]
chipotle has joined #ruby
<_JamieD_>
DreamingRainne: yes, that makes sense
apeiros has joined #ruby
<DreamingRainne>
Or maybe "number of distinct commenters" rather than "number of comments". A 100-post Internet Argument between 2 people != 100 people each posting 1 comment.
aspires has joined #ruby
InfraRuby has left #ruby [#ruby]
<workmad3>
DreamingRainne: yeah... the argument is probably more worthwhile to read
<DreamingRainne>
You know how comment sections can get sometimes. Hehe.
darkxploit has joined #ruby
<workmad3>
DreamingRainne: than 100 '+1' comments :)
atmosx has quit [Ping timeout: 240 seconds]
<_JamieD_>
what are the bounds of what logX returns, is it 0-infinity?
mikecmpbll has quit [Ping timeout: 260 seconds]
<DreamingRainne>
It's unbounded, but you only get infinity out for infinity in.
mlr has quit [Ping timeout: 255 seconds]
<workmad3>
_JamieD_: log of N < 1 is < 0
<DreamingRainne>
There's something like 10^80 particles in the observeable universe, so if every single one of those posted a comment on your blog, log10 will turn that into a plain old 80.
Wolland has joined #ruby
<DreamingRainne>
Every particle from 10 universes would result in... 81.
MartinCleaver has quit [Quit: MartinCleaver]
abdulsattar has quit [Remote host closed the connection]
<DreamingRainne>
A million universes would result in... 86.
<DreamingRainne>
That's how logarithms roll!
banjara has quit [Quit: Leaving.]
darkxploit has quit [Max SendQ exceeded]
<workmad3>
_JamieD_: the point DreamingRainne is making is that while *theoretically* a log could go to infinity as the parameter increases, practically it'll be bounded at some sensible limit for the range of values you could feed it
renderful has quit [Remote host closed the connection]
timonv_ has joined #ruby
<_JamieD_>
ok, so that works for all the metrics where the input is a number. How would I combine these with the metrics where the input is a boolean. So for instance is the user has a website url the get 10 points, on the old scale assuming the max for a user is 100. If the likes score becomes too high it starts the diminish the value of the website score.
renderful has joined #ruby
darkxploit has joined #ruby
<DreamingRainne>
Mmhmm. If you use log2 rather than log10, multiply those numbers by log2(10) = 3.3ish = around 250ish. Maybe fit that in a byte.
<workmad3>
_JamieD_: that's kinda taken care of with the way log works too ;)
ki0_ has quit [Remote host closed the connection]
<workmad3>
_JamieD_: for example, if you chose a plain log10 function, someone with 10 likes would get 1 point... 100 likes would get 2 points, 1000 likes would get 3 points
aaronrl has joined #ruby
<DreamingRainne>
Yep. Something like 10*log2(n) should work fine there.
ghr has quit [Ping timeout: 256 seconds]
<DreamingRainne>
1 will give you 10. I think.
<workmad3>
DreamingRainne: isn't that log10? ;)
<DreamingRainne>
Er, 0 rather. 2 will give you 10.
Wolland has quit [Ping timeout: 244 seconds]
<workmad3>
ah wait, I'm mis-remembering log base conversions
<DreamingRainne>
No, 10*log2 means you get another 10 every time the underlying value doubles.
<DreamingRainne>
It's a constant factor difference from any other X*logY combination, though.
<banister>
workmad3 hey, when do delayed jobs get deleted?
<DreamingRainne>
The decibel scale is 10*log10.
<workmad3>
banister: err... pass?
darkxploit has quit [Max SendQ exceeded]
<workmad3>
banister: depends on the queue system, I'd guess
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<banister>
workmad3 i mean after they fail X number of times are they auto deleted or sth?
mikepack has quit [Remote host closed the connection]
lkba has joined #ruby
<workmad3>
banister: depends on the queue & worker system
<workmad3>
banister: I'd hope that after X fails they get put into a dead-letter queue rather than deleted though
wallerdev has quit [Quit: wallerdev]
<DreamingRainne>
Multiply input by X to add Y to the output = Y*logX(input)
darkxploit has joined #ruby
<workmad3>
banister: but many delayed job libraries are bad regarding throwing away data :)
renderful has quit [Ping timeout: 260 seconds]
coldkey21 has joined #ruby
<_JamieD_>
ok, I think I have a handle on this now :) I’m going to try plumbing this all together and see what results it spits out. Thank you very much DreamingRainne and workmad3 you have been very helpful
maximski has quit []
timonv^ has joined #ruby
<DreamingRainne>
I think Math has built-in log2 and log10. You can get any arbitrary base with: logX(n) = log(n)/log(X) for any base, and there's definitely a plain Math.log().
<apeiros>
still on the like-score-mechanics?
LekeFly has joined #ruby
seamon has quit [Quit: Zzzzzzz]
lkba has quit [Read error: Connection reset by peer]
<workmad3>
DreamingRainne: Math.log is ln
LekeFly has quit [Client Quit]
lkba has joined #ruby
coldkey21 has quit [Client Quit]
waltertv has joined #ruby
<_JamieD_>
apeiros: yes, although we have it figured out now I think
<godd2>
Is class << foo; def my_method; end; end any different from def foo.my_method; end ?
coldkey21 has joined #ruby
deric_skibotn has joined #ruby
bMalum has joined #ruby
chth0n has quit [Ping timeout: 250 seconds]
Kricir has quit [Remote host closed the connection]
* apeiros
wishes Math.log's signature was log(operand, base=Math::E)
<apeiros>
godd2: no
<apeiros>
godd2: the latter is easier to grep, which is why I prefer it
<apeiros>
(for class methods, that is)
darkxploit has quit [Max SendQ exceeded]
Takle has joined #ruby
<workmad3>
apeiros: that would be nice (on the log front)
<godd2>
what's the purpose of class << foo then?
Wolland has joined #ruby
jdj_dk has quit [Ping timeout: 250 seconds]
wjimenez_5271 has joined #ruby
chipotle has quit [Ping timeout: 240 seconds]
<apeiros>
godd2: opening the singleton class
Macacity has joined #ruby
<workmad3>
godd2: sometimes you want to do other things in the singleton class than just defining methods
<godd2>
aaahhhhhhh
darkxploit has joined #ruby
<apeiros>
examples for workmad3's claim: alias methods, use meta-programming stuff like attr_*
timonv_ has quit [Ping timeout: 272 seconds]
jxf has quit [Quit: Leaving]
seamon has joined #ruby
vyorkin has quit [Ping timeout: 264 seconds]
sambao21 has joined #ruby
W0rmDr1nk has quit [Ping timeout: 250 seconds]
AndChat| has joined #ruby
renderful has joined #ruby
darkxploit has quit [Max SendQ exceeded]
lkba has quit [Ping timeout: 240 seconds]
olivier_bK has quit [Ping timeout: 255 seconds]
baroquebobcat has joined #ruby
darkxploit has joined #ruby
phoo1234567 has quit [Quit: Leaving]
chipotle has joined #ruby
afhammad has quit []
silentpost has joined #ruby
seamon has quit [Client Quit]
seamon has joined #ruby
seamon has quit [Client Quit]
darkxploit has quit [Max SendQ exceeded]
Ankhers has quit [Ping timeout: 264 seconds]
darkxploit has joined #ruby
kaspergrubbe_ has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
freerobby has quit [Ping timeout: 255 seconds]
ascarter has joined #ruby
phoo1234567 has joined #ruby
freerobby1 has joined #ruby
phoo1234567 has quit [Max SendQ exceeded]
Kricir has joined #ruby
phoo1234567 has joined #ruby
darkxploit has quit [Max SendQ exceeded]
threesixes has joined #ruby
mikecmpbll has joined #ruby
waltertv has quit [Quit: Leaving...]
darkxploit has joined #ruby
<shevy>
at work I am overwhelmed with python
rbartos has quit [Remote host closed the connection]
<DreamingRainne>
Or just as a shortcut for defining a lot of foo.xyz methods all together.
<DreamingRainne>
class << self within a (normal) class can do that for class methods. class Herp; class << self; def derp;... def lol;... def wut;... (defines Herp.derp, Herp.lol, Herp.wut)
JohnFord has joined #ruby
seamon has joined #ruby
seamon has quit [Client Quit]
seamon has joined #ruby
wallerdev has joined #ruby
darkxploit has quit [Max SendQ exceeded]
seamon has quit [Client Quit]
darkxploit has joined #ruby
seamon has joined #ruby
philcris_ has joined #ruby
gtrak has quit [Ping timeout: 264 seconds]
zarul has quit [Ping timeout: 255 seconds]
seamon has quit [Client Quit]
top4o has quit [Quit: ChatZilla 0.9.90.1 [Firefox 30.0/20140605174243]]
krisquigley has joined #ruby
gtrak has joined #ruby
seamon has joined #ruby
<godd2>
Is it accurate to say that when you create an instance of a class, you're -really- creating a eigenclass that inherits from the class you instantiated?
hellangel7 has joined #ruby
<DreamingRainne>
Maybe. Or that when you attach methods to it later on, you're creating a one-off subclass and changing the object to be an instance of it.
<apeiros>
godd2: nope
darkxploit has quit [Max SendQ exceeded]
maximski has joined #ruby
<apeiros>
godd2: singleton_class only gets created "on demand"
cocotton_ has quit [Remote host closed the connection]
<apeiros>
objects which don't need one don't have one
maximski has quit [Max SendQ exceeded]
cocotton has joined #ruby
darkxploit has joined #ruby
<apeiros>
but the object's singleton_class indeed is considered a subclass of the object's class
maximski has joined #ruby
<apeiros>
>> class Foo; end; x = Foo.new; x.singleton_class < Foo
<godd2>
haha, well I don't fully understand yet. I'm reading Metaprogramming Ruby
<apeiros>
as said - distinct objects
nanoyak has joined #ruby
<apeiros>
also, dog.superclass # will fail to work because dog isn't a class
darkxploit has joined #ruby
Sawbones has joined #ruby
charliesome has joined #ruby
<godd2>
yea but dog.singleton_class is a class
Brando753 has quit [Ping timeout: 260 seconds]
Sie00 has quit [Remote host closed the connection]
jdj_dk has joined #ruby
Mon_Ouie has quit [Ping timeout: 250 seconds]
<godd2>
so dog.singleton_class.superclass is Dog
<apeiros>
yes
ch077179 has joined #ruby
sk87 has quit [Client Quit]
InfraRuby has joined #ruby
<apeiros>
which fits the lookup chain
endash has joined #ruby
maestrojed has joined #ruby
<apeiros>
dog.singleton_class.ancestors is which classes are searched for a method you call on dog
SegFaultAX has quit [Excess Flood]
Brando753 has joined #ruby
<godd2>
apparently you can't subclass a singleton class. I guess that's one difference
timonv^ has quit [Remote host closed the connection]
Rahul_Roy has quit [Quit: Connection closed for inactivity]
<godd2>
Well I'll keep reading, thanks for the input
Ch0c0late has joined #ruby
SegFaultAX has joined #ruby
SilkFox_ has joined #ruby
darkxploit has quit [Max SendQ exceeded]
troulouliou_dev has quit [Quit: Leaving]
kaspergrubbe_ has joined #ruby
darkxploit has joined #ruby
zarul has joined #ruby
seamon has quit [Quit: Bye]
arup_r has joined #ruby
seamon has joined #ruby
sputnik13 has joined #ruby
wallerdev_ has joined #ruby
wallerdev has quit [Ping timeout: 260 seconds]
wallerdev_ is now known as wallerdev
sambao21 has quit [Quit: Computer has gone to sleep.]
yekta has joined #ruby
justinv has joined #ruby
dangerousdave has joined #ruby
sambao21 has joined #ruby
darkxploit has quit [Max SendQ exceeded]
SilkFox_ has quit [Ping timeout: 255 seconds]
darkxploit has joined #ruby
Spami_ has joined #ruby
Spami has quit [Ping timeout: 244 seconds]
Kricir has quit [Remote host closed the connection]
tyfighter has joined #ruby
wallerdev has quit [Ping timeout: 244 seconds]
<shevy>
did you guys know that there exists Complex in ruby?
wallerdev has joined #ruby
johnmolina has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
atraylen has quit [Ping timeout: 240 seconds]
darkxploit has joined #ruby
Kricir has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kricir has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 272 seconds]
<Hanmac>
shevy yeah i know, did you know it was stdlib before it was merged into core ruby?
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
craigbowen3 has joined #ruby
x1337807x has joined #ruby
chrishough has quit [Quit: chrishough]
darkxploit has quit [Max SendQ exceeded]
seamon has quit [Quit: Zzzzzzz]
jdj_dk has quit [Ping timeout: 240 seconds]
darkxploit has joined #ruby
mlr has joined #ruby
jay___ has joined #ruby
InfraRuby has left #ruby [#ruby]
jay___ is now known as rubyonrailed
mattmcclure has joined #ruby
doev has joined #ruby
Kricir has joined #ruby
seamon has joined #ruby
darkxploit has quit [Max SendQ exceeded]
graft__ has quit [Ping timeout: 255 seconds]
Ch0c0late has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkxploit has joined #ruby
JoshGlzBrk has joined #ruby
endash has quit [Ping timeout: 240 seconds]
danijoo has quit [Read error: Connection reset by peer]
mlr has quit [Ping timeout: 272 seconds]
danijoo has joined #ruby
sk87 has joined #ruby
darkxploit has quit [Max SendQ exceeded]
krisquigley has quit [Remote host closed the connection]
telling has joined #ruby
telling has joined #ruby
darkxploit has joined #ruby
havenwood has quit [Remote host closed the connection]
sk87 has quit [Client Quit]
mijicd has quit [Remote host closed the connection]
closer has quit [Ping timeout: 252 seconds]
telling has left #ruby [#ruby]
closer has joined #ruby
kldskp has quit [Quit: Computer has gone to sleep.]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamesfordummies has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
darkxploit has joined #ruby
iamjarvo has joined #ruby
lmickh_ has joined #ruby
lmickh has quit [Ping timeout: 272 seconds]
AndChat| has quit [Ping timeout: 240 seconds]
ch077179 has quit [Quit: Ex-Chat]
AlSquire has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
kenneth has joined #ruby
kenneth has quit [Max SendQ exceeded]
kenneth has joined #ruby
kenneth has quit [Max SendQ exceeded]
darkxploit has quit [Max SendQ exceeded]
nfk has quit [Quit: yawn]
kenneth has joined #ruby
darkxploit has joined #ruby
chrishough has joined #ruby
gtrak has quit [Quit: No Ping reply in 180 seconds.]
relix has joined #ruby
endash has joined #ruby
gtrak has joined #ruby
bradleyprice has quit [Read error: Connection reset by peer]
darkxploit has quit [Max SendQ exceeded]
Xeago has joined #ruby
chipotle has quit [Quit: cya]
mn_ has joined #ruby
livingstn has quit [Ping timeout: 256 seconds]
darkxploit has joined #ruby
dumdedum has quit [Ping timeout: 245 seconds]
rbartos has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
mn_ has quit [Quit: leaving]
rbartos has joined #ruby
banister has quit [Read error: Connection reset by peer]
maximski has quit []
ryanleesipes has quit [Quit: Leaving]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
livingstn has joined #ruby
banister has joined #ruby
darkxploit has quit [Max SendQ exceeded]
justinv_ has joined #ruby
banister has quit [Max SendQ exceeded]
nfk has joined #ruby
jdj_dk has joined #ruby
Mon_Ouie has joined #ruby
timonv_ has joined #ruby
terrell_t has joined #ruby
banister has joined #ruby
darkxploit has joined #ruby
justinv has quit [Ping timeout: 240 seconds]
rdark has quit [Quit: leaving]
St_Marx has joined #ruby
bradleyprice has joined #ruby
vt102 has joined #ruby
terrellt has quit [Ping timeout: 240 seconds]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkxploit has quit [Max SendQ exceeded]
darkxploit has joined #ruby
bmurt has quit []
mlr has joined #ruby
jxf has joined #ruby
Rahul_Roy has joined #ruby
bronson has joined #ruby
mikepack has joined #ruby
reset has joined #ruby
michaeldeol has quit [Read error: Connection reset by peer]
darkxploit has quit [Max SendQ exceeded]
michaeldeol has joined #ruby
goshdarnyou has quit [Quit: Connection closed for inactivity]
damien has quit [Quit: Leaving]
darkxploit has joined #ruby
bmurt has joined #ruby
bmurt has quit [Max SendQ exceeded]
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
InfraRuby has joined #ruby
asdasdasdasss has joined #ruby
arya_ has quit [Ping timeout: 244 seconds]
bmurt has joined #ruby
ghr has joined #ruby
ascarter has quit [Ping timeout: 244 seconds]
davispuh has quit [Remote host closed the connection]
mlr has quit [Ping timeout: 250 seconds]
icebourg has quit [Read error: Connection reset by peer]
terrell_t has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
ascarter has joined #ruby
icebourg has joined #ruby
ascarter has quit [Max SendQ exceeded]
terrellt has joined #ruby
smooks has joined #ruby
darkxploit has joined #ruby
djbkd has joined #ruby
krisquigley has joined #ruby
Hobogrammer has joined #ruby
ascarter has joined #ruby
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby
jdj_dk has quit [Ping timeout: 240 seconds]
vyorkin has joined #ruby
bronson has quit [Quit: bronson]
timonv_ has quit [Remote host closed the connection]
InfraRuby has left #ruby [#ruby]
ghr has quit [Ping timeout: 272 seconds]
LiohAu has quit [Quit: LiohAu]
rubyonrailed has quit []
yfeldblum has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
skaflem has quit [Read error: Connection reset by peer]
sambao21 has joined #ruby
darkxploit has joined #ruby
dangerousdave has joined #ruby
skaflem has joined #ruby
yetanotherdave has joined #ruby
SilkFox_ has joined #ruby
razum2um has quit [Quit: Leaving.]
jamesfordummies has joined #ruby
ta has joined #ruby
cajone has quit [Remote host closed the connection]
wackobobby has joined #ruby
darkxploit has quit [Max SendQ exceeded]
lw has quit [Quit: s]
<wackobobby>
is there a difference between def method_name and def self.method_name?
jottr has joined #ruby
<dangerousdave>
wackobobby, yes, the latter is a class method
darkxploit has joined #ruby
<dangerousdave>
the former is an instance method
patrick99e99 has quit [Quit: leaving]
AntelopeSalad has quit [Read error: Connection reset by peer]
<Mon_Ouie>
Specifically, the latter defines a method on what self currently is
W0rmDr1nk has joined #ruby
<Mon_Ouie>
self doesn't have to be a class
AntelopeSalad has joined #ruby
alexju has quit [Ping timeout: 240 seconds]
cschneid has quit [Ping timeout: 240 seconds]
patrick99e99 has joined #ruby
<wackobobby>
Got it. So if I had a class "Bob" with def self.name then I can just call Bob.name directly and it'll return my value. Whereas if I use "def name", I have to Bob.new.name, right?
SilkFox_ has quit [Ping timeout: 240 seconds]
<jamesfordummies>
yep
cajone has joined #ruby
<eam>
wackobobby: you can also write def Bob.name
<Mon_Ouie>
And the former defines an instance method in whatever the current "definee" is (the inner class/module definition or receiver of class_eval)
CaptainJet has joined #ruby
cschneid has joined #ruby
sambao21 has quit [Ping timeout: 250 seconds]
seamon has quit [Quit: Zzzzzzz]
krisquigley has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
alexju has joined #ruby
darkxploit has joined #ruby
Eiam has joined #ruby
Akagi201_ has quit [Remote host closed the connection]
Kricir has joined #ruby
blueOxigen has joined #ruby
Akagi201 has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
Sauvin has quit [Remote host closed the connection]
davispuh has joined #ruby
davispuh has quit [Remote host closed the connection]
davispuh has joined #ruby
x1337807x has joined #ruby
darkxploit has quit [Max SendQ exceeded]
Akagi201_ has joined #ruby
timonv_ has joined #ruby
larissa has joined #ruby
davispuh has quit [Remote host closed the connection]
darkxploit has joined #ruby
kaspertidemann has joined #ruby
thotseize has joined #ruby
alexju has quit [Ping timeout: 255 seconds]
Fire-Dragon-DoL has joined #ruby
<wackobobby>
Speaking of "class_eval", what does the "<" mean when I do something like "class_eval 'Class'" and I see the output being "Class < Module"?
danman has joined #ruby
beneggett has joined #ruby
<wackobobby>
Oh, it's inheriting from that class, derp *facepalm*
Akagi201 has quit [Ping timeout: 240 seconds]
danijoo has quit [Read error: Connection reset by peer]
mikepack has quit [Remote host closed the connection]
danijoo has joined #ruby
darkxploit has quit [Max SendQ exceeded]
djbkd has quit [Remote host closed the connection]
Hanmac has quit [Ping timeout: 250 seconds]
sambao21 has joined #ruby
darkxploit has joined #ruby
Takle has quit [Remote host closed the connection]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
InfraRuby has joined #ruby
Akagi201_ has quit []
Xeago has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
Kricir_ has joined #ruby
Kricir has quit [Read error: Connection reset by peer]
abuzze has quit [Ping timeout: 245 seconds]
bayed has quit [Quit: Connection closed for inactivity]
darkxploit has joined #ruby
jdj_dk has joined #ruby
cpruitt has quit [Ping timeout: 255 seconds]
diegoviola has quit [Quit: WeeChat 0.4.3]
jottr has quit [Ping timeout: 240 seconds]
rbartos has quit [Remote host closed the connection]
jay___ has joined #ruby
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lw has joined #ruby
lw has quit [Max SendQ exceeded]
darkxploit has quit [Max SendQ exceeded]
lw has joined #ruby
pr0t has quit [Ping timeout: 250 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ardsrk has quit [Quit: Connection closed for inactivity]
icebourg has quit [Read error: Connection reset by peer]
shovel_boss has joined #ruby
darkxploit has joined #ruby
Takle has joined #ruby
icebourg has joined #ruby
help has joined #ruby
<help>
i just spent an hour trying to register a nickname to join rubyonrails
<help>
im such a noob
Wixy has quit [Read error: Connection reset by peer]
help is now known as Guest2819
Wixy has joined #ruby
<Guest2819>
can anyone help me?
<shovel_boss>
help hello
<Guest2819>
anyone on?
<shovel_boss>
i dont know shit about ruby
<shovel_boss>
Guest2819, yes
kikuchi``` has joined #ruby
kikuchi``` has left #ruby [#ruby]
jottr has joined #ruby
darkxploit has quit [Max SendQ exceeded]
<Guest2819>
how do i block someone?
<shovel_boss>
ahahhahahahaha
Guest2819 has quit [Client Quit]
darkxploit has joined #ruby
creativeembassy has joined #ruby
Hanmac has joined #ruby
omosoj has joined #ruby
MartinCleaver has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
thotseize has quit [Remote host closed the connection]
djbkd has joined #ruby
JohnFord has joined #ruby
RichardLitt has joined #ruby
darkxploit has quit [Max SendQ exceeded]
newUser1234 has joined #ruby
nateberkopec has quit [Quit: Leaving...]
bmurt has quit []
troyready has quit [Ping timeout: 256 seconds]
darkxploit has joined #ruby
philcrissman has joined #ruby
yfeldblum has joined #ruby
renderful has quit [Remote host closed the connection]
wjimenez_5271 has quit []
wjimenez5271 has joined #ruby
tvw has joined #ruby
renderful has joined #ruby
anyonetalkingata has joined #ruby
octoberry has joined #ruby
Ankhers has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<anyonetalkingata>
very talkative in here
momomomomo has quit [Quit: momomomomo]
krisquigley has joined #ruby
jdj_dk has quit [Ping timeout: 255 seconds]
mikepack has joined #ruby
creativeembassy has left #ruby [#ruby]
creativeembassy has joined #ruby
darkxploit has quit [Max SendQ exceeded]
<creativeembassy>
howdy
philcrissman has quit [Ping timeout: 255 seconds]
darkxploit has joined #ruby
renderful has quit [Ping timeout: 255 seconds]
marr has quit [Ping timeout: 272 seconds]
<anyonetalkingata>
such a chatty group
Olipro has quit [Remote host closed the connection]
<jamesfordummies>
anyonetalkingata: wanna talk about eigenclasses?
jxf has quit [Ping timeout: 260 seconds]
anaeem1 has joined #ruby
anyonetalkingata has quit [Quit: Page closed]
djbkd has quit [Remote host closed the connection]
<jhass>
you scared him away :(
<jamesfordummies>
lol
yfeldblum has quit [Ping timeout: 264 seconds]
<shevy>
hehehe
alexju has joined #ruby
BBBThunda has quit [Ping timeout: 260 seconds]
johnmolina has joined #ruby
darkxploit has quit [Max SendQ exceeded]
spyderman4g63 has quit []
bmurt has joined #ruby
darkxploit has joined #ruby
kirun has joined #ruby
jonahR_ has joined #ruby
Kricir_ has quit [Remote host closed the connection]
krisquigley has quit [Read error: Connection reset by peer]
krisquigley has joined #ruby
troyready has joined #ruby
gregf has quit [Quit: WeeChat 0.4.3]
chrishough has quit [Quit: chrishough]
mlr has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
darkxploit has quit [Max SendQ exceeded]
jonahR has quit [Ping timeout: 272 seconds]
bronson has joined #ruby
darkxploit has joined #ruby
Matadoer has joined #ruby
sambao21 has joined #ruby
ghr has joined #ruby
dorei has joined #ruby
mlr has quit [Ping timeout: 255 seconds]
darkxploit has quit [Max SendQ exceeded]
<mordof_work>
apeiros: turns out it wasn't worth the effort to have that particular item in the word report. it got removed, lol
<mordof_work>
huzzah
lkba has joined #ruby
yfeldblum has joined #ruby
darkxploit has joined #ruby
alexju has quit [Ping timeout: 245 seconds]
ti-wali has joined #ruby
ghr has quit [Ping timeout: 250 seconds]
rbartos has joined #ruby
rbartos has quit [Remote host closed the connection]
darkxploit has quit [Max SendQ exceeded]
toastynerd has quit [Remote host closed the connection]
LiohAu has joined #ruby
BBBThunda has joined #ruby
chrishough has joined #ruby
darkxploit has joined #ruby
SilkFox_ has joined #ruby
eeezkil has joined #ruby
justinv_ has quit [Remote host closed the connection]
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Xeago has joined #ruby
davedev2_ has joined #ruby
darkxploit has quit [Max SendQ exceeded]
comma8 has joined #ruby
parduse is now known as Guest1083
Guest1083 has quit [Killed (hobana.freenode.net (Nickname regained by services))]
darkxploit has joined #ruby
davedev24_ has quit [Read error: Connection reset by peer]
parduse has joined #ruby
jdj_dk has joined #ruby
parduse is now known as Guest9259
SilkFox_ has quit [Ping timeout: 255 seconds]
ferdev has joined #ruby
seamon has joined #ruby
momomomomo has joined #ruby
krisquigley has quit [Remote host closed the connection]
asmodlol has quit [Quit: Leaving]
darkxploit has quit [Max SendQ exceeded]
darkxploit has joined #ruby
goshdarnyou has joined #ruby
krisquigley has joined #ruby
toastynerd has joined #ruby
wallerdev has quit [Quit: wallerdev]
nfk has quit [Quit: yawn]
pushpak has joined #ruby
bbloom has joined #ruby
mongag is now known as Guest37458
mongag has joined #ruby
darkxploit has quit [Max SendQ exceeded]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkxploit has joined #ruby
<icarus>
hello all
<icarus>
im trying to figure out how to insert a variable into an array value kind of like what you might surmise I meant to do here:
<icarus>
^ notice the #{j}, which iterates up to 24
<icarus>
inside of a for loop
nfk has joined #ruby
<jamesfordummies>
at a specific index?
<icarus>
jamesfordummies: yeah
<jamesfordummies>
well the code you sent is a nested hash
<jamesfordummies>
not an array
<jamesfordummies>
i'm a bit confused
<icarus>
youre right
Kricir has joined #ruby
mongag has quit [Quit: This computer has gone to sleep]
<icarus>
im trying to figure out how to count up node['network']['interfaces']["eth0:1"]['addresses'] .. node['network']['interfaces']["eth0:2"]['addresses'] .. node['network']['interfaces']["eth0:3"]['addresses']
<shevy>
for splitting something like 5000 characters in one line, into a paragraph with properly formatted newlines at every ~76-80 chars, but to not break within a word
<icarus>
jamesfordummies: that might work
<shevy>
pipework you must have a shevy-trigger
darkxploit has joined #ruby
Dreamer3 has joined #ruby
<pipework>
shevy: clurly
<icarus>
ill try along those lines
<shevy>
curly?
nfk has quit [Client Quit]
RichardLitt has quit [Quit: RichardLitt]
<eam>
shevy: you want the paragraphs at sentence boundaries right?
jdj_dk has quit [Ping timeout: 260 seconds]
jayunit100 has quit [Quit: jayunit100]
justinv has joined #ruby
<eam>
or do you just mean line-wrap?
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DrShoggoth has joined #ruby
Ankhers has quit [Remote host closed the connection]
davispuh has joined #ruby
<shevy>
hmm
ppinto has joined #ruby
<shevy>
just line wrap, output into console
<shevy>
those super long overflowing strings are hard to read
<DreamingRainne>
I'd probably just grep /\S+/ (scan over non-whitespace groups) and add them to a current_line as long as it fits, then emit the line and clear it when it doesn't.
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xlogic has quit [Remote host closed the connection]
<devoknievo_>
hey there. quick question: is there a way to create an osx status bar app without using rubymotion?
xlogic has joined #ruby
kldskp has joined #ruby
bbloom has quit [Quit: Computer has gone to sleep.]
aspires has quit []
InfraRuby has left #ruby [#ruby]
lidaaa has joined #ruby
Zenigor has quit [Remote host closed the connection]
mongag has joined #ruby
<jamesfordummies>
devoknievo_: swift?
rgrinberg has joined #ruby
Kricir has quit [Ping timeout: 240 seconds]
saarinen has joined #ruby
mikecmpbll has quit [Quit: ciao.]
<jamesfordummies>
devoknievo_: rubymotion compiles down to objective-c, which is what mac natively interprets
<jamesfordummies>
so you have to get there somehow
waxjar has joined #ruby
tylerkern has joined #ruby
xlogic has quit [Ping timeout: 255 seconds]
kldskp has quit [Ping timeout: 255 seconds]
yourmother__ has joined #ruby
lid_ has joined #ruby
LiohAu has quit [Quit: LiohAu]
bbloom has joined #ruby
locsmif has joined #ruby
<eam>
shevy: a=0; ""..gsub(/\w+\W+/) {|s| a += s.length; if a > 76; a = s.length; "\n#{s}"; else s end }
britneywright has quit [Read error: Connection reset by peer]
britneywright has joined #ruby
benzrf|offline is now known as benzrf
ferr has quit [Remote host closed the connection]
<rgrinberg>
How do i set the session cookie to expire after the user leaves the browser window? The docs only say you can set the expiration time
lidaaa has quit [Ping timeout: 240 seconds]
<jhass>
rgrinberg: rails? -> #rubyonrails
<DreamingRainne>
Besides, the browser doesn't tell the server when the user is leaving.
<benzrf>
tfw people think ruby == rails
<apeiros>
mordof_work: victory? :)
doev has quit [Ping timeout: 260 seconds]
<rgrinberg>
jhass: not using rails, sinatra actually. Anyway I think the question is specific to rack
alexju has joined #ruby
magikfx has quit [Quit: Computer has gone to sleep.]
decoponio has quit [Quit: Leaving...]
dawkirst has quit [Ping timeout: 250 seconds]
<jhass>
rgrinberg: well DreamingRainne gave the answer
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<DreamingRainne>
When you're on a webpage, the browser doesn't maintain a connection to the server. It just connects, downloads what it needs (the page itself, referenced images, 6½ GB of javascript, etc), then closes it. There's no way for the server to distinguish "user has left" or "user just hasn't done anything else yet".
<DreamingRainne>
So, expiration times are pretty much the only way, I would think.
Xeago has quit [Remote host closed the connection]
<rgrinberg>
no...
<DreamingRainne>
If the user still makes their presence known (is still browsing the site, JS is still running on the page and renewing things, etc), then renew the session. Otherwise, let it expire.
Veidit_ has joined #ruby
<benzrf>
you couuuuuld use websockets
<benzrf>
or send a header requesting that the conn not be dropped
wallerdev has joined #ruby
<eam>
>> ?????:??
<eval-in>
eam => /tmp/execpad-75617d52c82a/source-75617d52c82a:2: warning: string literal in condition ... (https://eval.in/176263)
<rgrinberg>
Why would I do all this work when I can just tell the browser to keep track of that? There's a mechanism for it I just need to use it.
seamon has quit [Quit: Zzzzzzz]
<DreamingRainne>
Exactly. Hence, the expiration time thing.
bradleyprice has quit [Ping timeout: 240 seconds]
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<rgrinberg>
but I spefically want the browser to invalidate the cookie after the user leaves my page. Not after some elapsed duration
<eam>
>> $VERBOSE=nil; ?????:??
<eval-in>
eam => /tmp/execpad-98257ce0f372/source-98257ce0f372:2: warning: string literal in condition ... (https://eval.in/176264)
<eam>
booo
Veidit has quit [Ping timeout: 256 seconds]
momomomomo has quit [Quit: momomomomo]
<DreamingRainne>
Too bad. Maybe you can have on-exit JS run and do that, but don't rely on it.
kireevco has joined #ruby
timonv_ has quit [Remote host closed the connection]
djbkd has joined #ruby
<devoknievo_>
jamesfordummies: oh i see thanks, could i perhaps use swift to write a status bar widget, then run my ruby code inside?
djbkd has quit [Remote host closed the connection]
<crome>
rgrinberg: if you don't set an expiration date ona a cookie the browser will (is supposed to) delete them when the page or the browser is closed
djbkd has joined #ruby
michaeldeol has joined #ruby
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<DreamingRainne>
Or maybe on-load JS to try to reset the session / start a new one.
<DreamingRainne>
Better yet, don't design the site to be so finicky about things and take control away from the user.
<rgrinberg>
crome: that's exactly it, but the fucking rack middleware sets a default value for it instead
<crome>
browsers usually only keep "permanent" cookies when there is an expiration date on them
<crome>
rgrinberg: oh.
<crome>
which middleware?
<DreamingRainne>
Like those infinite-scroll type sites that make you lose your place if you accidentally close the tab or something. Too finicky.
sambao21 has quit [Quit: Computer has gone to sleep.]
<DreamingRainne>
(And eat up a ton of RAM in the process if it's a long page.)
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<wallerdev>
infinite scroll is annoying agreed
InfraRuby has joined #ruby
<crome>
infinite scroll is a pain
<wallerdev>
especially because to get back to where you are, it ends up having to load everything again
mongag has quit [Quit: This computer has gone to sleep]
<wallerdev>
and getting you to the same position after loading all that is finnicky
<rgrinberg>
crome: hold on, i think i might be an idiot and leaving off the expiration does exactly that
Sawbones has quit [Remote host closed the connection]
<rgrinberg>
I think i checked on an old cookie
<jamesfordummies>
devoknievo_: no, swift is the new language for OSX / iOS. you can't write ruby natively for mac. rubymotion is the only way you can write ruby to achieve what you want
<wallerdev>
coding desktop apps in ruby is just weird
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
<jhass>
just because we don't have nice UI toolkit bindings
<DreamingRainne>
Why? I've written a few Gtk programs in Ruby. It works great. I don't see why it'd be significantly different for making desktop widgets or whatnot.
<wallerdev>
like the cocoa library is huge and having access to all of that with no IDE help and no type checking/compiling is just harder than it needs to be
<jamesfordummies>
the indentation on this hurts my brain icarus
x1337807x has joined #ruby
<icarus>
heh yeah rubocop yells at me everytime
<icarus>
ill have to work on that
Zenigor has joined #ruby
anildigital is now known as zz_anildigital
<DreamingRainne>
Yeah, it's hard to tell what "end" on line 81 (for example) is supposed to pair with.
<DreamingRainne>
As for line 61, shouldn't you run that in a loop, or something?
aspires has joined #ruby
<apeiros>
jamesfordummies: holy cow batman
<apeiros>
jamesfordummies: nobody ever told you about methods?
robbyoconnor has quit [Excess Flood]
mlr has quit [Ping timeout: 260 seconds]
<jamesfordummies>
huh
<jamesfordummies>
thtat's not my code my friend
<crome>
lolz
<jamesfordummies>
i'm indenting an above gist
<apeiros>
jamesfordummies: phew
robbyoconnor has joined #ruby
<jamesfordummies>
vim didn't do a fantastic job but it's better than before
* apeiros
dislikes case/when on same level
<jamesfordummies>
also there's a for loop
<apeiros>
that said, there's absolutely no 100% pleasing way to indent case/when :(
<jamesfordummies>
which is ruby blasphemy
davispuh has quit [Ping timeout: 245 seconds]
<jamesfordummies>
but icarus
endash has quit [Quit: endash]
<jamesfordummies>
can you define '
<jamesfordummies>
not working'?
<DreamingRainne>
each_with_index do |i, j=0| ← wut
<wallerdev>
lolll
<DreamingRainne>
In line 7.
<jamesfordummies>
hey
<wallerdev>
thats amazing
<icarus>
["eth0:#{j}"] isn't valid on 61
<jamesfordummies>
dont be mean :P
Sie00 has joined #ruby
ist has quit [Quit: Leaving]
ist has joined #ruby
<DreamingRainne>
Just do |i, j| and the index should start at 0.
icebourg has quit [Read error: Connection reset by peer]
brianherman has quit [Read error: Connection reset by peer]
<icarus>
the #{j} isn't recognized
endash has joined #ruby
ghr has quit [Ping timeout: 240 seconds]
<crome>
"#{i}"
<crome>
I like this bit
<icarus>
im basically just trying to find a way to get the node virtualhost_ip value to iterate along with j and step up from eth0:1-24 or whatever value j will end up being
sambao21 has quit [Quit: Computer has gone to sleep.]
icebourg has joined #ruby
<DreamingRainne>
You're already iterating over each_with_index, so it should already be incrementing the j in each pass of the loop.
sambao21 has joined #ruby
icebourg has quit [Max SendQ exceeded]
ascarter has joined #ruby
<jamesfordummies>
i'll let DreamingRainne take this one
ascarter has quit [Max SendQ exceeded]
<DreamingRainne>
(Er, nm, I'm looking at line 57 (j += 1) like you're trying to manually advance a loop.)
abuzze has joined #ruby
abuzze has quit [Remote host closed the connection]
icebourg has joined #ruby
ascarter has joined #ruby
alexju_ has joined #ruby
<DreamingRainne>
You can use #{j+1} btw, without having to do that.
ascarter has quit [Max SendQ exceeded]
<icarus>
i didn't realize each_with_index would += 1 on its own
<icarus>
interesting
alexju has quit [Ping timeout: 260 seconds]
<crome>
er
abuzze_ has joined #ruby
lw has quit [Quit: s]
ascarter has joined #ruby
<DreamingRainne>
Well, each_with_index will run the loop (lines 7-81) once for each node web-provision server_sites.
jayunit100 has joined #ruby
cocotton has quit [Remote host closed the connection]
SilkFox_ has joined #ruby
bradleyprice has joined #ruby
<mordof_work>
apeiros: indeed victory ^_^ when my boss says "this is too much trouble, just don't do it" haha. fun times
cocotton_ has joined #ruby
cocotton_ has quit [Remote host closed the connection]
<mordof_work>
apeiros: though i still have no idea why it was freaking out… which is slightly annoying. oh well
cocotton has joined #ruby
<DreamingRainne>
What's this node.set stuff on lines 61 and 65? "node.set[a][b][c] = d" type stuff. You're taking "node.set" and indexing (using []) on what it returns, and assigning to that; but the name "set" suggests it's meant as a way to set things.
<DreamingRainne>
node.set()[a][b][c] = d
<DreamingRainne>
Whereas you index on node directly (node[a][b][c]) later in the same lines.
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mordof_work>
DreamingRainne: well.. that depends on if there's accessors with [] setup
chipotle has joined #ruby
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alexju_ has quit [Read error: Connection reset by peer]
<mordof_work>
>.>
SilkFox_ has quit [Ping timeout: 245 seconds]
alexju has joined #ruby
<DreamingRainne>
mordof_work: I don't think you can do that in Ruby, have named indexers like .set[x][y][z] -- set() would have to return some object that supports the [index]ing.
<DreamingRainne>
Not like: def set[](index) ...
<icarus>
DreamingRainne: its a function of chef-shell
jamesfordummies has quit [Remote host closed the connection]
<mordof_work>
DreamingRainne: hmm.. i'll check how i've seen it used - we have it somewhere so when you call [] on it, it looks at the attr accessors of a subclass
<mordof_work>
not sure if it's on the class itself or a method defined
<mordof_work>
nevermind - that's just a def [](key) on a class
eeezkil has quit [Read error: No route to host]
RichardLitt has joined #ruby
jdj_dk has joined #ruby
<DreamingRainne>
Yeah, which returns something that responds to []
x1337807x has joined #ruby
e4xit_ has joined #ruby
<DreamingRainne>
Um, I just realized, take the |i, j=0| thing out and just do |i,j| -- it's breaking the indexing.
ta_ has joined #ruby
alexju has quit [Ping timeout: 264 seconds]
<DreamingRainne>
Like, rather than return the index of each server_site in turn (0 then 1 then 2...), it'll always set it to 0 each time, so it'll always be looking at the first server whenever you try to refer to it by its "j" elsewhere.
skaflem has quit [Quit: Leaving]
<DreamingRainne>
each_with_index starts with 0 for the index (j) anyway.
alexju has joined #ruby
<icarus>
it worked fine for line 65, and counted up to 24 for a non-redhat test
e4xit__ has joined #ruby
e4xit has quit [Ping timeout: 256 seconds]
e4xit__ is now known as e4xit
icebourg has quit [Read error: Connection reset by peer]
ta has quit [Ping timeout: 240 seconds]
shovel_boss has left #ruby ["Leaving"]
CaptainJet has quit [Ping timeout: 240 seconds]
<icarus>
the error output is: ERROR: undefined method `[]' for nil:NilClass
<icarus>
you're right, im just trying to think of another method
alexju_ has joined #ruby
icebourg has joined #ruby
<mordof_work>
icarus: what line is that error happening on again?
<DreamingRainne>
Er, I just tried an each_with_index{|i,j=0| in IRB and it doesn't affect anything, might just be a default-parameter type thing like def herp(derp=5)
<Mon_Ouie>
Yes, that's what it does
aspires has quit []
<DreamingRainne>
Damn, thought I was on to something.
timonv_ has joined #ruby
Hobogrammer_ has quit [Ping timeout: 264 seconds]
nfk has joined #ruby
e4xit has quit [Read error: Connection reset by peer]
<devoknievo_>
j/ #cocoa
<devoknievo_>
oops hah
alexju has quit [Ping timeout: 245 seconds]
e4xit has joined #ruby
<DreamingRainne>
Oh, the problem is [] on nil. Well, there's about half a dozen [] calls in that line. One of them's coming up nil.
<icarus>
that'd be ["eth0:#{j}"]
<icarus>
[eth0] exists
CaptainJet has joined #ruby
seamon has joined #ruby
<icarus>
but so should eth0:1 .. eth0:2 .. eth0:3
The_NetZ has joined #ruby
<icarus>
the j value isn't working for reason on 61
<DreamingRainne>
Maybe, before that line, do: p node['network']['interfaces']
arup_r has quit [Quit: Leaving.]
<The_NetZ>
hey. instance variable question; basically foo = Foo.new, foo.variable gets access to the @variable, right?
<DreamingRainne>
See what it produces (on the page, in a terminal, wherever it goes).
timonv_ has quit [Ping timeout: 244 seconds]
<DreamingRainne>
Or just p node['network']['interfaces'].keys
<DreamingRainne>
The_NetZ: If it has a read-accessor for it, yes.
<The_NetZ>
DreamingRainne: kk, nice.
<Mon_Ouie>
The_NetZ: foo.variable calls the method variable on foo
<Mon_Ouie>
(the method called 'variable', that is)
<DreamingRainne>
Which returns the value of the object's @variable if the method is defined to do so.
ki0 has joined #ruby
<DreamingRainne>
It might not. Maybe it returns @variable+1 or something.
<The_NetZ>
ok, I'm looking into the different variable types to learn about whether they should be public/private/etc in a c++ class
<DreamingRainne>
Or @variable.dup so you can't scribble on an internal array or anything.
TorpedoSkyline has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
Fire-Dragon-DoL has joined #ruby
<godd2>
It'd be cool if Ruby had an 'eigen' keyword that worked like the 'super' keyword, except it calls the method of the same name in the singelton class of self
goodenough has joined #ruby
<icarus>
DreamingRainne: => nil
<DreamingRainne>
But if there's an attr_reader or attr_accessor for it, then the method by the same name will correspond to the internal variable, yeah.
<DreamingRainne>
icarus: So node['network']['interfaces'] doesn't exist. Check node['network']
<DreamingRainne>
Or plain 'node' for that matter; maybe you have to use node.set on both sides?
ryanleesipes has joined #ruby
sputnik13 has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<icarus>
node and node['network'] show tons of data
sputnik13 has quit [Max SendQ exceeded]
<DreamingRainne>
godd2: With some Ruby-fu, you could probably make an 'eigen' that does exactly that.
<DreamingRainne>
(Or generally call "inspect" on any object to get a string. This is what IRB does on every object that the last expression evaluates to, so you can control how IRB displays it to you by defining an "inspect" method. The more you know!)
<DreamingRainne>
Anyhow, you've only got "lo" and "eth0" in the network interfaces there. Maybe you're correctly referring to "eth0:0" but there isn't one *to* refer to.
<DreamingRainne>
No idea why.
<icarus>
thats possible too, another recipe is supposed to create them
<DreamingRainne>
Maybe you have to do something like node['network']['interfaces']['eth0'][j]
Sawbones has quit [Ping timeout: 250 seconds]
<DreamingRainne>
Try looking at node['network']['interfaces']['eth0'].keys
Lexun has joined #ruby
<icarus>
so by the time this recipe is called, they do exist but i guess chef-solo is checking what exists on the node before the run and so it fails out
<DreamingRainne>
Or just at ['eth0'] directly.
philcrissman has quit [Ping timeout: 255 seconds]
centrx has joined #ruby
<icarus>
thats helpful
MartinCleaver has quit [Quit: MartinCleaver]
blueOxigen has quit [Ping timeout: 255 seconds]
x1337807x has joined #ruby
momomomomo has joined #ruby
wjimenez5271 has quit [Ping timeout: 264 seconds]
MartinCleaver has joined #ruby
kldskp has quit [Ping timeout: 260 seconds]
Kricir has quit [Ping timeout: 240 seconds]
kireevco has quit [Quit: Leaving.]
x1337807x has quit [Client Quit]
goodenough has quit [Remote host closed the connection]
sepp2k has quit [Read error: Connection reset by peer]
omosoj has quit [Ping timeout: 264 seconds]
kireevco has joined #ruby
kireevco1 has joined #ruby
x1337807x has joined #ruby
angorabedsock has joined #ruby
angorabedsock has quit [Client Quit]
mary5030 has quit [Remote host closed the connection]
toastyne_ has joined #ruby
tylerkern has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikepack has quit [Remote host closed the connection]
Hobogrammer_ has joined #ruby
nanoyak has joined #ruby
tvw has quit []
toastynerd has quit [Ping timeout: 244 seconds]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tylerkern has joined #ruby
kireevco has quit [Ping timeout: 272 seconds]
Zenigor has quit [Remote host closed the connection]
rbartos has quit [Remote host closed the connection]
paulfm has quit []
wjimenez_ has quit [Remote host closed the connection]
towbes has quit [Ping timeout: 264 seconds]
wjimenez5271 has joined #ruby
dangerousdave has joined #ruby
mikecmpbll has joined #ruby
Pharaoh2 has quit [Remote host closed the connection]
danijoo has quit [Read error: Connection reset by peer]
Pharaoh2 has joined #ruby
danijoo has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
dangerousdave has quit [Client Quit]
rbartos has joined #ruby
codecop has quit [Remote host closed the connection]
ti-wali has quit [Remote host closed the connection]
timonv_ has joined #ruby
terrell_t has joined #ruby
bMalum has quit [Ping timeout: 264 seconds]
mikepack has joined #ruby
superscott[8] has joined #ruby
jespada has quit [Quit: Leaving]
endash has quit [Quit: endash]
bMalum has joined #ruby
jdj_dk has quit [Remote host closed the connection]
Sauvin has joined #ruby
ghostmoth has joined #ruby
tylerkern has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pharaoh2 has quit [Ping timeout: 246 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
rbartos has quit [Client Quit]
terrellt has quit [Ping timeout: 244 seconds]
jdj_dk has joined #ruby
mikepack has quit [Remote host closed the connection]
omosoj has joined #ruby
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
xkami has quit [Remote host closed the connection]
sambao21 has joined #ruby
renderful has joined #ruby
Ayey_ has quit [Quit: leaving]
mlr has joined #ruby
_1_luke has joined #ruby
_1_luke has left #ruby [#ruby]
banister has quit [Read error: Connection reset by peer]