<nofxx_>
jhass, hehe... not so easy to open that door
<drbrain>
there's no built-in Collect or Group constants that I know of, but maybe it will collide with a gem you're using
<jhass>
in doubt just namespace everything
<jhass>
MyApplication::Group, MyLibrary::Collect
shinnya has quit [Ping timeout: 244 seconds]
<nofxx_>
yeah... some orm/odm magic is what worries me. It's actually a model class, should have said.
bmichelsen has joined #ruby-lang
<jhass>
I'm not sure if I would want to use an ORM that breaks when using a particular classname
<nofxx_>
playing with rethink but guess it's going to be mongoid
<wallerdev>
i had issues with mongoid
<wallerdev>
but that was a few years ago
<wallerdev>
i had issues with mongodb in general haha
Lewix has joined #ruby-lang
shinnya has joined #ruby-lang
hahuang61 has quit [Ping timeout: 255 seconds]
<nofxx_>
saying this feels like something gonna happen in the next minute, but have a long running app w/o problems with mongo. And 100% HA, even linode rebooted some machines this year, all was good.
<wallerdev>
sounds good :)
<wallerdev>
i know some smart people that are using mongo in production right now
<wallerdev>
so i wouldnt worry about it :p
<wallerdev>
just left a bad taste for me with my experience with it
<wallerdev>
mongo was still pretty new though and the ruby libs were not really production ready
enebo has quit [Quit: enebo]
<nofxx_>
the best part really is out of the box replication and failover, feels right. you'll need tons of third party stuff to do that in pg.
<nofxx_>
drbrain, "PostgreSQL does not provide the system software required to identify a failure on the primary and notify the standby database server. Many such tools exist and are well integrated with the operating system facilities required for successful failover, such as IP address migration.
<nofxx_>
"
kalzz has quit [Quit: exit]
tenderlove has quit [Remote host closed the connection]
<darix>
postgresql streaming replication + pgpool for failover handling
tenderlove has joined #ruby-lang
mcclurmc has quit [Remote host closed the connection]
<drbrain>
pg has issues with transaction commit notification back to the client, but won't lose data
<drbrain>
well, maybe jepsen hasn't been run against replication yet
<drbrain>
stable replication in the face of failure scenarios is difficult to accomplish
matp has joined #ruby-lang
loincloth has quit [Ping timeout: 265 seconds]
matp_ has quit [Ping timeout: 264 seconds]
hendranata_ has joined #ruby-lang
mattyohe has quit [Quit: Connection closed for inactivity]
symm- has quit [Ping timeout: 255 seconds]
momomomomo has quit [Quit: momomomomo]
ItSANgo has joined #ruby-lang
yfeldblum has joined #ruby-lang
Musashi007 has joined #ruby-lang
caseypatrickdris has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby-lang
<darix>
drbrain: newer pgsql has synchronous streaming replication
<darix>
drbrain: but I havent used that yet
shinnya has quit [Ping timeout: 256 seconds]
ShawnHill has left #ruby-lang [#ruby-lang]
yfeldblum has quit [Ping timeout: 258 seconds]
yfeldblu_ has quit [Ping timeout: 255 seconds]
Menorah has quit [Quit: This computer has gone to sleep]
<wallerdev>
lol
<wallerdev>
just found some clever code :(
<wallerdev>
x > 0 || x = 0
<wallerdev>
please dont write things like that if you ever get the idea :p
mattyohe has joined #ruby-lang
shinnya has joined #ruby-lang
amsi has quit [Quit: Leaving]
Menorah has joined #ruby-lang
<|jemc|>
not that hard to follow
matsutomo has joined #ruby-lang
<jhass>
^ I do prefer x = 0 if x > 0 a lot though
duderonomy has quit [Ping timeout: 245 seconds]
<jhass>
or unless I guess
<waxjar>
almost as annoying as if x = "whatever; ...; end :P
<wallerdev>
yeah
dabradley has quit [Ping timeout: 245 seconds]
<wallerdev>
its an unless
<wallerdev>
so its like backwards from what you might initially think
yusuf1 has joined #ruby-lang
<wallerdev>
and still just like oh thats interesting, looks like someone forgot to write an if statement
koderok has joined #ruby-lang
<darix>
waxjar: that's why some people suggest to use: puts "foo" if "whatever" == x
<darix>
writing if "whatever" = x would give a syntax error early
<wallerdev>
i hate writing them reversed
mistym has joined #ruby-lang
<wallerdev>
reads weird in my head
<wallerdev>
because i want to check if this thing is equal to this value
<wallerdev>
not if the value is equal to the thing
<darix>
why use the less error prone version when you can also shoot yourself into the feet ;)
<waxjar>
darix: i don't mean accidentally fogetting an =, but intentionally writing it like that. usually to test if some method doesn't return nil
<waxjar>
if x = hash[:might_exist]; x.foo; else; ...; end for example
<darix>
what is something different than your previous example.
<wallerdev>
yeah i dont like that pattern either
<wallerdev>
ive seen it a couple times in our codebase too ;(
<waxjar>
yeah, shouldn't have used a string there
<waxjar>
or half a string, really :P
duderonomy has joined #ruby-lang
spetryk has quit [Quit: Be back later ...]
yfeldblum has joined #ruby-lang
loincloth has joined #ruby-lang
shinnya has quit [Ping timeout: 265 seconds]
Menorah has quit [Quit: This computer has gone to sleep]
koderok has quit [Quit: koderok]
loincloth has quit [Ping timeout: 245 seconds]
shinnya has joined #ruby-lang
amclain has joined #ruby-lang
Menorah has joined #ruby-lang
Menorah has quit [Max SendQ exceeded]
Menorah has joined #ruby-lang
dagda1 has quit [Ping timeout: 264 seconds]
tenderlove has joined #ruby-lang
dagda1 has joined #ruby-lang
djbkd has quit [Quit: My people need me...]
dabradley has joined #ruby-lang
havenwood has joined #ruby-lang
jhass has quit [Read error: Connection reset by peer]
jhass has joined #ruby-lang
nathanstitt has joined #ruby-lang
caseypatrickdris has joined #ruby-lang
kurko__ has joined #ruby-lang
tenderlove has quit [Ping timeout: 256 seconds]
ryez has joined #ruby-lang
Guest19180 is now known as tekacs
tekacs is now known as Guest73815
shinnya has quit [Ping timeout: 256 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
ed112211 has quit [Quit: ed112211]
shinnya has joined #ruby-lang
caseypatrickdris has quit [Remote host closed the connection]
kurko__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Menorah has quit [Quit: This computer has gone to sleep]
g0bl1n has joined #ruby-lang
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby-lang
AmirolAhmad has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
shubhamgoyal has quit [Remote host closed the connection]
AmirolAhmad has quit [Remote host closed the connection]
gjaldon has joined #ruby-lang
Menorah has joined #ruby-lang
AmirolAhmad has joined #ruby-lang
shubhamgoyal has joined #ruby-lang
shubhamg_ has joined #ruby-lang
o010n9 has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
shubhamgoyal has quit [Ping timeout: 265 seconds]
iamninja has joined #ruby-lang
ed112211 has joined #ruby-lang
Rodya_ has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ruby-lang
micaeked has joined #ruby-lang
kapil__ has joined #ruby-lang
Kingpin_ has quit []
Miphix has joined #ruby-lang
Menorah has quit [Quit: This computer has gone to sleep]
cornerma1 has joined #ruby-lang
cornerman has quit [Ping timeout: 256 seconds]
cornerma1 is now known as cornerman
yfeldblum has joined #ruby-lang
mistym has quit [Remote host closed the connection]
blackoperat has quit [Quit: Leaving]
Lewix has quit [Remote host closed the connection]
blackoperat has joined #ruby-lang
Musashi007 has quit [Quit: Musashi007]
mattyohe has quit [Quit: Connection closed for inactivity]
gjaldon has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
charliesome has quit [Quit: zzz]
gjaldon has quit [Remote host closed the connection]
shubhamg_ has quit [Remote host closed the connection]
ruby-lang437 has joined #ruby-lang
<jdecuirm>
Hey guys! nites!
ruby-lang437 has quit [Client Quit]
<jdecuirm>
when i do something like target = open(filename, 'w') meaning filename it's a string with the name or path of the text file
<jdecuirm>
Am i creating a File object with write properties right?
<jdecuirm>
then over it i can use methods like truncate, read and close?
jgpawletko has quit [Quit: jgpawletko]
houhoulis has joined #ruby-lang
<micaeked>
jdecuirm: Mostly correct. You can't call #read, since you opened it for writing, you would call #write, but the rest is correct.
jo__ has quit [Quit: Connection closed for inactivity]
kyb3r_ has joined #ruby-lang
charliesome has joined #ruby-lang
tenderlove has joined #ruby-lang
<jdecuirm>
Oh, thanks micaeked, if i do target.close could i read my file after writing right? or i have to create another file object like target2 = open(filename) just for read?
<micaeked>
jdecuirm: You would have to open it again. Calling #read on a closed stream raises `IOError: closed stream`
<jdecuirm>
thanks!, last question mica, what's the difference of opening a file with 'w' property and then use truncate? isn't 'w' already truncate the file?
<micaeked>
jdecuirm: Err, to clarify, you would have to do `target2 = open(filename)`, yes.
<jdecuirm>
Oh, correct, thanks mica.
<micaeked>
jdecuirm: Yes, opening a file with "w" does truncate the file automatically.
voxxit has quit [Remote host closed the connection]
<jdecuirm>
thanks again mica
<micaeked>
jdecuirm: Welcome.
kiyote23_ has quit [Remote host closed the connection]
voxxit has joined #ruby-lang
tenderlove has quit [Ping timeout: 256 seconds]
ddd_ has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 256 seconds]
ur5us has quit [Remote host closed the connection]
shubhamgoyal has joined #ruby-lang
ed112211 has quit [Quit: ed112211]
mistym has joined #ruby-lang
spastorino has quit [Quit: Connection closed for inactivity]
bb010g has joined #ruby-lang
gix has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby-lang
spetryk has joined #ruby-lang
gix has joined #ruby-lang
RobertBirnie has joined #ruby-lang
yfeldblum has quit [Ping timeout: 245 seconds]
ItSANgo has quit [Read error: Connection reset by peer]
ItSANgo has joined #ruby-lang
pwnz0r has joined #ruby-lang
t0rrieri has quit [Changing host]
t0rrieri has joined #ruby-lang
pwnz0r_ has joined #ruby-lang
pwnz0r has quit [Ping timeout: 258 seconds]
g0bl1n has quit [Ping timeout: 265 seconds]
gjaldon has joined #ruby-lang
fclausen has joined #ruby-lang
kek has quit [Remote host closed the connection]
kek has joined #ruby-lang
weaksauce has quit [Ping timeout: 265 seconds]
gjaldon has quit [Remote host closed the connection]
gjaldon has joined #ruby-lang
Sadin has quit [Remote host closed the connection]
kiyote23 has joined #ruby-lang
nisstyre has quit [Changing host]
nisstyre has joined #ruby-lang
pwnz0r_ has quit [Ping timeout: 264 seconds]
pwnz0r has joined #ruby-lang
AKASkip has joined #ruby-lang
<waxjar>
jdecuirm: if you use the block version of open, the file is automatically closed for you. it's handy, because you cannot forget to close the file :)
shuriu has quit [Remote host closed the connection]
revath has joined #ruby-lang
shuriu has joined #ruby-lang
<ljarvis>
howdy
Iskarlar has joined #ruby-lang
shubhamgoyal has quit [Remote host closed the connection]
hahuang61 has quit [Quit: WeeChat 1.0.1]
elia has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
micaeked has joined #ruby-lang
revath has quit [Read error: Connection reset by peer]
kasisnu has joined #ruby-lang
hendranata_ has quit [Ping timeout: 250 seconds]
<kasisnu>
Hi. I have a question about serverspec. Maybe someone could point me to a resource. How would one go about doing a wget type test? I wanna hit an endpoint and not just check if a port is up.
shubhamgoyal has joined #ruby-lang
skade has joined #ruby-lang
skade has quit [Remote host closed the connection]
chinmay_dd has quit [Ping timeout: 245 seconds]
chinmay_dd has joined #ruby-lang
chinmay_dd has quit [Client Quit]
shubhamgoyal has quit [Remote host closed the connection]
chinmay_dd has joined #ruby-lang
shubhamgoyal has joined #ruby-lang
shubhamgoyal has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
yusuf1 has quit [Quit: Leaving.]
shuriu has quit [Ping timeout: 258 seconds]
loincloth has joined #ruby-lang
revath has joined #ruby-lang
shuriu has joined #ruby-lang
<zenspider>
kasisnu: I have no idea what you're referring to
<maloik>
I'm pretty sure you're better off asking in #chef
<zenspider>
ok... maybe SOMEONE here does. I don't. :P
<maloik>
:D
revath has quit [Read error: Connection reset by peer]
<maloik>
ha, apparently it works for puppet etc too... in any case those related channels are more likely to have an answer
arBmind has quit [Quit: Leaving.]
cantonic has joined #ruby-lang
micaeked has quit [Quit: WeeChat 1.0.1]
t3h_j4n170r has joined #ruby-lang
<Jan_>
wondering why they didn't call it srvrspec or sspec
<Jan_>
or srvspec
Jan_ is now known as DefV
mylar has joined #ruby-lang
<maloik>
because that's a horrible name? :P
<DefV>
so is serverspec
o010n9 has joined #ruby-lang
<maloik>
it's pretty obvious what it does though isn't it?
<DefV>
it serves rspec :-D
<maloik>
oh so that's what you mean... I didn't even realize that lol
<maloik>
I guess the name isn't that obvious after all then
loincloth has quit [Ping timeout: 264 seconds]
<[spoiler]>
penisland
* [spoiler]
ain't even sorry.
<yorickpeterse>
hurrrhurr somebody said penis
rbowlby has quit [Ping timeout: 264 seconds]
arBmind has joined #ruby-lang
<kasisnu>
@zenspider: Np. :D
revath has joined #ruby-lang
bmichelsen has joined #ruby-lang
<kasisnu>
You all were right. #chef did it! Thanks!
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
tkuchiki has quit [Ping timeout: 264 seconds]
revath has quit [Read error: Connection reset by peer]
midhir has joined #ruby-lang
fclausen has joined #ruby-lang
Forgetful_Lion has quit [Quit: ChatZilla 0.9.91 [Firefox 34.0.5/20141126041045]]
rikkipitt has joined #ruby-lang
micechal_ has joined #ruby-lang
* yorickpeterse
modified an existing migration in this branch
* yorickpeterse
is going to hell
<yorickpeterse>
in my defense this branch is still a WIP that others don't share
micechal has quit [Ping timeout: 264 seconds]
rbowlby has joined #ruby-lang
fclausen has quit [Ping timeout: 272 seconds]
lapide_viridi has joined #ruby-lang
<[spoiler]>
I modify migrations all the time (unless you modified a past migration lol)
bb010g has quit [Quit: Connection closed for inactivity]
<|jemc|>
mrevd: what are you trying to do?
yock has joined #ruby-lang
<mustmodify>
Hm... it bothers me that the argument comes before the proc, but I guess that's the right way. Thanks.
<mustmodify>
oh because it's a block not a proc. Seems like I should be able to pass in a proc and an argument. That's what bothers me.
elia has quit [Quit: Computer has gone to sleep.]
<mustmodify>
bothers / feels off
hahuang61 has quit [Ping timeout: 264 seconds]
<|jemc|>
mustmodify: you could wrap instance_exec with a method that takes the proc as the first argument
<mrevd>
|jemc|, i'm trying to get the bit representation of a number in base -2
<mustmodify>
mrevd: What does "base -2" mean?
<|jemc|>
mrevd: you'll have to do the math yourself - ruby doesn't understand radix -2
<mustmodify>
if base 5 means, "using the numbers 0,1,2,3,4"
<|jemc|>
(and honestly, without looking it up, I don't know what radix 02 is either
<|jemc|>
*91
<|jemc|>
*-2
djellemah has joined #ruby-lang
<mrevd>
In base −2, integers are represented by sequences of bits in the following way. Sequence B of N bits represents the number: sum{ B[i]*(−2)i for i = 0..N-1 }
<|jemc|>
mrevd: ruby only handles a small range of radixes for you (radices?)
kiyote23 has quit [Remote host closed the connection]
<mustmodify>
mrevd: Why is this useful?
<mrevd>
it's a test
<mrevd>
not useful for any work i'd actually do
theotherstupidgu has quit [Ping timeout: 245 seconds]
theotherstupidgu has joined #ruby-lang
<mrevd>
i just need some help translating that formula… im not sure what sum{} means
<workmad3>
mrevd: it means... sum
<workmad3>
mrevd: as in addition
<workmad3>
mrevd: i.e. that's the formula for translating from a bitstring like 1111 into a numerical value
<nofxx_>
workmad3, there's a gem for that... crossed it some days ago
<workmad3>
mrevd: so to convert from number to bitstring, you need to figure out the inverse of that formula
<workmad3>
nofxx_: I think you meant to target mrevd ;)
<nofxx_>
ahh... it's already been said
<workmad3>
also, if it's for a test, I doubt using a library would be particularly good form :P
<mrevd>
it wouldn't :(
Musashi007 has joined #ruby-lang
<nofxx_>
workmad3, ops.. sorry
<nofxx_>
aint integers the same object for mri? 1 === 1 ? thing like 1000.freeze actually does something?
<workmad3>
nofxx_: 1000.freeze would indeed be meaningless
<mustmodify>
mrevd: so there is no value in using this, but it's just a thing anyway?
<workmad3>
nofxx_: as integers are value objects
apeiros_ has joined #ruby-lang
<nofxx_>
workmad3, java ppl... can't leave without complicating a code
<nofxx_>
live*
<mustmodify>
nofxx_: In ruby 1.8.7 integers weren't initially frozen.
<mustmodify>
nofxx_: but now they are
<workmad3>
mustmodify: weren't they still value objects though, so were in effect immutable?
<apeiros_>
workmad3: yes
mustmodify has left #ruby-lang [#ruby-lang]
<apeiros_>
fixnum, symbol, true, false, nil are immediates and were immutable back in 1.8 too
<apeiros_>
numeric classes also emulated that behavior
<apeiros_>
but I find it nice that they now all return true on frozen?
<workmad3>
:)
RobertBirnie has joined #ruby-lang
yock has quit [Ping timeout: 272 seconds]
<apeiros_>
IMO it would also be nice if frozen/immutable objects returned self on .dup
<apeiros_>
though, not sure what to do about clone (clone does not replicate frozen status - which won't matter for immediates, but for other frozen objects)
<calebk>
so i figured out it does loop correctly…. it just does the first “depth” of nodes
vladgh has quit [Remote host closed the connection]
vladgh has joined #ruby-lang
<calebk>
however strangely the index is always 0, no matter how large the first queue is
<calebk>
i’m not sure why that is
vladgh has quit [Remote host closed the connection]
stamina has quit [Quit: WeeChat 1.0.1]
djbkd has joined #ruby-lang
st0mar has quit [Ping timeout: 245 seconds]
SHyx0rmZ has quit [Remote host closed the connection]
vladgh has joined #ruby-lang
vladgh has quit [Remote host closed the connection]
SHyx0rmZ has joined #ruby-lang
kurko__ has joined #ruby-lang
caseypatrickdris has joined #ruby-lang
Musashi007 has quit [Ping timeout: 265 seconds]
mLF has joined #ruby-lang
sarkyniin has joined #ruby-lang
<calebk>
eureka!…… the spiderdepth variable was getting interpreted as static for the entire loop, changed the depreciating counter inside the instance parameter
<calebk>
*changed to
caseypatrickdris has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 255 seconds]
Sadin has joined #ruby-lang
Musashi007 has joined #ruby-lang
vladgh has joined #ruby-lang
fusillicode has joined #ruby-lang
rbowlby has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
kasisnu has joined #ruby-lang
yalue has quit [Ping timeout: 245 seconds]
gwendall has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
fusillicode1 has joined #ruby-lang
djbkd has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
vladgh has quit [Remote host closed the connection]
djellemah_ has joined #ruby-lang
fusillicode has quit [Ping timeout: 240 seconds]
gwendall has quit [Ping timeout: 264 seconds]
Musashi007 has quit [Ping timeout: 250 seconds]
djellemah has quit [Ping timeout: 250 seconds]
Musashi007 has joined #ruby-lang
yock has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
caseypatrickdris has joined #ruby-lang
kasisnu has quit [Quit: Leaving.]
kasisnu has joined #ruby-lang
djbkd has joined #ruby-lang
vladgh has joined #ruby-lang
fusillicode1 has quit [Quit: Leaving.]
fusillicode has joined #ruby-lang
jkad1 has joined #ruby-lang
gianlucadv has joined #ruby-lang
hahuang61 has joined #ruby-lang
marr has quit [Remote host closed the connection]
centrx has joined #ruby-lang
marr has joined #ruby-lang
bantic_ has joined #ruby-lang
mLF has quit [Ping timeout: 264 seconds]
marr has quit [Ping timeout: 245 seconds]
jkad1 has left #ruby-lang ["WeeChat 1.0.1"]
mikecmpbll has joined #ruby-lang
gwendall has joined #ruby-lang
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jkad has joined #ruby-lang
chinmay_dd has quit [Quit: Leaving]
malconis has joined #ruby-lang
kiyote23 has joined #ruby-lang
bhaak has quit [Ping timeout: 255 seconds]
djbkd has quit [Remote host closed the connection]
kiyote23 has quit [Remote host closed the connection]
mcclurmc has joined #ruby-lang
mcclurmc_ has joined #ruby-lang
mcclurmc has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
kasisnu has quit [Quit: Leaving.]
godd2 has quit [Remote host closed the connection]
jkad has quit [Quit: WeeChat 1.0.1]
kiyote23 has joined #ruby-lang
godd2 has joined #ruby-lang
mLF has joined #ruby-lang
kiyote23 has quit [Remote host closed the connection]
kiyote23 has joined #ruby-lang
jkad has joined #ruby-lang
kasisnu has joined #ruby-lang
Asher has quit [Ping timeout: 244 seconds]
kasisnu has quit [Client Quit]
mcclurmc_ has quit [Remote host closed the connection]
zgrogan has quit [Remote host closed the connection]
djellemah_ has quit [Ping timeout: 255 seconds]
shazaum has quit [Quit: This computer has gone to sleep]
ur5us has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
Sadin has quit [Remote host closed the connection]
Sadin has joined #ruby-lang
kasisnu has joined #ruby-lang
gwendall_ has joined #ruby-lang
gwendall has quit [Ping timeout: 244 seconds]
nofxx_ has quit [Ping timeout: 258 seconds]
Menorah has joined #ruby-lang
Asher has joined #ruby-lang
bmichelsen has joined #ruby-lang
duderonomy has joined #ruby-lang
miketheman has left #ruby-lang ["Textual IRC Client: www.textualapp.com"]
_fritchie has joined #ruby-lang
ikrima__ has quit [Ping timeout: 264 seconds]
centrx has quit [Quit: Science is organized knowledge, wisdom is organized life.]
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
_fritchie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tenderlove has quit [Remote host closed the connection]
kasisnu has quit [Quit: Leaving.]
mistym has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
Musashi007 has quit [Quit: Musashi007]
Iskarlar has joined #ruby-lang
JokerDoom has joined #ruby-lang
kurko__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_JokerDoom has quit [Ping timeout: 256 seconds]
_fritchie has joined #ruby-lang
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mylar has quit []
<ljarvis>
calebk: I see you didn't decide to adopt 2 space indent ;P
<ljarvis>
ah you haven't changed it since
<yorickpeterse>
WAIT
<yorickpeterse>
SOMEBODY DIDN'T USE 2 SPACES?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<|jemc|>
yorickpeterse: didn't you hear? The new ruby convention is to use 3 'FULL BLOCK' (U+2588) characters to indent
<|jemc|>
███
scampbell has quit [Ping timeout: 272 seconds]
djellemah has joined #ruby-lang
mistym has joined #ruby-lang
_fritchie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<calebk>
+_+ it’s my first week of ruby
<calebk>
i was planning to do the 2 space indent for my next scrape of code
<|jemc|>
calebk: well you're just in time to learn indentation the new way then
<|jemc|>
def foo
<|jemc|>
███:bar
<|jemc|>
end
<yorickpeterse>
I
<yorickpeterse>
* I'm more of a tab fan myself
<yorickpeterse>
|jemc|: also that's not valid Ruby
<calebk>
personally, i use tab because it makes it easier for me to differentiate
<calebk>
but I didn’t know that ruby had a convention
* yorickpeterse
actually hates tabs
<yorickpeterse>
calebk: not an official one, no
<apeiros_>
|jemc|: actually it's five semicolons: ;;;;;
<|jemc|>
yorickpeterse: that's one yacc hack away
<calebk>
so its…. more like a “commonly accepted practice” for spaces in ruby?
<|jemc|>
from being valid ruby
djbkd has quit [Remote host closed the connection]
<apeiros_>
;; is valid ruby :)
<|jemc|>
apeiros_ but I'd rather have my code look like a cityscape than a waterfall
<yorickpeterse>
calebk: yes
djbkd has joined #ruby-lang
<|jemc|>
calebk: yeah, it's pretty darn common
<yorickpeterse>
apeiros_: not always
nofxx_ has joined #ruby-lang
<yorickpeterse>
e.g.
<apeiros_>
calebk: it's a "do it or people will unleash teh hate on you" convention
<yorickpeterse>
;;def foo
<|jemc|>
there are various ruby style guides floating around if you're interested in what others are doing
<yorickpeterse>
;;;;10
<yorickpeterse>
;;
<yorickpeterse>
is invalid
<yorickpeterse>
errr
<yorickpeterse>
derp
<yorickpeterse>
of course it's invalid if you forget the end
* yorickpeterse
slaps himself around with a copy of parse.y
<yorickpeterse>
D:
<|jemc|>
it's not valid in places like a multiline array declaration
Bwild has joined #ruby-lang
<apeiros_>
lolyorick
<apeiros_>
|jemc|: oh, indeed. how very sad.
<apeiros_>
and there I thought ruby treated ; exactly like a newline
chills42 has quit [Remote host closed the connection]
<|jemc|>
apeiros_: my toy lang has two modes for separators - one where semicolons are interchangable with newlines and one where commas are - in a typical context, it's semicolons; in something like an array, it's commas
<apeiros_>
interesting. why not ; everywhere?
<|jemc|>
so things like [1,2,,,,,,,3] are valid and still just three items (though ugly)
<|jemc|>
apeiros_: long story short: it helps make it possible to nest some grammar areas inside eachother without a closing token
<|jemc|>
so for a one-line method def, instead of:
<|jemc|>
def foo; a; b; c; d; end
<|jemc|>
it can be:
<|jemc|>
foo: a; b; c; d
Musashi007 has joined #ruby-lang
lapide_viridi has quit [Quit: Leaving]
<|jemc|>
because in the class declaration context, comma is the sep
<apeiros_>
ok
<apeiros_>
is the name of your language golf-lang? :)
<|jemc|>
"foo: a; b, bar: c, d" would be two method defs
<|jemc|>
heh
<|jemc|>
making one-liner methods look pretty and succint can visually clean up a class definition
<apeiros_>
(I admit, mine has a --golf flag which loads the whole stdlib plus a couple of shortcuts)
<apeiros_>
oh btw. yorickpeterse - re pg & orms, are you by any chance interested in a minimal, postgres specific ORM? as in, help building it?
gianlucadv has quit [Ping timeout: 250 seconds]
bmichelsen has quit [Quit: ZZZzzz…]
<ljarvis>
^ i might be interesting in that too
<apeiros_>
noted :)
<apeiros_>
I have to ponder how much makeshift ugliness I accept to remain in it before I show it to you (and yorick, if he's interested)
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
<|jemc|>
apeiros_: put me on the list :)
<apeiros_>
ok, now I indeed need a list. just be aware that when I say "minimal", I mean minimal. at the moment it's probably behind every ORM feature wise.
<ljarvis>
that's why im interested
<|jemc|>
yeah, that's the appeal
<apeiros_>
if you wonder what the point of it is: I don't need/want DBI and hence can (and intend to) leverage all of postgres specific advantages
spetryk has quit [Quit: Be back later ...]
robbyoconnor has quit [Ping timeout: 272 seconds]
marr has joined #ruby-lang
<ljarvis>
we wrote rdbi and it's a shame it never really took off
<ljarvis>
none of us were massively motivated at the time (although it's not really an orm)
lapide_viridi has quit [Quit: Leaving]
djbkd has joined #ruby-lang
oleo has quit [Ping timeout: 250 seconds]
mistym has joined #ruby-lang
st0mar has joined #ruby-lang
oleo has joined #ruby-lang
<ljarvis>
i should really release slop
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tbuehlmann>
do so!
<ljarvis>
im not sure whether to wait and build something to handle commands
yock has quit [Ping timeout: 258 seconds]
<ljarvis>
but that stuff bores me so maybe someone else who's interested should take it on
j2p2 has quit [Ping timeout: 258 seconds]
mcclurmc has joined #ruby-lang
<ljarvis>
god i love writing haskell
gwendall_ has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
calebk has quit [Quit: calebk]
mcclurmc has quit [Ping timeout: 258 seconds]
bears has joined #ruby-lang
caseypatrickdris has quit [Remote host closed the connection]
AKASkip has quit [Ping timeout: 256 seconds]
mcclurmc has joined #ruby-lang
BubonicPestilenc has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
symm- has quit [Read error: Connection reset by peer]
_fritchie has joined #ruby-lang
cmhobbs has quit [Ping timeout: 250 seconds]
sarkyniin has quit [Remote host closed the connection]
allomov has joined #ruby-lang
fusillicode has quit [Ping timeout: 240 seconds]
Menorah has quit [Quit: This computer has gone to sleep]
caseypatrickdris has joined #ruby-lang
siwica has joined #ruby-lang
skade has joined #ruby-lang
arBmind has joined #ruby-lang
<zenspider>
ljarvis: you're perverse
<ljarvis>
zenspider: quite!
<zenspider>
I still can't read haskell
allomov has quit [Remote host closed the connection]
<ljarvis>
yeah it still takes me some time to wrap my head around it when reading library code
yfeldblu_ has joined #ruby-lang
spastorino has quit [Quit: Connection closed for inactivity]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
loincloth has quit [Ping timeout: 245 seconds]
blowmage has quit [Ping timeout: 245 seconds]
DefV_ has joined #ruby-lang
st0mar has quit [Ping timeout: 245 seconds]
djellemah has quit [Ping timeout: 245 seconds]
ur5us has quit [Ping timeout: 245 seconds]
shubhamg_ has quit [Ping timeout: 245 seconds]
mbr has quit [Ping timeout: 245 seconds]
banister has quit [Ping timeout: 245 seconds]
DefV has quit [Ping timeout: 245 seconds]
blackoperat has quit [Ping timeout: 245 seconds]
sk_0 has quit [Ping timeout: 245 seconds]
sk_0 has joined #ruby-lang
nofxx__ has quit [Ping timeout: 255 seconds]
mLF has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby-lang
bantic_ has quit [Quit: bantic_]
yfeldblum has quit [Remote host closed the connection]
nofxx__ has joined #ruby-lang
mcclurmc has quit [Remote host closed the connection]
blackoperat has joined #ruby-lang
<yorickpeterse>
apeiros_: re ORM, not really, I'm happy with Sequel, don't really have the time either for more stuff to work on
<yorickpeterse>
apeiros_: already got my hands full with rbx, oga, soon an LL parser
bantic has joined #ruby-lang
<apeiros_>
:)
<yorickpeterse>
and all the crap that comes with that
<apeiros_>
ok
jkad has joined #ruby-lang
calebk has joined #ruby-lang
bears has quit [Remote host closed the connection]
<calebk>
other than using a thread queue, is there a way to check if threads are still being issued before the thread.join call?
<calebk>
all of the threading examples use join after a fixed number of threads have been issued, but what if you don’t know if threads are still being issued?
<yorickpeterse>
issued?
<yorickpeterse>
If you mean if they are still alive you can call #alive? on a thread
<calebk>
so when the .join is called, I have no idea if its abruptly ending before the new threads are added
<yorickpeterse>
oh right
setanta has quit [Quit: Leaving]
<yorickpeterse>
the above snippet won't call #join until all threads have been spawned
<calebk>
but that’s the trick… the threads haven’t been even come into existence yet, because the number is dynamic, so there’s almost a look forward needed
<yorickpeterse>
Not sure what you mean
<calebk>
wouldn’t I have to specify the some_nmumber
<yorickpeterse>
Do you mean that you will continuesly spawn new threads over a period of time?
<yorickpeterse>
* continuously
<calebk>
well I have workers creating workers which create workers…. its a function of crawling a tree, children creating children threads
Musashi007 has quit [Quit: Musashi007]
<calebk>
but when I issue a general.join call, the code doesn’t know if it’s killing the process that’s killing those children
<calebk>
*process that’s issueing those children in the future
<yorickpeterse>
join doesn't kill any processes
<yorickpeterse>
Thread#join merely waits until whatever it's called on has completed running
<nofxx__>
yorickpeterse, my arrayless thread control is uglier than array one: Thread.list.reject { |t| t == Thread.current }.each(&:join)
<yorickpeterse>
nofxx__: heh
gareim has quit [Ping timeout: 258 seconds]
<calebk>
yeah…. but .join waits until what’s been already called, but what if the child thread hasn’t added it’s children yet?
<calebk>
will it wait for those?
<yorickpeterse>
#join simply blocks execution of the calling thread until the thread it has been called on has completed
<yorickpeterse>
So everything after it will be blocked too
<yorickpeterse>
This is why Thread.current.join triggers a deadlock: it waits for itself to finish, but it never will due to the #join call
<yorickpeterse>
>> Thread.current.join
<eval-in__>
yorickpeterse => Target thread must not be current thread (ThreadError) ... (https://eval.in/236400)
<zenspider>
argh. pry isn't warning free either.
<yorickpeterse>
oh, apparently there's now even a fancy warning for it
<calebk>
hmmm…. then it seems queue is probably my only viable option for my situation
<nofxx__>
I never really got why #join ... #wait doesn't make more sense?
<yorickpeterse>
Probably comes from pthread_join()
<nofxx__>
or maybe #sync
<calebk>
has anyone tried threadz or actionpool gems?
<calebk>
the problem is that each thread is tied to a node, and there are going to be a lot of nodes...
<calebk>
this is my 6th day of ruby… still getting a feel for everything
<yorickpeterse>
heh, multi-threading on the 6th day
<yorickpeterse>
a brave person indeed
<calebk>
it wasn’t my original plan… the code includes threading… but it gets messed up without a queue, because the .join abruptly ends the chance for the children threads to issue their own children
<calebk>
hence… the queue
hahuang61 has quit [Quit: WeeChat 1.0.1]
mcclurmc has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
arBmind has joined #ruby-lang
hahuang61 has joined #ruby-lang
midhir has quit [Remote host closed the connection]
sankaber has joined #ruby-lang
Musashi007 has joined #ruby-lang
jo__ has quit [Quit: Connection closed for inactivity]
kurko__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]