<havenwood>
Oog: With `self.foo` you can change Example to AnotherExample and `self` will switch from Example to AnotherExample without you having to change the code.
<toretore>
Oog: there's no difference
<havenwood>
Oog: `self.foo` is equivalent to `Example.foo` in my example.
<toretore>
Oog: but you shouldn't use :: for methods
jenrzzz has joined #ruby
<havenwood>
Oog: Use . to call methods, and :: between namespaces. When you can, use `self` instead of the explicit module/class name to avoid connaisance of name.
<havenwood>
Or whatever you want to call it where when you change the name of the module things break.
<havenwood>
Oog: But do look at module_function.
lanemeyer has joined #ruby
renderful has joined #ruby
<Oog>
thanks what is connaisance of name.
brain_shim has joined #ruby
<havenwood>
Oog: It's a way of describing when the name of the thing is what connects different parts so when it changes in one place it also needs to change in another.
mr_blue has quit [Ping timeout: 264 seconds]
<Oog>
ah ok
Pisuke has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
arescorpio has joined #ruby
renderful has quit [Ping timeout: 244 seconds]
ruurd has quit [Quit: Zzzzz z zz ...]
iateadonut has quit [Quit: Leaving.]
jfarmer has joined #ruby
kjones_ has joined #ruby
jesterfraud has joined #ruby
abuzze has joined #ruby
Scroff has quit [Ping timeout: 252 seconds]
lala has joined #ruby
wldcordeiro has joined #ruby
Akagi201 has joined #ruby
nwhirschfeld has quit [Quit: No Ping reply in 180 seconds.]
jcoe has joined #ruby
atomical has joined #ruby
havenwood has quit [Ping timeout: 246 seconds]
abuzze has quit [Ping timeout: 246 seconds]
urbanmonk has joined #ruby
jbw_ has joined #ruby
jbw__ has quit [Ping timeout: 252 seconds]
fella6s has joined #ruby
bronson has quit [Remote host closed the connection]
Rutix`away has joined #ruby
Rutix`away has joined #ruby
matled- has joined #ruby
kith has quit [Read error: Connection reset by peer]
<tejasmanohar>
anyone know what this means? host-raw? is that arbitrary and supposed to be changed....
G has quit [Disconnected by services]
Nigel_ is now known as G
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby
chouhoulis has quit [Ping timeout: 256 seconds]
<jesterfraud>
?guys tejasmanohar
<ruboto>
tejasmanohar, we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
<tejasmanohar>
sorry sorry
<tejasmanohar>
*hey everyone :)
<tejasmanohar>
my bad
<jesterfraud>
I think there's a vagrant specific channel
<jesterfraud>
you might have more luck there
Rollabunna has joined #ruby
<jesterfraud>
at a guess though, tejasmanohar, I'd say that's the folder on the VM, and therefore is probably fine
oylm has quit []
<tejasmanohar>
hm but its not there on the vm :\
<tejasmanohar>
or my comp
NeverDie has joined #ruby
<jesterfraud>
not sure
ryan__ has joined #ruby
jeramyRR has quit [Quit: Peace out!]
ryan__ is now known as valetudo
<jesterfraud>
sorry, I can't be more help. Have you tried #vagrant?
Rollabunna has quit [Ping timeout: 276 seconds]
kjones_ has joined #ruby
howdoicomputer has quit [Ping timeout: 250 seconds]
yh has joined #ruby
<tejasmanohar>
ill try now
growlove has joined #ruby
tejasmanohar has quit [Quit: WeeChat 1.1.1]
Matadoer has joined #ruby
yh has quit [Ping timeout: 255 seconds]
_whitelogger_ has joined #ruby
bb010g has joined #ruby
elektronaut has joined #ruby
krz has quit [Read error: Connection reset by peer]
drPoggs has joined #ruby
krz has joined #ruby
weemsledeux has joined #ruby
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
uptownhr has quit [Quit: uptownhr]
<Miesco>
Whats this mean?: <internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
jcoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blaines has joined #ruby
charliesome has quit [Quit: zzz]
ivanskie has joined #ruby
eggoez has joined #ruby
charliesome has joined #ruby
Symbiosisz has quit [Remote host closed the connection]
jenrzzz has quit [Quit: Lost terminal]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blaines has quit [Ping timeout: 264 seconds]
peter_paule has joined #ruby
Rutix`away is now known as Rutux
blaines has joined #ruby
mary5030 has quit [Remote host closed the connection]
tmtwd has quit [Remote host closed the connection]
krz has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: zzz]
Musashi007 has quit [Quit: Musashi007]
oo_ has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
blaines has quit [Ping timeout: 244 seconds]
hotpancakes has quit [Read error: Connection reset by peer]
hotpancakes has joined #ruby
auraka has quit [Quit: WeeChat 0.4.2]
jenrzzz has joined #ruby
robbyoconnor has joined #ruby
robbyoconnor has quit [Changing host]
robbyoconnor has joined #ruby
workmad3 has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
robbyoconnor has quit [Client Quit]
f3lp has quit [Ping timeout: 252 seconds]
robbyoconnor has joined #ruby
mistermocha has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
dellavg has joined #ruby
bronson has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
mr_blue has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
Scroff has joined #ruby
charliesome has joined #ruby
jfarmer has quit []
Musashi007 has joined #ruby
sivoais has quit [Ping timeout: 246 seconds]
peter_paule has quit [Ping timeout: 276 seconds]
sivoais has joined #ruby
bodie_ has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
serivich has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistermocha has quit [Ping timeout: 246 seconds]
icosa1 has joined #ruby
bodie_ has joined #ruby
charliesome has quit [Quit: zzz]
f3lp has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
Rollabunna has joined #ruby
tkuchiki has quit [Remote host closed the connection]
war_pigs has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
Rollabunna has quit [Ping timeout: 248 seconds]
ixti has joined #ruby
Scroff has quit [Ping timeout: 264 seconds]
roolo has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
serivichi has joined #ruby
iamninja has joined #ruby
davedev24_ has quit [Remote host closed the connection]
hotpancakes has quit [Remote host closed the connection]
damncabbage has joined #ruby
riotjones has joined #ruby
christiandsg has quit [Remote host closed the connection]
balazs has joined #ruby
serivich has quit [Ping timeout: 248 seconds]
DoubleMalt has quit [Ping timeout: 250 seconds]
bffff_ has quit [Quit: Connection closed for inactivity]
allomov has joined #ruby
riotjones has quit [Ping timeout: 252 seconds]
tkuchiki has joined #ruby
idiocrash has quit [Remote host closed the connection]
cir0x has joined #ruby
bhuvan_aurora has joined #ruby
bhuvanaurora has joined #ruby
Sypheren has quit [Ping timeout: 244 seconds]
Burgestrand has joined #ruby
dhjondoh has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Burgestrand>
Cool, so #ruby-lang finally got merged? :)
<sevenseacat>
aye
<sevenseacat>
hello :)
tagrudev has joined #ruby
<Burgestrand>
\o.
<Burgestrand>
Not a day too late!
<Burgestrand>
or too soon I guess. ;)
Sypheren has joined #ruby
Volsus has quit [Ping timeout: 248 seconds]
* damncabbage
waves
<Burgestrand>
And Hi :)
hotpancakes has joined #ruby
hotpancakes has quit [Remote host closed the connection]
leonardoajim has quit [Quit: Be back later ...]
leonardoajim has joined #ruby
arooni-mobile has quit [Ping timeout: 248 seconds]
arooni-mobile__ has quit [Ping timeout: 248 seconds]
<postmodern>
controversial question, should all new projects use bundler?
ferr has joined #ruby
<postmodern>
even ones with <5 common dependencies
<sevenseacat>
i believe any ruby project should use bundler.
<postmodern>
sevenseacat, how about ones with no dependencies?
<sevenseacat>
do they exist? any ruby project will at least have some testing dependencies
mary5030 has joined #ruby
<sevenseacat>
plus, a Gemfile allows you to lock a ruby version
<postmodern>
sevenseacat, by project i mean gem
leonardoajim has quit [Ping timeout: 256 seconds]
dgutierrez1287 has joined #ruby
<sevenseacat>
ah hah
<sevenseacat>
I've never built one
<postmodern>
i don't count things like rake as a dependency, that's included with ruby
oo_ has joined #ruby
tkuchiki has quit [Remote host closed the connection]
mr_blue has quit [Quit: leaving]
<damncabbage>
nnnno it isnt
<sevenseacat>
well if you rely on a specific version of rake
<sevenseacat>
you probably need to specify it
<damncabbage>
postmodern: You really need to include Rake. Just because it's _sometimes_ bundled or sometimes people just happen to install it doesn't mean you shouldn't add it to a dev-dependencies list.
<postmodern>
damncabbage, yeeeees it is
<damncabbage>
... What version of Ruby? :|
<postmodern>
damncabbage, it's added to the gemspec, but i don't count it as an external dependency that needs managing
mary5030 has quit [Ping timeout: 248 seconds]
<postmodern>
damncabbage, rake has been included since 1.9
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
GriffinHeart has joined #ruby
* damncabbage
suddenly shows his age
<damncabbage>
pardon me
<sevenseacat>
hah
dgutierrez1287 has quit [Ping timeout: 264 seconds]
<postmodern>
and 1.8 is EoLed, thank $deity
<damncabbage>
Sorry for my earlier snark and/or plaintive cry
agent_white has joined #ruby
<damncabbage>
So is 1.9, thankfully. D:
<sevenseacat>
aye
<agent_white>
Evenin'
GriffinHeart has quit [Remote host closed the connection]
Sypheren has quit [Ping timeout: 250 seconds]
cir0x has quit [Quit: Leaving.]
iateadonut has quit [Quit: Leaving.]
GriffinHeart has joined #ruby
jenrzzz has joined #ruby
ponga has joined #ruby
jesterfraud is now known as jesterfraud_afk
GriffinHeart has quit [Read error: Connection reset by peer]
GriffinHeart has joined #ruby
Sypheren has joined #ruby
kies^ has quit [Ping timeout: 246 seconds]
railsraider has joined #ruby
<Burgestrand>
postmodern: what is the downside to using bundler?
hotpancakes has joined #ruby
_ht has joined #ruby
<postmodern>
Burgestrand, more files, bundle exec, etc
Volsus has joined #ruby
<postmodern>
Burgestrand, debating whether my ore project generator should enable it by default, or let the user choose per gem
jesterfraud_afk is now known as jesterfraud
SOLDIERz has joined #ruby
A205B064 has quit [Ping timeout: 265 seconds]
<Burgestrand>
I consider it optional when developing gems. Sure, it's a nice standard to be able to "bundle install" and get all dependencies regardless if it's a project or not, it's the closest way to a standard build we have. On the other side, you don't get anything else since you don't *want* to lock down gem versions when developing your own gem.
michael_mbp has quit [Excess Flood]
hotpancakes has quit [Ping timeout: 256 seconds]
bronson has joined #ruby
<Burgestrand>
I do throw it in all my gems because: it's low cost, not unexpected (most rubyists will encounter bundler many times), it gives some rake tasks that I don't need to write, and I feel it's easier to install gem dependencies that way.
kreantos has quit [Ping timeout: 256 seconds]
kreantos has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
darithorn has joined #ruby
howdoicomputer has joined #ruby
<flughafen>
moin everybody
<Burgestrand>
By low cost I mean it's one file (I don't check in Gemfile.lock when developing gems), and it's only a development dependency.
toretore has quit [Quit: This computer has gone to sleep]
<Burgestrand>
postmodern: it does however give a nicer way if you have dependencies on other gems that are also not released yet, if you're developing two gems in tandem.
<Burgestrand>
postmodern: I think my own opinion in summary is that if you ask me if you should use bundler for your gem I will say yes, if you ask me if you must I will say no.
Sypheren has quit [Ping timeout: 250 seconds]
hotpancakes has joined #ruby
ledestin has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
bf4 has joined #ruby
<sevenseacat>
my opinions aren't relevant for gems, I don't know whats best practice there :)
<damncabbage>
Because we have .map() because we're going to treat the result as a value :D
<sevenseacat>
we have map, each, times, loop, while... so many ways of looping
<sphex>
yeah.. like "if"/"when"/"for"/etc for the outer, more important layer of flow control in a routine. and ternary operator, inline "if" expressions, enumerators and chained methods, etc for the rest.
yayfoxes has joined #ruby
jesterfraud is now known as jesterfraud_afk
jesterfraud_afk is now known as jesterfraud
<sevenseacat>
not seeing it, sorry.
last_staff has joined #ruby
<sphex>
okay *looks down*
<sphex>
I may be the *only* one thinking that. in the world. :/ my "for" loops will be called stupid by everyone ever.
<sevenseacat>
theyre just not idiomatic ruby code
hotpancakes has quit [Remote host closed the connection]
Sypheren has quit [Ping timeout: 264 seconds]
kkeuning has quit [Ping timeout: 265 seconds]
<damncabbage>
But why do we need to think of it as flow control? Some other languages have it as a big calculation instead, where it's the result of applying the block-function-thing to each element.
<Burgestrand>
sphex: they could also leak information after the loop since they don't have their own scope.
<sevenseacat>
its not flow control, its usually used for transformations
<damncabbage>
("Programming Languages Have Social Mores Not Idioms")
ponga has left #ruby [#ruby]
KrzaQ has quit [Disconnected by services]
<sevenseacat>
interesting, seems I (and many others) use the word 'idiom' incorrectly
KrzaQ has joined #ruby
<damncabbage>
I'm not sure how much I agree with the author, but it's worth the read all the same.
hotpancakes has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
<sevenseacat>
either
<sevenseacat>
99.5%ish of the ruby code you read is not going to use for loops, so teaching them (and only them) makes you ill-equipped to deal with any other code but your own
<sphex>
oh no.. now gotta worry about non-idiomatic uses of the word "idiom". I just want to ruby right. :/
emilkarl has quit [Quit: emilkarl]
<baweaver>
Someone's arguing for loops in ruby?
<baweaver>
that's a good way to axe the best part of it (Enumerable)
<baweaver>
treat ruby like ruby, leave other languages out of it. Best practice when learning a new language honestly.
<Burgestrand>
I think that article has a valid point about mores, but regarding the "for-loops are conceptually easier than .each"-section, while being true doesn't really give a compelling argument *not* to teach "use .each, not for".
joneshf-laptop has joined #ruby
<baweaver>
Otherwise you end up with nasty articles like "Rails for PHP developers" or "Ruby for Java developers" that does nothing except exasperate the issue more.
mburns has quit [Remote host closed the connection]
<baweaver>
Burgestrand: saying they're easier is laughable at best and downright deceptive at worst
<baweaver>
easier only if you're a java/c type programmer learning another language.
tesuji has joined #ruby
<baweaver>
it's loaded
bhuvanaurora has quit [Ping timeout: 252 seconds]
howdoi has joined #ruby
bhuvan_aurora has quit [Ping timeout: 252 seconds]
Shizza has quit []
<baweaver>
If you come from *any* functional language, you'd say the opposite
<baweaver>
it's depressingly like java/c programmers to assume everything on their side of the fence is "easier"
<Burgestrand>
baweaver: yeah I'm not really concerned about a programmer coming from another language, mainly thinking about the aspect of people new to programming.
<baweaver>
also laughable
<Burgestrand>
baweaver: why?
<baweaver>
I've taught people various languages to start with
<baweaver>
Java had the absolute worst feedback with C++ close behind
<sevenseacat>
tbh I think you could teach 'each' without half of those concepts, and then explain them when they become relevant
<Burgestrand>
Indeed, a new programmer won't really care about what they use in the start, it's all the same anyway.
allomov has quit [Remote host closed the connection]
Sypheren has quit [Ping timeout: 250 seconds]
<baweaver>
false
<Burgestrand>
baweaver: in my experience this is not so.
<sevenseacat>
half of the syntax you pick up when you learn a language you understand the nuances of anyway
<damncabbage>
Just... outright false?
<baweaver>
while there are overlaps, I'd dare someone to say learning Haskell first is 'the same anyways'
<sevenseacat>
*you dont understan
<sevenseacat>
d
<Burgestrand>
baweaver: I'm on the topic of for vs. .eahc.
<baweaver>
Java and Haskell are about as incongruent as you can get
<Burgestrand>
Derp, .each.
<damncabbage>
Err. I think it was between 'for' and 'each', not between 'Ruby'and 'Haskell'.
<baweaver>
It was, but it also tails into languages that inspire said idioms
<postmodern>
do people still use sdoc? or has rdoc/yard caught up?
<shevy>
I let love be the message of my documentation.
<baweaver>
yard for me
<sphex>
baweaver: my idea was that the different syntax of "for" loops could be used to distinguish the "outer layer" of a complicated function. I think they stand out more than enumerator calls. just to make the code easier to "get" at a glance. I think syntax matters a lot to make code readable; uniformity isn't necessarily better.
Sypheren has joined #ruby
<baweaver>
if you need an outer then you need to break apart a function
<baweaver>
show me an example of that paradigm
Scroff has joined #ruby
<Burgestrand>
postmodern: I'm not sure you could get a good answer for your decision, I personally prefer YARD but I respect rdoc.
<baweaver>
and I guarantee you it's something that needs to be broken into separate functions anyways
<Burgestrand>
postmodern: I guess I'd advise you to pick whichever you prefer. :)
<baweaver>
Honestly yard because there are plugins for sublime that auto-gen it
<baweaver>
and I'm a bit lazy like that
Pupeno has joined #ruby
<shevy>
that's ok
<shevy>
after building the dam, you need to relax
<postmodern>
Burgestrand, i'm asking because i maintain the ore project generator, trying to figure out the current defacto development preferences
<baweaver>
yard is probably the safe bet for now
nomad has quit [Ping timeout: 246 seconds]
<sphex>
baweaver: yeah... breaking down into multiple functions is probably always better. I argue about features that make large functions easier to deal with sometimes (like labelled loops too)... but large functions are bad. :/
<Burgestrand>
postmodern: I know, I just can't think of a compelling argument to argue for either one of those two.
<baweaver>
I had someone try and justify a 290 line method
<baweaver>
sufficient to say this same person may have driven me to a slight drinking binge...
<shevy>
the mother of all methods
<sphex>
ouch. "large" to me is less than a screenful...
Scroff has quit [Ping timeout: 250 seconds]
<baweaver>
turns out that by killing that method I took down the SQL queries related with that action by 98% and the code footprint by 60%
<ytti>
style question
<ytti>
var = string
<ytti>
var = another_string if condition1 and condition2
hotpancakes has quit [Remote host closed the connection]
<baweaver>
I tend to abhor variable mutation unless expressly necessary in ruby
williamherry has joined #ruby
<bnagy>
the most transparent is if else, but assignment in the if like that is a little ugly
<baweaver>
but that's stylistic as well
<ytti>
exactly
<baweaver>
also substantially easier to test and abstract out later
bhuvan_aurora has joined #ruby
<bnagy>
var = blah; if x && y var = otherblah is
bhuvanaurora has joined #ruby
<baweaver>
kinda nasty
<bnagy>
.. ok I guess. Mostly you can avoid the whole problem
j4cknewt has quit [Remote host closed the connection]
workmad3 has joined #ruby
<Burgestrand>
ytti: I don't mind longer pieces of code if they're more clear. I think both of your examples are fine, leaning more towards the first however. The surrounding code should also help you decide.
<baweaver>
honestly just use a ternary, or abstract the condition to a named variable
<Burgestrand>
Ternaries should however be avoided.
<bnagy>
never use ternary in ruby
<bnagy>
ever
<baweaver>
...why?
<damncabbage>
massive conflicting advice! must be monday
dfockler has joined #ruby
<bnagy>
it shouldn't even be in the language, it's one of the ancient perlisms
<ytti>
but now i know the potentially unnecessary assignment is very chea
<sevenseacat>
you better have some concrete reasoning for that one
<baweaver>
it's perfectly easy to read
<ytti>
var = method.do_something
j4cknewt has joined #ruby
<damncabbage>
var = if foo then bazbar else quux end? :D
<ytti>
consideration here is, that the assignment is very very cheap
<baweaver>
they don't
<sphex>
bnagy: it is well-known though...
<bnagy>
it's unreadable for no reason
<ytti>
if it owuld be something like
<ytti>
var = blaah if foo and bar
<ytti>
+p
<baweaver>
they just don't like it
<ytti>
then i would'nt do it
<bnagy>
postfix is with two conditions is not great
<bnagy>
sphex: no it's not
<bnagy>
unless you wrote perl or C
<baweaver>
that's your opinion
<sphex>
bnagy: or javascript or php
<bnagy>
if is well known
<baweaver>
it is
lele is now known as Guest24
<damncabbage>
ytti: But now you've created a variable that's nil (if it didn't already exist) if you don't match the "foo and bar" condition. D:
<baweaver>
I've worked with production code bases which use it liberally at top companies
<baweaver>
it's well known
yardenbar has joined #ruby
<sphex>
although PHP messed up and made it left-associative IIRC?
* damncabbage
winces
<damncabbage>
peter help you if you nest them
<baweaver>
I've written Perl and C though.
Pathfinder has joined #ruby
Volsus has joined #ruby
jaredrhine has joined #ruby
<baweaver>
Now if you _nest_ ternaries, you should be slapped
<sphex>
bnagy: it is hard to read though
workmad3 has quit [Ping timeout: 264 seconds]
<baweaver>
a single one? I don't see an issue.
<Burgestrand>
I agree, short ternaries are fine.
dfockler has quit [Ping timeout: 265 seconds]
<baweaver>
If you have to linebreak, switch it
<baweaver>
or factor out the conditional entirely.
<Ox0dea>
Can we talk about chaining post-conditions?
<sphex>
damncabbage: well you know.. there's that way you can lay out ternaries over multiple lines with the "?" and the ":" lined-up and it behaves like chained ifs.
<Burgestrand>
But don't use them to make your code smaller or dense, which is the only reason I can see for nesting them, and even that reason is a bad one.
<bnagy>
:|
<baweaver>
Ox0dea might have something to say on that one :D
<Ox0dea>
foo if a && b vs. foo if b if a.
DoubleMalt has joined #ruby
<bnagy>
the best thing about ternaries in ruby is how ?a :a and : a in a ternary are all actually different
<bnagy>
so much whitespace sensitivity! How great!
KnownSyntax has quit [Remote host closed the connection]
Musashi007 has joined #ruby
yayfoxes has quit [Quit: WeeChat 1.2]
KnownSyntax has joined #ruby
hotpancakes has joined #ruby
<apeiros>
>> 2/3r.class
<ruboto>
apeiros # => Class can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/393158)
<sphex>
I've been avoiding "smart matches" so far because I'm never sure what they do. I should read up on them. :/ good to know that it would explain grep too.
<apeiros>
it's also essential when you want to use case/when
<baweaver>
Ox0dea: Also, I ripped the entire Discourse spec library. Harvested description strings for describe / context / it blocks
<Ox0dea>
baweaver: For NLP, then?
<baweaver>
now for some natural language processing fun for patterns
<baweaver>
indeed
<baweaver>
See if there's enough recurrence to make a lexer for it
<baweaver>
I'd guess there is from what I can see
<baweaver>
Find distinct patterns, then shove them into a proper lexer / parser for that signature of sentence
<Ox0dea>
There's quite a bit of uniformity in that area, but you'll still need to "be liberal in what you accept".
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver>
indeed
<baweaver>
worst case it prompts for questions
mistermocha has joined #ruby
<baweaver>
which I can call Cold Reading :P
t_ has quit [Ping timeout: 264 seconds]
<Burgestrand>
Using case/when for testing class affiliation (which is often a bad idea in itself) has bitten me quite a few times, since the matching is performed with the when-part on the LHS, e.g. it uses String#===(object) instead of object#===(String).
GriffinHeart has quit [Remote host closed the connection]
<baweaver>
because === is defined on a per class basis
andikr has joined #ruby
<baweaver>
same with any other op
<Burgestrand>
No, because case/when uses the when-expression as the LHS instead of the RHS.
pengin has quit [Remote host closed the connection]
<baweaver>
of course
hotpancakes has quit [Ping timeout: 256 seconds]
mistermocha has quit [Read error: Connection reset by peer]
<baweaver>
case x when val => x.===(val)
nfk has joined #ruby
<Ox0dea>
Which makes perfect sense.
t_ has joined #ruby
<baweaver>
assuming you know it does that
<Ox0dea>
Right, but there's no more sensible alternative.
<baweaver>
=== is not an associative operator
<baweaver>
(most of the time)
<Burgestrand>
Assuming you have a method, which wants to test if its argument is a String (for some reason), you could do it by doing String === object, or object === String.
troulouliou_dev has joined #ruby
<Ox0dea>
Burgestrand: The latter would require every single class that wanted to implement #=== to do all sorts of nasty argument checking.
<Burgestrand>
Ox0dea: the former also gives you no way of forcing your way around the comparison.
ndrei has joined #ruby
<baweaver>
so is object
<baweaver>
why?
ohaibbq has quit [Quit: Leaving...]
<Ox0dea>
Yeah, I'm not seeing it. #=== is supposed to fill you with joy as soon as you discover how it works.
<Burgestrand>
If you have an object that behaves like a string, and quacks like a string, you can't get it past the String===object check unless it IS a string.
<Ox0dea>
>> class Foo < String; end; String === Foo.new
<Ox0dea>
That subclasses lose their identities so easily is unfortunate, but I don't think it's an argument against how #=== works.
<Burgestrand>
No, I'm just arguing that using case/when to check for class confirmance is bad. e.g. case foo when String.
<Ox0dea>
It'll work unless you're doing something wonky.
<baweaver>
^
mistermocha has quit [Ping timeout: 248 seconds]
<Burgestrand>
You should use duck typing.
<baweaver>
which gets back to what I said earlier, you're being a bit lofty thinking Ruby should respond like that
fabrice31 has joined #ruby
transiency has joined #ruby
<damncabbage>
is this a roundabout way of saying that oo and inheritance is terrible or
<Burgestrand>
And if you want to see if it's a string, you should test it with #is_a? or #kind_of?, since at least there's a way to work around that in case you want to send in an object that isn't a string but will behave the same.
Blaguvest has joined #ruby
solars has joined #ruby
t_ has quit [Ping timeout: 256 seconds]
ndrei has quit [Ping timeout: 252 seconds]
GriffinHeart has joined #ruby
<Burgestrand>
As opposed to using case/when which will leave me with no other option than to rewrite your method just because it was coded badly.
<baweaver>
Still not seeing this as an issue.
Timba-as has joined #ruby
<baweaver>
you want ruby to guess because of bad code?
<Burgestrand>
I guess you haven't encountered this.
workmad3 has joined #ruby
Volsus has quit [Quit: Leaving]
jesterfraud_afk is now known as jesterfraud
<Burgestrand>
baweaver: I don't understand your question.
<baweaver>
I avoid adding gems with annoying code
<Ox0dea>
Burgestrand: I'm afraid you're speaking nonsense. By default, Foo === obj is *equivalent* to obj.is_a?(Foo).
<baweaver>
indeed
<Burgestrand>
Ox0dea: no, there is no way to override Foo == = obj.
<Burgestrand>
Ox0dea: there is a way to override obj.is_a?(Foo).
<baweaver>
...it's a method
<Ox0dea>
...
<baweaver>
yeah you can
<Ox0dea>
Of course you can.
<Burgestrand>
Sure, you can redefine String#===.
<Burgestrand>
But are you seriously saying that's a good idea?
<baweaver>
we're saying you're doing something off
ferr has quit [Quit: WeeChat 1.2]
<Burgestrand>
Yeah, checking if something.is_a?(String) is seldom a good idea.
<Burgestrand>
But if you absolutely must check if something is a String, instead of relying on duck typing, allow the coder to work around your check without monkey-patching String#===.
<Ox0dea>
Yeah, it's a really elegant feature if you don't go out of your way to muck it up.
rdark has joined #ruby
solocsha1 has quit [Ping timeout: 255 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
<baweaver>
It kinda feels like you're saying your bike isn't working after you welded a plate to the chain
monod has joined #ruby
<baweaver>
and now insist that it's the bike manufacturers problem
msgodf has joined #ruby
<baweaver>
meanwhile we're all staring wondering how the devil you welded a plate to the chain, then shortly after why
ta has joined #ruby
<Burgestrand>
baweaver: could you speak with proper terms instead of comparing apples to oranges?
<baweaver>
then show us an example of this supposed monstrosity
wallerdev has quit [Quit: wallerdev]
<Burgestrand>
Absolutely!
hotpancakes has joined #ruby
<sphex>
thank god ruby doesn't automatically coerce values all over the place. this is the worse misfeature of so many OO languages...
<Burgestrand>
Oh god no I don't want PHP.
<baweaver>
javascript ==?
<Burgestrand>
I'm not talking about automatic coercion.
<apeiros>
you don't like how '5' + 1 == '51' and '5' - 1 == 4?
<Ox0dea>
Ruby does do a few weird coercions, though. :/
* apeiros
can't understand that… it seems to be such a nice feature</sarcasm>
bruno- has joined #ruby
<baweaver>
that's one reason why ruby making operators methods is handy
<apeiros>
Ox0dea: the only ones I don't like is nil.to_i == 0 and Integer(10, base) complaining - which ones do you dislike?
<sphex>
apeiros: yeah.. and boolean coercions especially. and when everything just turns into a string whenever. :/
<Ox0dea>
apeiros: I mostly had nil.to_i in mind as well, but String << Numeric is also a little weird.
<sphex>
Ox0dea: oh really?
<Ox0dea>
sphex: I mean, I love it and use it, but it's slightly surprising.
<apeiros>
sphex: I don't think ruby does any boolean coercions? any example?
<Ox0dea>
It also does behave the same for IO objects.
<Ox0dea>
*doesn't
<apeiros>
ah. I see. I don't think I've ever used String#<<(Int)
<sphex>
Burgestrand: ok yeah sorry I wasn't really following. I get that "to_s" should be used in many cases.
<Ox0dea>
apeiros: It's handy for shoveling Unicode characters without getting yelled at about encodings.
<Ox0dea>
Bit of an outdated problem, of course.
<apeiros>
seems I never had the need for that :)
hotpancakes has quit [Remote host closed the connection]
jaredrhine has quit [Quit: No Ping reply in 180 seconds.]
devbug has joined #ruby
<Ox0dea>
Burgestrand: That monstrosity you promised?
devbug has quit [Remote host closed the connection]
<Burgestrand>
Ox0dea: soon!
<Ox0dea>
All right, then. I figured you had it to hand.
bruno- has quit [Ping timeout: 255 seconds]
mesamoo has quit [Ping timeout: 276 seconds]
<Burgestrand>
Ox0dea: I've done my best to forcefully forget I ever encountered them.
mesamoo has joined #ruby
<apeiros>
ah, right, and I don't like the autosplatting. I don't see the reason for it either. I mean it's not like adding a "*" would be so much effort…
<baweaver>
Ox0dea: you like monstrosities
<Ox0dea>
I love them.
<Ox0dea>
apeiros: Like for puts, you mean?
jaredrhine has joined #ruby
<apeiros>
no, I mean `a, b = array`
<apeiros>
it's not difficult to be explicit: `a, b = *array`
codecop has joined #ruby
<Ox0dea>
But destructuring is a great thing!
<Ox0dea>
I think Ruby needs more of it.
<apeiros>
not the same :)
<Ox0dea>
Isn't it?
ndrei has joined #ruby
<apeiros>
no
<apeiros>
destructuring is explicit too
devbug_ has quit [Ping timeout: 250 seconds]
<apeiros>
you have to put the parens where you want to destructure.
<baweaver>
{a: 1, b: 2}.slice([:a, :b]) will return jack
<Burgestrand>
baweaver: ^
mesamoo has quit [Ping timeout: 256 seconds]
<Ox0dea>
baweaver: As expected, no?
<baweaver>
I'd think it'd auto splat
<Burgestrand>
Ox0dea: which of the three read_file would you prefer?
k3asd` has joined #ruby
<baweaver>
class FakeIO; def ===(other) is_a?(other) end end
<baweaver>
?
fantazo has joined #ruby
khebbie has joined #ruby
<Burgestrand>
baweaver: to alleviate which method?
<Burgestrand>
baweaver: read_file?
<apeiros>
baweaver: ah, that's not actually one of my cases
eGGsha has joined #ruby
<baweaver>
but an annoying one to be wary of
<baweaver>
caused me all types of headaches before.
<baweaver>
speaking of which, I should make a PR on that one....
<baweaver>
Burgestrand: yeah
eGGsha has joined #ruby
<Burgestrand>
baweaver: it won't work.
<Ox0dea>
apeiros: You meant that there are times when you can't pluck out exactly which elements you want from an arbitrarily nested array in a single parallel assignment?
<Burgestrand>
baweaver: the output will be the same.
ndrei has quit [Ping timeout: 276 seconds]
ljt has joined #ruby
pandaant has joined #ruby
<apeiros>
Ox0dea: my memory is really vague on it :(
<Ox0dea>
Fair enough, but I'd be interested to see where the semantics break down.
hotpancakes has quit [Remote host closed the connection]
<sphex>
doesn't lack of "real" multiple return values support bother anyone? for symmetry! functions should both accept and return multiple values. and ([1, 2, 3]) should be distinguishable from (1, 2, 3) in both cases.
<Burgestrand>
I don't know any good way of getting FakeIO to work with #read_file without monkey patching either IO or StringIO.
<Burgestrand>
(or rewriting #read_file)
damncabbage has left #ruby [#ruby]
<baweaver>
inherit from IO or StringIO, and === will work
<ljarvis>
^
<baweaver>
anyways, I need to get to bed.
hotpancakes has joined #ruby
<Burgestrand>
Inheriting from IO or StringIO leaves you open to a big chunk of nice bugs from the core classes not expecting to be inherited from.
<Burgestrand>
Rails had quite many troubles from inheriting from Hash back in the day.
<Burgestrand>
Not to mention it's not always an option if you already have a superclass.
fantazo has quit [Ping timeout: 252 seconds]
jaredrhine has quit [Quit: No Ping reply in 180 seconds.]
white_bear has joined #ruby
d0lph1n98 has quit [Quit: leaving]
<adaedra>
Hello
<Burgestrand>
(e.g. it's an ActiveRecord model)
<Burgestrand>
Hi!
hotpancakes has quit [Ping timeout: 264 seconds]
blackmesa has joined #ruby
chinmay_dd has quit [Ping timeout: 255 seconds]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
jaredrhine has joined #ruby
bayed has joined #ruby
baweaver has quit [Remote host closed the connection]
<shevy>
sphex never bothered me much at all; I usually use an Array and that was that really. Is there a real advantage that multiple values have versus arrays?
kp666 has joined #ruby
frekoya_ has joined #ruby
gagrio has joined #ruby
wldcordeiro has quit [Remote host closed the connection]
Rollabunna has joined #ruby
<sphex>
shevy: similar advantage to not having to pass an array to each function that takes more than one argument
wldcordeiro has joined #ruby
havenwood has quit [Ping timeout: 246 seconds]
timonv has joined #ruby
Scroff has joined #ruby
olistik has joined #ruby
jaredrhine has quit [Quit: No Ping reply in 180 seconds.]
<Ox0dea>
sphex: Why isn't splatting the solution?
<sphex>
shevy: and when returning an array, the caller as to expect it and destructure it. the "extra" return values cannot be ignored. in lisp, it is common to return multiple values with the expectation that most caller will only ever use (or even know about) the first one. but this is arguably less "symmetrical".
<Ox0dea>
sphex: Ruby lets us ignore values just fine.
livathinos has joined #ruby
bhuvanaurora has quit [Ping timeout: 276 seconds]
bhuvan_aurora has quit [Ping timeout: 264 seconds]
<sphex>
Ox0dea: but you have to explicitly do so right?
choke has joined #ruby
jaredrhine has joined #ruby
Rollabunna has quit [Ping timeout: 244 seconds]
<shevy>
yeah
<shevy>
*array
mburns has joined #ruby
<sphex>
a function can be extended to have more arguments will still supporting older callers. but, IIUC, not so when switching from returning just one value to returning multiple ones.
<sphex>
*while
jeanlinux has joined #ruby
<Ox0dea>
sphex: foo, _ = *bar will put the "first" returned value in foo, even if bar returns a non-array.
hotpancakes has joined #ruby
jeanlinux has quit [Read error: Connection reset by peer]
<Ox0dea>
All of the pieces are in place to make argument passing and reception behave however you need it to.
oo_ has quit [Remote host closed the connection]
marr has joined #ruby
fantazo has joined #ruby
<sphex>
Ox0dea: yeah, but each callers have to do that. and they cannot do it in all cases; a function that returns just one value must not be destructured like that.
<Ox0dea>
sphex: Try it.
elia has joined #ruby
bubbys has joined #ruby
Scroff has quit [Ping timeout: 250 seconds]
yh has quit [Ping timeout: 252 seconds]
wldcordeiro has quit [Remote host closed the connection]
<shevy>
I really don't understand the problem, if it returns an array, you can check for that anyway and just apply [0] or .first?
lee-jon has joined #ruby
lee-jon has left #ruby [#ruby]
ferr has joined #ruby
EU826012240 has joined #ruby
j4cknewt has joined #ruby
oo_ has joined #ruby
EU826012240 has quit [Client Quit]
Scroff has joined #ruby
TheHodge has joined #ruby
tlolczyk has quit [Ping timeout: 256 seconds]
<sphex>
well.. it's not a problem, it's just a different way of doing it. the advantage it has is mostly that you can have optional return values (just like you can have optional arguments). and the callers do not have to be coded specially to handle it, and there's no risk of an array value being mistakenly destructured (because multiple return values are different from returning an array, (just like for arguments)).
gix has quit [Ping timeout: 276 seconds]
MisterRusty has joined #ruby
christiandsg has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
dumdedum has joined #ruby
iamninja has joined #ruby
hotpancakes has quit [Remote host closed the connection]
ht__ has joined #ruby
transiency has quit [Ping timeout: 252 seconds]
einarj has joined #ruby
f3lp has quit [Ping timeout: 252 seconds]
<sphex>
I think lisp handled that really well. perl bastardized it a bit. then scheme generally made returning an unexpected amount of values an error; and thus much less useful.
senayar has quit [Remote host closed the connection]
elia_ has joined #ruby
Scrofff has joined #ruby
mistermocha has joined #ruby
<Ox0dea>
sphex: Why do you say Lisp supports returning multiple values?
christiandsg has quit [Ping timeout: 265 seconds]
bluOxigen has joined #ruby
<sphex>
well, CL
<Ox0dea>
In most Lisps, you return a list of multiple values, and then there's some mechanism for extracting its elements. That's exactly what we have in Ruby, is it not?
<adaedra>
Tuples?
<adaedra>
(for Lisp)
einarj has quit []
cb_ has quit [Remote host closed the connection]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Scroff has quit [Ping timeout: 246 seconds]
eGGsha has joined #ruby
<Ox0dea>
sphex: Given `def foo; return 1, 2; end`, you'd want `bar = foo` to be 1?
cb_ has joined #ruby
cb_ has quit [Changing host]
cb_ has joined #ruby
elia has quit [Ping timeout: 256 seconds]
bhuvanaurora has joined #ruby
monod has quit [Remote host closed the connection]
bhuvan_aurora has joined #ruby
<sphex>
no, returning multiple values is done using the (values) form
<sphex>
the semantics are a bit different
<sphex>
it all has to do with what happens when the caller expects or does not expect multiple values
Scroff has joined #ruby
mistermocha has quit [Ping timeout: 248 seconds]
<Ox0dea>
You end up doing some form of destructuring regardless, so I'm afraid the crucial difference is lost on me.
Scrofff has quit [Ping timeout: 250 seconds]
<sphex>
in scheme, they say the continuation of a function call (which can also be represented as a function) can take a variable amount of arguments. the (values 1 2 3) form calls its continuation with these arguments (which will be the return values of the function if this is a tail call).
eGGsha has quit [Ping timeout: 248 seconds]
cb_ has quit [Ping timeout: 265 seconds]
<sphex>
Ox0dea: but if the caller does not expect multiple return values, then the "destructuring" is automatic and it only gets the first value. this is similar to how "optional" arguments of a function work.
eGGsha has joined #ruby
<Ox0dea>
sphex: Then the example I gave above is in fact how you'd like Ruby to do it?
<sphex>
Ox0dea: yeah.. but automatically. and for that, it would have to know if a function intended to return multiple values, or was merely returning an array.
fantazo has quit [Ping timeout: 250 seconds]
* Eising
stares into 230 lines of incomprehensible, and non-working code
<Eising>
code of the kind that "used to work"
<Ox0dea>
Eising: Did you recently gem up?
<sphex>
if functions always returned arrays to represent their return values, then it could be done unambiguously. and it would be more similar to how arguments are handled.
yh has joined #ruby
<Eising>
Ox0dea: not at all
ruurd has joined #ruby
<Ox0dea>
Eising: The bit rot is real!
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Eising>
Ox0dea: but since it's handling external data, it might be that the format of that could have changed just ever so slightly
<sphex>
I must sound pedantic as s**t. there's a small difference dammit. it's important. it's slightly better.
<Ox0dea>
sphex: It's "better" if you don't perceive it as bad API design.
<ljarvis>
maybe we should just inherit tuples and pattern matching
<sphex>
Ox0dea: not any worse than optional arguments (which are plenty useful, and so are optional return values (if the callers do not have to explicitly expect them))
<Ox0dea>
sphex: Yes, that last bit is the crux of my opposition.
granthatcher has joined #ruby
yh has quit [Ping timeout: 276 seconds]
hotpancakes has joined #ruby
doertedev has joined #ruby
<sphex>
IIRC, in ML they decided to make things symmetrical by allowing only one argument too. both multiple arguments and return values need to be explicitly destructured. sounds nice, but it makes optional arguments/return values a problem.
Scroff has quit [Ping timeout: 244 seconds]
hotpancakes has quit [Ping timeout: 256 seconds]
<sphex>
I guess if ruby supported MRV (mulpliple retrnvlal..ues) it could look like this `def f; values 1, 2, 3; end`. and then called like that: `a = f # a=1` or `a, b = f # a=1, b=2`. it would be just like lisp then. the key point is that it always happens, no need to explicitly destructure when just one value is expected.
<Ox0dea>
One of the most practical use cases for multiple return values is being able to signal errors, which really ought to be ignored explicitly if at all.
frem has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
viki_ has joined #ruby
Rickmasta has joined #ruby
fabrice31 has joined #ruby
<sphex>
oh yeah. good point for errors. another use is to yield an extra "detail" value. possibly best solved with OO features. but then one could argue the same for multiple arguments too.
<ruboto>
adaedra # => /tmp/execpad-b09b0a224f70/source-b09b0a224f70:2: syntax error, unexpected tIDENTIFIER ...check link for more (https://eval.in/393244)
<shevy>
tbuehlmann for some strange reason, I read your nick as "Wühlmaus"
thumpba has joined #ruby
<ljarvis>
:/
<Ox0dea>
>> class Foo; %w[+@ -@ ! ~].each { |m| alias_method m, :itself } end; ~+-~-!!+~!-++Foo.new
<Ox0dea>
Fun fact: There's a bug in the parser that prevents you using !~ as a unary combination.
anisha has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dgutierrez1287 has quit [Ping timeout: 264 seconds]
thumpba has quit [Client Quit]
Rollabunna has joined #ruby
_blizzy_ has joined #ruby
maasha has joined #ruby
eGGsha has joined #ruby
<tbuehlmann>
looks like I can't have a default value for that parameter then *shrug*
dellavg has quit [Remote host closed the connection]
hotpancakes has joined #ruby
<adaedra>
{ foo: nil }.merge hash
<maasha>
I am running mpiexec from a ruby script using a system call. Unfortunately the system call returns successfully before the actually mpi execution is complete. How to properly wait for that?
eGGsha has quit [Client Quit]
iwishiwerearobot has joined #ruby
<tbuehlmann>
or not using keyword arguments here and a positional parameter instead
dellavg has joined #ruby
chinmay_dd has joined #ruby
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
<Ox0dea>
maasha: Doesn't that defeat the point of running in parallel?
Rollabunna has quit [Ping timeout: 248 seconds]
<maasha>
Ox0dea: the ruby script should not continue until the mpiexec is done
varunwachaspati has quit [Remote host closed the connection]
krz has joined #ruby
bhuvan_aurora has quit [Ping timeout: 252 seconds]
bhuvanaurora has quit [Ping timeout: 252 seconds]
t_ has quit [Ping timeout: 276 seconds]
varunwachaspati has joined #ruby
eGGsha has joined #ruby
<Ox0dea>
maasha: I'm not familiar with mpiexec specifically, but waiting on something whose raison d'être is asynchronicity seems counter-productive at best.
<Ox0dea>
Well, no, I suppose you're using mpiexec for the free speed boost rather than its parallelism.
aryaching has quit [Ping timeout: 256 seconds]
t_ has joined #ruby
<Ox0dea>
It almost certainly forks into a bunch of separate processes, so you'll need to get all those PIDs and wait for them to die.
<Ox0dea>
Nothing clean immediately springs to mind.
<shevy>
The Oracle is pondering the situation at hand.
sevenseacat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Blaguvest has quit [Ping timeout: 244 seconds]
varunwachaspati has quit [Remote host closed the connection]
aryaching has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
varunwachaspati has joined #ruby
hotpancakes has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
GriffinHeart has quit [Remote host closed the connection]
arup_r has joined #ruby
senayar has quit [Remote host closed the connection]
dionysus69 has joined #ruby
bhuvan_aurora has joined #ruby
djbkd has quit [Remote host closed the connection]
yh has joined #ruby
Musashi007 has joined #ruby
sevenseacat has joined #ruby
ndrei has joined #ruby
workmad3 has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dionysus69 has quit [Client Quit]
haraoka has joined #ruby
<maasha>
Ox0dea: so I am running a 1 core ruby script here that starts a mpi job on some thousand cores. When that job is done the ruby script should continue.
<maasha>
Ox0dea: yes, I can't seem to find a clean solution either
bhuvanaurora has joined #ruby
<Ox0dea>
maasha: Right, the problem is that mpiexec spawns a bunch of processes and then terminates, so you won't be able to determine when to continue based on mpiexec's termination.
lkba_ has quit [Ping timeout: 255 seconds]
<Ox0dea>
You'll need to round up all the processes it spawns and continue only once they've all died.
<Ox0dea>
I don't believe Ruby provides any "magic" for doing this cleanly.
<maasha>
Ox0dea: exactly. So how to do this?
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<maasha>
Ox0dea: or maybe mpi have some magic.
<Ox0dea>
It might.
workmad3 has quit [Ping timeout: 246 seconds]
granthatcher has quit []
<yorickpeterse>
morning
senayar has joined #ruby
<adaedra>
hi yorickpeterse
elia has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hotpancakes has joined #ruby
elia_ has quit [Ping timeout: 276 seconds]
davedev24_ has joined #ruby
blueOxigen has joined #ruby
olistik has quit [Ping timeout: 250 seconds]
bluOxigen has quit [Ping timeout: 264 seconds]
mistermocha has joined #ruby
iwishiwerearobot has quit [Quit: Be back later ...]
tkuchiki has quit [Remote host closed the connection]
solocsha1 has joined #ruby
Pathfinder has quit [Remote host closed the connection]
platzhirsch has joined #ruby
platzhirsch has quit [Client Quit]
davedev2_ has joined #ruby
eGGsha has joined #ruby
workmad3 has joined #ruby
platzhirsch has joined #ruby
hotpancakes has quit [Ping timeout: 252 seconds]
<Ox0dea>
maasha: Do you know how to look at the list of running processes?
<Ox0dea>
Well, mpiexec has an option for printing its PID, which wouldn't make sense if it's terminating immediately, so it must be the case that it's simply signalling that it has terminated without actually having done so. You should be able to run it, then query the process table and wait for its PID to no longer be in there.
davedev24_ has quit [Ping timeout: 248 seconds]
CatMartyn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<maasha>
Ox0dea: process table on which nodes ?
<maasha>
:o)
<Ox0dea>
maasha: The process table on your local machine.
chinmay_dd has quit [Read error: Connection reset by peer]
<maasha>
Ox0dea: hm, right.
chinmay_dd has joined #ruby
<maasha>
-report-pid looks like it
olistik has joined #ruby
lkba has joined #ruby
Spami has joined #ruby
<Ox0dea>
maasha: pid = `mpiexec -report-pid - ...`; while sleep 1; break if `ps ax -opid=-`.lines.include?(pid); end
<Ox0dea>
Something along those lines.
iwishiwerearobot has joined #ruby
<Ox0dea>
Adjust the sleep interval and ps flags as necessary.
tkuchiki has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
<maasha>
Ox0dea: yup, I am working on it.
olistik has quit [Ping timeout: 244 seconds]
platzhirsch has quit [Read error: Connection reset by peer]
platzhirsch has joined #ruby
<Ox0dea>
maasha: If you know you'll only have one instance of mpiexec running at any one time, you could probably get away with doing `break if system('pgrep mpiexec')`.
bhuvanaurora has quit [Ping timeout: 246 seconds]
bhuvan_aurora has quit [Ping timeout: 246 seconds]
j4cknewt has quit [Remote host closed the connection]
<maasha>
Ox0dea: Unfortunately, these supercomputers are shared :o(
<Ox0dea>
maasha: Right, but the actual mpiexec process is being run locally, no?
<maasha>
Ox0dea: it is run from the login node.
<Ox0dea>
Ah, that certainly complicates things.
<Ox0dea>
Still, checking for the PID of your mpiexec in the process table should do.
<maasha>
Ox0dea: yes
jfarmer has quit []
Rollabunna has joined #ruby
hectortrope has joined #ruby
aryaching_ has joined #ruby
Scrofff has quit [Remote host closed the connection]
Scroff has joined #ruby
Scroff has quit [Remote host closed the connection]
Scroff has joined #ruby
aryaching has quit [Ping timeout: 276 seconds]
<bnagy>
.. wait how are you starting mpiexec?
<bnagy>
are you sure you're not just failing to wait on it?
<bnagy>
the manpage suggests it shouldn't exit until all the processes it spawned have exited
Scroff has quit [Remote host closed the connection]
Rollabunna has quit [Ping timeout: 248 seconds]
Scroff has joined #ruby
Scroff has quit [Remote host closed the connection]
blackmesa has joined #ruby
Scroff has joined #ruby
oo_ has quit [Remote host closed the connection]
dellavg has quit [Remote host closed the connection]
bhuvan_aurora has joined #ruby
dellavg has joined #ruby
bhuvanaurora has joined #ruby
alex88 has joined #ruby
<Ox0dea>
bnagy: They said they're shelling out and seeing immediate continuation of the Ruby script.
olistik has joined #ruby
Scroff has quit [Remote host closed the connection]
Scroff has joined #ruby
inukshuk has quit [Quit: Lost terminal]
parabolize has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
khebbie has joined #ruby
<bnagy>
but there are about 8 ways to shell out
oo_ has joined #ruby
inukshuk has joined #ruby
oo_ has quit [Remote host closed the connection]
<Ox0dea>
bnagy: They specifically mentioned using system().
<Ox0dea>
Which waits.
arturmartins has joined #ruby
<bnagy>
it does. But it's worth double checking, because that doesn't make sense.
zz_Outlastsheep is now known as Outlastsheep
danielglh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
catphish has joined #ruby
<catphish>
is there any way i could get sysconf variables in ruby 1.9.3?
<Ox0dea>
catphish: RbConfig is bound to have them.
<catphish>
Etc has them in 2.0
oo_ has joined #ruby
christiandsg has joined #ruby
<Ox0dea>
catphish: Looks like you might need to use Fiddle/FFI. :(
<catphish>
actually... my reason for using ruby 1.9.3 is misplaced
<catphish>
ubuntu support 2.0 as well
<ddv>
1.9.3 is EOL don't use it
<catphish>
ddv: not helpful
<ddv>
catphish: truth hurt doesn't it
<ddv>
hurts*
<catphish>
ddv: unfortunately, the ruby developers deciding a release is EOL doesn't mean it's not the supported version of supported distros
<catphish>
as per my comment above, luckily ubuntu LTS also supports 2.0
williamherry has quit [Ping timeout: 248 seconds]
<catphish>
i hope this will be true of other distros too
<Ox0dea>
Ubuntu should be EOL'd. :)
<catphish>
sysconf isn't supported in 2.0.0 either :(
<catphish>
so that's no further forward
<catphish>
Ox0dea: i can probably do it with ffi, but that adds a ton of dependencies for what is essentially just fetching a constant :(
ixti has quit [Ping timeout: 264 seconds]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
jbw_ has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
Rollabunna has joined #ruby
senayar has quit [Remote host closed the connection]
j4cknewt has joined #ruby
fabrice31 has quit [Ping timeout: 276 seconds]
freemahn has quit [Remote host closed the connection]
Rollabunna has quit [Ping timeout: 246 seconds]
alienaut has joined #ruby
fella5s has joined #ruby
j4cknewt has quit [Ping timeout: 246 seconds]
<arup_r>
Hi All
<arup_r>
how are you guys?
<adaedra>
hi
<arup_r>
adaedra: 0/
matp has joined #ruby
<[k->
you should use a small o >.<
<adaedra>
\ø
<arup_r>
[k-: But my head in Big oval shape :/
<arup_r>
*is
<sphex>
*gasps* he said "guys"
<arup_r>
hehe
<sevenseacat>
?guys arup_r
<ruboto>
arup_r, we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
<arup_r>
you listed event this stuff also
<arup_r>
omg!
<[k->
?omg
<ruboto>
I don't know anything about omg
ndrei has quit [Ping timeout: 265 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<arup_r>
ruboto: you shouldn't know everything!
<arup_r>
:p
lessless has joined #ruby
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<[k->
?xy
arup_r has quit [Remote host closed the connection]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_whitelogger_ has quit [Ping timeout: 252 seconds]
_whitelogger_ has joined #ruby
dhjondoh1 has joined #ruby
blackmes1 has quit [Ping timeout: 256 seconds]
jaimessi has joined #ruby
serivichi has joined #ruby
elektronaut has joined #ruby
serivich has quit [Ping timeout: 255 seconds]
drPoggs has joined #ruby
dhjondoh has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
<shevy>
This is how a meow sounds from the Oracle.
<Ox0dea>
You have cat to be kitten me right meow.
<adaedra>
...
<[k->
The most elegant way to switch keys and values would be hash#invert
<Outlastsheep>
I think we just crossed the fe-line.
<adaedra>
#ruby-puns
aryaching_ has quit [Ping timeout: 250 seconds]
jenrzzz has joined #ruby
<[k->
pls
<shevy>
[k- are you reading ruby docu again
<Ox0dea>
[k-: Hash#invert is very nice.
<[k->
is that a bad way to learn
<yh>
Ox0dea: neat. Don't think I've had to do that before.
<Ox0dea>
yh: Which is that?
<Ox0dea>
shevy: You didn't know about Hash#invert?
<yh>
Ox0dea: the thing you just mentioned
<yh>
Hash#invert
<[k->
to be fair, I didn't too
<shevy>
I know everything
<[k->
lies, shevy!
<adaedra>
except Hash#invert
<[k->
we all saw you make a grave mistake in front of #ruby!
<shevy>
I have it well covered in beautiful german words
<[k->
*misconception
<adaedra>
»scheiße«
<shevy>
hehe
jaygen_ has joined #ruby
<Ox0dea>
I vividly remember the first time I used Hash#invert.
mesamoo has joined #ruby
<Ox0dea>
It was a super-clean way to implement jumps in both directions for my brainfuck interpreter.
<[k->
The Oracle is reminiscing the past!
dhjondoh has joined #ruby
<Ox0dea>
Ah, it seems like thirty years ago. :/
<yh>
Time dilation is a beautiful thing in this finite experience of life
ndrei has quit [Ping timeout: 250 seconds]
jaygen has quit [Ping timeout: 248 seconds]
<[k->
The Oracle has endured life for long, no longer is time important a detail.
bruno- has joined #ruby
<shevy>
damn it
arup_r has joined #ruby
dgutierrez1287 has joined #ruby
<shevy>
there are baby oracles here now
dhjondoh1 has quit [Ping timeout: 252 seconds]
c355E3B has joined #ruby
<shevy>
#ruby is beginning to scare me :\
<adaedra>
boo.
<adaedra>
3spooky5u
<shevy>
[k- on a happy note, I am at about 90% finished of the rewrite I started 5 days ago! \o/
<[k->
I am happy about the refactoring of my code!
<[k->
do you want to see it shevy?
joonty has joined #ruby
bronson has joined #ruby
icosa1 has quit [Read error: Connection reset by peer]
<shevy>
ack
<shevy>
is that the code that is unreadable?
<shevy>
where even the Oracle's code became more readable
<sevenseacat>
[k-: ah, you are studying under Ox0dea i see
<[k->
yes :>
dgutierrez1287 has joined #ruby
<Ox0dea>
I am so glad I have a student in such a strange classroom. :)
danielglh has quit [Max SendQ exceeded]
tkuchiki has quit [Remote host closed the connection]
ndrei has joined #ruby
<[k->
oh you just negate the number
<[k->
I did 1-2 to get -1
<[k->
lel
krz has quit [Ping timeout: 248 seconds]
lennae has quit [Ping timeout: 255 seconds]
sgambino has joined #ruby
<Ox0dea>
Well, I start _ out as 1, but then I reassign it to 2 ** 2 ** -1, which becomes ~1.4, then I just divide that by 0.0.
hotpancakes has joined #ruby
<[k->
my magic number was ~0.7
dionysus69 has joined #ruby
JohnBat26 has joined #ruby
<Ox0dea>
Ruby lets you refer to a variable's previous value within a redefinition.
<Ox0dea>
[k-: How come you're assigning _ = $_ (1) / $__ (2) == 0?
<[k->
that was my fake zero, I used it to do 0**0.7
oo_ has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
pusewicz has quit []
pusewicz has joined #ruby
<Ox0dea>
I see.
millerti has joined #ruby
<sevenseacat>
ah, the decoy fake zero
<sevenseacat>
a time-honoured tactic
<Ox0dea>
Yours simplifies to 1 / 0 ** sqrt(2) ** sqrt(2), but I can't say you didn't get there.
<[k->
redundant is redundant tho :p
hotpancakes has quit [Ping timeout: 264 seconds]
<Ox0dea>
Just a little. :)
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
railsraider_ has joined #ruby
railsraider has quit [Read error: Connection reset by peer]
railsraider_ is now known as railsraider
harleypig has quit []
harleypig has joined #ruby
<Eising>
is there a Hash method I'm overlooking? I'd like to do the equivalence of a #select, but also remove the members I return... #select! does exactly the opposite of what I want.
<apeiros>
then reject! probably?
decoponio has joined #ruby
<Eising>
apeiros: no, it returns the members it doesn't match
vcoinminer has quit []
ljt has joined #ruby
JDiPierro has joined #ruby
<[k->
yours is _=1;_=(2)^(0.5)=1.4;1.4/0
vcoinminer has joined #ruby
<Ox0dea>
[k-: Indeed. :)
<[k->
took me long enough :p
fabrice31 has quit [Read error: Connection reset by peer]
fabrice31 has joined #ruby
oo_ has quit [Remote host closed the connection]
<Ox0dea>
Eising: I don't think you'll be able to do it with just one method call.
<Ox0dea>
Hash#delete_if might've been your savior, but it returns the new Hash.
decoponyo has quit [Ping timeout: 248 seconds]
<Eising>
Ox0dea: right, makes sense
lennae has joined #ruby
<[k->
so you want the members to be extracted out of the hash?
<Ox0dea>
Remove and return.
<Eising>
Yes, well, thing is I have a rather large Hash that I'm dividing based on something the members has
<Eising>
so in order to speed up the process, I wanted to remove already divided members, so it would be continuously faster
<Ox0dea>
Eising: And how come you need to know which ones got removed?
<Eising>
Ox0dea: because I run them through an each loop
ndrei has quit [Ping timeout: 246 seconds]
phutchins has joined #ruby
avdi has quit []
<Ox0dea>
Ah, so you want to partition the Hash into those elements which match some criteria and those that don't?
jeregrine has quit []
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
avdi has joined #ruby
symm- has joined #ruby
jeregrine has joined #ruby
JDiPierro has quit [Remote host closed the connection]
<sevenseacat>
ooh i see what you did there
<Ox0dea>
^_^
<Eising>
so, basically "1) Get all members where element1 == foo1 2) do stuff with them, 3) Get all members where element1 == foo2, 4) do stuff with them, etc"
segmond has quit [Ping timeout: 248 seconds]
<Ox0dea>
Eising: Right, Hash#partition should do the trick if you don't mind overwriting the original variable.
<Ox0dea>
Eising: map { |foo| Hash[foo] } instead of the much nicer map(&:to_h). :/
yh has quit [Ping timeout: 276 seconds]
<Eising>
that was simple...
<Ox0dea>
Yay, Ruby!
<Eising>
I need more coffee it seems
<TheBrayn>
Ox0dea: I still have no clue what you are hinting at
Rollabunna has quit [Ping timeout: 246 seconds]
<[k->
>> '\'
<ruboto>
[k- # => /tmp/execpad-5bd1b2d62981/source-5bd1b2d62981:2: unterminated string meets end of file ...check link for more (https://eval.in/393403)
<Ox0dea>
TheBrayn: You should learn about how single-quoted strings are different from double-quoted strings.
<jhass>
TheBrayn: I'm guessing right in that you're trying to build a regexp?
<TheBrayn>
jhass: yes
<jhass>
TheBrayn: if all the regexp contains is some static sequence, why do you need one?
segmond has joined #ruby
lennae has quit [Ping timeout: 265 seconds]
<TheBrayn>
because the configfile output requires it
<jhass>
where's that documented?
riotjones has quit [Quit: Leaving...]
rbennacer has quit [Remote host closed the connection]
bf4 has joined #ruby
<jhass>
can you quote some docs like "You're not allowed to use any other ruby code than this construct that has to contain a regular expression" ?
jaimessi has quit [Read error: Connection reset by peer]
<TheBrayn>
do you want to discuss the documentation of non-public software?
mistermocha has joined #ruby
<jhass>
I just question that statement
NeverDie has joined #ruby
<[k->
we should go through all the logs of #ruby and grep Ox0dea!
<Ox0dea>
TheBrayn: That you're using a Regexp in #gsub complicates things; you know you can pass it a String as the first argument, right?
<jhass>
since your example is =~ regexp, that looks like ruby
duggiefresh has joined #ruby
<TheBrayn>
it's not ruby it's part of an intranet software
duggiefresh is now known as Guest64664
<TheBrayn>
and it just wants it that way for whatever reason
axl_ has joined #ruby
lennae has joined #ruby
ruby-lang240 has joined #ruby
bf4 has quit [Ping timeout: 256 seconds]
r__rios has joined #ruby
<jhass>
well, then get clear on the differences between representation and actual value and how you inspect the result
<ruby-lang240>
hi, how can i call a module name dynamically by variable? module_name = "Module1"; module_name::some_method
mistermocha has quit [Ping timeout: 246 seconds]
<jhass>
ruby-lang240: remove the quotes
<Ox0dea>
ruby-lang240: You shouldn't do that, but you want const_get.
<jhass>
modules are just objects assigned to a constant
<quazimodo>
bear in mind that CompaniesIncludes is consuming an API via some wrapper
Xeago has quit [Remote host closed the connection]
<quazimodo>
in fact, this object is a strategy to get the CompanyIncludes of a larger query that hits many APIs. There are also CountriesIncludes, IndustriesIncludes, etc
<quazimodo>
I think the enumerable object makes most sense and has least cruft, eh?
<[k->
?xy quazimodo
<ruboto>
quazimodo, it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<maloik>
my gut reaction is to use something like CI.new(query).results, or even #query or so
poikon has joined #ruby
<quazimodo>
[k-: well i find myself fighting this all the time
<quazimodo>
in this one case, yeah you may be right
<quazimodo>
still, i have service objects all the time with MyDataClass.new(whatever).call
<quazimodo>
why do i even have .call??
<[k->
don't worry I'm always wrong
victortyau has joined #ruby
<ddv>
lol
<[k->
quazimodo, could you explain your problem :(
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k->
s/explain/describe
xcesariox has joined #ruby
JDiPierro has joined #ruby
<quazimodo>
[k-: so I have 4 of these classes. All they do is take a list of keys, eg [423, 598, 342] and then return a collection of objects related to those keys. In this exact case, the keys are ids of Company objects living in some restful api I have access to. Industries i don't actually hit any api, i have a big data list so the expected behaviour would be to pass in a set of indsutry codes, and get the industry objects back as a collection
maasha has quit [Quit: Page closed]
malconis has joined #ruby
Xeago has joined #ruby
roshanavand has joined #ruby
tkuchiki has joined #ruby
<quazimodo>
which one of those 4 classes i actually use depends entirely on what the user clickson the front end
<quazimodo>
if they check 'companies' then i use the companies_includes strategy
malconis has quit [Remote host closed the connection]
semajs has joined #ruby
Xeago has quit [Remote host closed the connection]
<quazimodo>
the CompaniesIncludes needs to get data from remote source, IndustriesIncludes has access to an object that has all the industries
malconis has joined #ruby
<[k->
so basically, you have a frontend with a drop down list
<[k->
like an about page
<[k->
choose one to view about
<[k->
"companies", " industries " etc
JDiPierro has quit [Ping timeout: 244 seconds]
<quazimodo>
something like that (actually far more complicated but not important for this instance, user specifies which includes they want to see)
<quazimodo>
and that's a small part of the total picture
tkuchiki has quit [Remote host closed the connection]
<quazimodo>
but that stuff's not at all important or an issue
<[k->
you give too much information without your problem :(
<quazimodo>
i'm actually asking about 3 more or less similar ways to use objects in ruby
CloCkWeRX has quit [Ping timeout: 256 seconds]
Alina-malina has joined #ruby
<[k->
ah, that should be your first statement and then you can elaborate later on
peteykun has joined #ruby
Rollabunna has joined #ruby
KnownSyntax has quit [Read error: Connection reset by peer]
<[k->
you should have a Query class specifically for a query
roshanavand has quit [Remote host closed the connection]
fgo has joined #ruby
<[k->
CompanyIncludes does not seem to need to be instantiated
pizzaops has quit []
* ddv
is listening to At the Edge of Time by Blind Guardian from the album Beyond the Red Mirror
<[k->
also, it is poor naming
pizzaops has joined #ruby
* ddv
is listening to Live Your Life by Headhunterz & Crystal Lake from the album Live Your Life - Single
<ddv>
oops sorry
<quazimodo>
hrm
<sevenseacat>
you get points for listening to blind guardian, though.
<quazimodo>
i need to hear someones arguments about instantiation vs not instantiating
<ddv>
sevenseacat: <3
<[k->
IMO, wrappers do not need to be instantiated
semajs has quit [Quit: semajs]
<[k->
they do not require state
<[k->
unless you have API keys and all that
eGGsha has joined #ruby
dstarh has joined #ruby
<[k->
but since you just query them without authing, I assume there is no api key to enter
<quazimodo>
hrm
Ox0dea has quit [Ping timeout: 252 seconds]
<quazimodo>
i don't know, i tend to look at everyting as more or less a data type
Rollabunna has quit [Ping timeout: 248 seconds]
<[k->
we should pull in an expert!
<quazimodo>
a query for me is kind of like a data type, it takes some stuff in + magic sauce to create the useful representation that I want (in this case it involves some network IO)
<[k->
*cough* shevy! *cough*
<quazimodo>
shev shev
<[k->
Query can be a separate object
<[k->
CompanyIncludes should be a Module
<quazimodo>
[k-: also, the usage of the API is entirely taken care of
thiagovsk has joined #ruby
<quazimodo>
a module that just returns a collection?
dellavg has quit [Remote host closed the connection]
<[k->
have you not seen factories :o
<[k->
maybe we can pull in jhass too
<quazimodo>
factories don't need to be modules
<[k->
they code a lot
dellavg has joined #ruby
<quazimodo>
i don't think it's good to use modules for this
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sandelius has joined #ruby
<[k->
well you know your system best
<quazimodo>
i want to be working with a data type that has an interface
<quazimodo>
in general that's how i feel
n1ftyn8_ has quit []
<[k->
interface don't have states!
<quazimodo>
but i don't know the implications
allomov has joined #ruby
<quazimodo>
[k-: eh?
<workmad3>
quazimodo: if you're wanting a data type, chances are you want to return an object of some form, but your `.where(blah)` method can then be a factory method that performs your operation and returns a processed data structure
n1ftyn8_ has joined #ruby
<quazimodo>
an interface is an abstract collection of operations that the data type would implement?
<quazimodo>
workmad3: sure that makes sense
marens has quit [Ping timeout: 248 seconds]
arup_r has quit [Remote host closed the connection]
<workmad3>
quazimodo: just don't do something like set up data on the class itself as a way to avoid creating an instance because 'I only ever have one request happening at once'... that logic is almost certainly going to bite you painfully just after you've forgotten you did it that way
<quazimodo>
workmad3: i do my utmost to stay away from class instance variables
<quazimodo>
i never ever make data on the class itself
<quazimodo>
well, 0.0001% of the times
tkuchiki has joined #ruby
* [k-
silently scribbles workmad3 on the expert list
<workmad3>
quazimodo: I've no problem with class instance variables... as long as they're set up during initialization and then never changed :D
<quazimodo>
yeah
<quazimodo>
exactly
<quazimodo>
which i've needed to do a handful of times
<[k->
if you don't use them, you should be doing fp!
<workmad3>
otherwise they're just another form of globally-mutable shared state
<quazimodo>
yep
<quazimodo>
and then yoru spec fails
<quazimodo>
and you nfi why?
<quazimodo>
because it doesn't get scrubbed between specs :(
<workmad3>
[k-: class-instance variables are instance variables set up at the class level, not on an instance of the class
<workmad3>
[k-: classes in ruby are instances of Class, so you get all the normal things available to any instance of a class
<apeiros>
them classes be objects!
<ddv>
class Class <3
* [k-
steps closer to the fp corner
<quazimodo>
and if i'm not mistaken, class variables are shared by the class and any subclasses, while class instance variables are private per class
<quazimodo>
ya?
<quazimodo>
<- dumb
jerius has joined #ruby
<workmad3>
[k-: it's not that crazy or confusing... unless you're used to something like Java that draws an arbitrary boundary around classes and says "Classes are a different magisterium from objects, you should think of them as a separate universe"
<workmad3>
quazimodo: pretty much
<quazimodo>
workmad3: next step, your thuoghts on Butt.new(stuff) vs Butt.new(stuff).call
JoshL has joined #ruby
<quazimodo>
i'm thinking
<workmad3>
quazimodo: I'd tend towards the second form, if you're meaning that `.call` is doing some processing
<quazimodo>
yeah
centrx has quit [Quit: Shutting down, Please wait...]
<quazimodo>
such as executing a request to another api
Xeago has joined #ruby
<quazimodo>
and finally
lennae has quit [Ping timeout: 248 seconds]
r__rios is now known as r_rios
a346 has joined #ruby
<workmad3>
quazimodo: I'd probably not call the method `.call` though, unless I was implementing something that needed to be used as a Callable, and even then I'd probably have a more descriptive name and just alias it to `call`
<quazimodo>
Callable?
hinbody has joined #ruby
<quazimodo>
that's a thing?
jerematic has joined #ruby
<ddv>
call is also a method of Proc
r_rios has quit [Changing host]
r_rios has joined #ruby
<[k->
it may be going to be a thing
<workmad3>
quazimodo: procs and lambdas are classed as 'callables' because they implement `.call`
<[k->
.exec maybe?
<quazimodo>
i used it specifically because it's a method of procs & lambdas
<quazimodo>
i thought, by having that it makes it very obvious what's going on
<[k->
your new method returns a proc?
<quazimodo>
my .call objects rarely have much else
Xeago has quit [Remote host closed the connection]
<workmad3>
quazimodo: unless the class name is very descriptive of what's happening, I just tend to stay away from that generic a name
mahtennek has joined #ruby
<quazimodo>
hrm
<quazimodo>
perhaps you have a good point
<workmad3>
quazimodo: and even then, I'd probably go for something like `perform` or `process` or `load` over `call` so that it's a bit more descriptive of my thought process
<workmad3>
quazimodo: naming things is also a skill... and one that isn't practiced much outside of fairly restricted realms of human activity
<[k->
so you can't test that it is inside, no?
<quazimodo>
workmad3: i found that suddenly everything just got better when i started to treat objects as data structures rather than things that perform actions an other thinhgs
<quazimodo>
workmad3: indeed
<mahtennek>
[k-: i don't get you
<[k->
havenwood that seems like too much work
sulky has quit [Ping timeout: 252 seconds]
<quazimodo>
chrissonar: call the methods?
<quazimodo>
test the behaviour
<ddv>
workmad3: still naming is hard
jlast has joined #ruby
<[k->
mahtennek if it is not a child, it is not inside it
<quazimodo>
butts.touch <- raises if not included ...
<[k->
havenwood, what about checking ancestors?
<chrissonar>
quazimodo, and repeating the very same tests for each class, which included the module?
lxsameer has quit [Quit: Leaving]
<havenwood>
[k-: For chrissonar's question?
bb010g has quit []
<quazimodo>
chrissonar: are you exposing a module to the world (ie are you testing the methods on the module) or whether your classes havethose methods?
<[k->
ye
bb010g has joined #ruby
<havenwood>
[k-: Show how!
<mahtennek>
[k- yes. so how can I tell that in that same level running the loop, i will know that ClassNo of "SL1" is "daytext" of "Wednesday'
sulky has joined #ruby
<[k->
he just wants to know if a module is included by a class
<workmad3>
chrissonar: if you're using rspec, you can use shared example groups... with minitest, you may be able to write your tests in a module and include that in your test class
<quazimodo>
because if you're just testing if your classes have those methods, i'd still be testing those classes behaviour via shared examples
chouhoulis has quit [Ping timeout: 250 seconds]
jlast_ has joined #ruby
krz has joined #ruby
<quazimodo>
chrissonar: shared examples are your friend here in my opinion, unless some technical reason gets in the way
<havenwood>
[k-: #include? is a bit more concise
Voker57|2 has quit [Ping timeout: 256 seconds]
ninja-maid-robot has quit [Quit: I have irrefutable proof that D < 0. It follows trivially from 2D > 3D, which is obviously true.]
Voker57|2 has joined #ruby
<chrissonar>
workmad3, quazimodo i wonder about that advise, because I already testet the module itself, but only want to ensure the module was included into certain classes.
<[k->
>> module A end; class B; include A end; B.include? A
<quazimodo>
chrissonar: you don't care at all that your classes included the module
Xeago has quit [Remote host closed the connection]
<quazimodo>
you only care if your classes exhibit expected behaviour
solocsha1 has quit [Ping timeout: 255 seconds]
<quazimodo>
if you poke your class here, does it do what you thought it shuold
<[k->
mahtennek how do you access ClassNo
<quazimodo>
if you don't include your module, that'll break
<workmad3>
chrissonar: I'd avoid writing a test that specifically checks if the module is included in the class, tbh... that's testing implementation details pretty heavily, rather than that your class is showing expected behaviour (there's nothing wrong with changing the implementation of a collection from including Enumerable to hand-rolled methods for each method, but if you check for Enumerable in the included mod
<quazimodo>
if your module changes, that'll break
<workmad3>
ules then your test will break)
j4cknewt has joined #ruby
arup_r has joined #ruby
<quazimodo>
if you decide to use something other than a module to do this, yoru test won't break :)
jenrzzz has quit [Ping timeout: 264 seconds]
<quazimodo>
and tests breaking = $$ down the drain
<chrissonar>
workmad3, good point.
dhjondoh has quit [Remote host closed the connection]
<quazimodo>
hey what about my mpoint (which was exactly the same except less eloquently worded)
<mahtennek>
[k-: it's in JSON, so i run a key value and get key=ClassNo matching the value. b
blackmes1 has joined #ruby
jlast has quit [Ping timeout: 246 seconds]
k3asd` has quit [Ping timeout: 246 seconds]
<chrissonar>
quazimodo, maybe i did not get the reason?
khebbie has joined #ruby
<quazimodo>
lol
<chrissonar>
quazimodo, anyway i have to think about it.
<quazimodo>
i'm just playing
rbennacer has joined #ruby
<havenwood>
mahtennek: So you're doing a `require 'json'` then deserializing the JSON you have already, or no?
<mahtennek>
yes i have
<mahtennek>
i have gotten the result
<quazimodo>
chrissonar: weigh the advantages/costs. Testing isn't about being 100% sure, mathematical certainty or code coverage, it's about running your stuff thruogh similar requirements as production wolud be, and having it not fall apart
willhumphreys has quit [Ping timeout: 255 seconds]
<quazimodo>
and you try to do so with the least time/money expenditure
<mahtennek>
but it's kind of confusing me at the moment. so i need some clear head guidance
<[k->
so json.select { |array| array.select { |k,v| k == ...
<quazimodo>
by testing your module's included, you'll get a green dot even if the module is 100% fucked
elia has quit [Client Quit]
jeanlinux has quit [Remote host closed the connection]
<mahtennek>
i'll try that [k-
<quazimodo>
if you test that butts.touch prints "Don't touch me", you'll always be guaranteed that butt touching prints that message, regardless of anything else
<chrissonar>
quazimodo, very exlicit ;)
<chrissonar>
explicit
<[k->
mahtennek no...
<workmad3>
quazimodo: it also means that your test will break only if touching butts becomes an allowable action of your system ;)
<[k->
?code mahtennek
<ruboto>
mahtennek, We can't help you without your code, please post it to https://gist.github.com
<quazimodo>
haha
<mahtennek>
hang on
zly has quit [Changing host]
zly has joined #ruby
<workmad3>
s/will/should
<quazimodo>
workmad3: so, i think i agree with you on Whatever.new(stuff).perform_the_intended_action
<adaedra>
I think it's frowned upon to inherit from core classes
<quazimodo>
ya but y
maZtah has joined #ruby
<apeiros>
not just core classes
<quazimodo>
better to include enumrable, delegate each to @object and have @oject = [stuff] ?
<apeiros>
you should not inherit from classes which you don't own
yh has quit [Ping timeout: 246 seconds]
<workmad3>
quazimodo: because lots of operations will silently change your subclass of an array into a non-subclassed array, which makes things difficult to reason about
<apeiros>
because if you don't own a class, you must only use its external interface anyway
<mahtennek>
this is a sample of my codes. https://gist.github.com/anonymous/71857a3ac67bb0daef7b. it's basically looping through my database to get somthing like this ["module_code":"ST2334","module_title":"Probability and Statistics","class_no":"T4","week_text":"Every Week","lesson_type":"Tutorial","day_text":"Thursday","start_time":"1500","end_time":"1600","venue":"S16-0202","lecture_periods":["Monday Afternoon","Thursday Afterno
<apeiros>
and then there's no point to inheritance. just use composition.
<quazimodo>
ok
<quazimodo>
so building a class that is a collection
<quazimodo>
how would you?
<apeiros>
yes
<mahtennek>
i want to actually get the modules of today.
<apeiros>
has-a instead of is-a
<quazimodo>
ok
iamninja has quit [Ping timeout: 255 seconds]
<workmad3>
quazimodo: e.g. `a = Foo.new; a += ["foo"]` <-- suddenly your subclass becomes an Array
<quazimodo>
i can understand that
<mahtennek>
the challenge is that there are lecture_periods and tutorial_periods that only match to ClassNo
<quazimodo>
workmad3: rly?
<apeiros>
quazimodo: well, class HasArray; def initialize; @array = []; end; end
<apeiros>
quazimodo: and see Forwardable module for easy delegation
<mahtennek>
sorry the ClassNo that matches with the day in DayText
<[k->
my cyclomatic complexity rating of your code: 10/10!
<quazimodo>
ok, and we forward the useful stuff from Array and Enumerable
<workmad3>
quazimodo: yup
* apeiros
puts [k- into the cyclomat
<apeiros>
red button, yeeeeey!
<quazimodo>
ok that's another issue solved for me
sarkyniin has joined #ruby
joast has quit [Ping timeout: 264 seconds]
<[k->
my head was cut of
<apeiros>
what? nooo!
renderful has joined #ruby
<[k->
you gonna have bloody mess
<apeiros>
but I was careful!
christiandsg has joined #ruby
<[k->
adaedra executed me
<apeiros>
oh, did they?
<Burgestrand>
I'm glad not everybody considers inheriting from core classes a good idea.
gambl0re has quit [Ping timeout: 248 seconds]
* Burgestrand
slightly bitter
kobain has joined #ruby
<apeiros>
Burgestrand: you got different opinions earlier?
lennae has joined #ruby
<Burgestrand>
apeiros: indeed.
<apeiros>
or elsewhere?
<workmad3>
quazimodo: btw, it's not that your subclass morphs in that example... it's that `a += ["foo"]` is `a = a + ["foo"]` and the Array + operator is coded to create a new Array, not a new instance of whatever is on the left-hand-side of the +
<Burgestrand>
apeiros: a few hours ago in here!
Ropeney has joined #ruby
<apeiros>
Burgestrand: and I was not here to curb the insanity!
Ropeney has quit [Client Quit]
mistermocha has quit [Ping timeout: 252 seconds]
<Burgestrand>
apeiros: when it comes to development I do believe in karma.
<Burgestrand>
except it's not fate, it's the past me.
<Burgestrand>
;)
Xeago has quit [Remote host closed the connection]
<workmad3>
quazimodo: similar issues abound with basic Enumerable methods like map, select, etc. and with subclasses of other core types, like Hash, String...
<apeiros>
ay, so why do I always get bitten by others insane code and never mine?!? :(
<[k->
your problem is this ye? 21:27:09] <mahtennek> [k- yes. so how can I tell that in that same level running the loop, i will know that ClassNo of "SL1" is "daytext" of "Wednesday'
<mahtennek>
yes
senayar has quit [Remote host closed the connection]
ht__ has quit [Quit: Konversation terminated!]
<mahtennek>
i think it's getting abit messy and complex
<mahtennek>
because i am traversing at least 5 records from the db with various module information
<Burgestrand>
apeiros: it is indeed unfair!
<[k->
you just use &&
<apeiros>
I should write insane code myself
<apeiros>
so others can get bitten by it
Xeago has joined #ruby
<jhass>
I think subclassing core classes can be okay for internal stuff in small code bases, just don't expose them to somebody not aware of the cavehats
* apeiros
puts on the cave hat
<adaedra>
ha
<apeiros>
it's that @ hat, right?
<apeiros>
or was that the @sshat?
<workmad3>
jhass: to me, there are just so many caveats that I may as well just use composition and forward the methods I want
* apeiros
never remembers, f'ing heat.
<[k->
caveats
Narzew has joined #ruby
Feyn has quit [Quit: Leaving]
devdazed has joined #ruby
* apeiros
doesn't know that cav guy either and what he's eating…
<jhass>
today it's the heat, in five months it's the cold :D
<apeiros>
I have no problems with cold
cir0x has quit [Quit: Leaving.]
christiandsg has quit [Ping timeout: 265 seconds]
<[k->
mahtennek && is the `and` operator
jobewan has joined #ruby
cir0x has joined #ruby
<workmad3>
apeiros: same, unless we're talking *really* cold (I probably wouldn't enjoy the arctic circle, or a winter in moscow, for example)
<mahtennek>
yes
<[k->
you can use if to check both conditions at once
<mahtennek>
but how can i check that the ClassNo correctly matches DayText
<jhass>
well, wet light cold is usually a lot worse than the dry strong cold in those areas
<quazimodo>
I presumed as much
<[k->
so you have value[0][day_text] == sometjjmg && value[0] == something
<quazimodo>
probably does a malloc each time an array is operated on
<apeiros>
workmad3: I just stay at home and use teleshopping
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Timba-as has quit [Ping timeout: 246 seconds]
<wmoxam>
jhass: +++
<[k->
value[0][Class_no]*
Timba-as has joined #ruby
<quazimodo>
i dno why it took me so much frigging time to understandthat objects are really really easy to work with (not always but mostly) if you treat them as distinct data type
<mahtennek>
[k-: if i value[0][Class_no]* it, what does it do?
<[k->
ignore the *
<[k->
it means that I was correcting my previous sentence
marens has joined #ruby
marens has joined #ruby
<mahtennek>
oh yeah but the value[0][class_no] is constantly changing each module information it receives
<mahtennek>
so there's no way to ensure a static comparison
senayar has joined #ruby
<[k->
err what?
<mahtennek>
as in the JSON records for value[0][class_no] is constantly changing its value for each record
<mahtennek>
to set value[0][class_no] == 1 for example, the next record would not be 1
lennae has quit [Ping timeout: 248 seconds]
rbennacer has quit [Read error: Connection reset by peer]
<mahtennek>
so wouldn't it be pointless to set [0][class_no] == [0][class_no
<[k->
lets step back for a moment what do you mean by class_no == day_text
_blizzy_ has quit [Ping timeout: 248 seconds]
k3asd` has joined #ruby
jpfuentes2 has joined #ruby
<mahtennek>
so for example ["module_code":"ST2334","module_title":"Probability and Statistics","class_no":"T4","week_text":"Every Week","lesson_type":"Tutorial","day_text":"Thursday","start_time":"1500","end_time":"1600","venue":"S16-0202","lecture_periods":["Monday Afternoon","Thursday Afternoon"],"tutorial_periods":["Monday Afternoon","Thursday Afternoon"]}]
deimos has quit []
t-richards has quit []
williamherry has joined #ruby
<mahtennek>
here i know that class_no T4 is on Thursday, which is found in day_text
deimos has joined #ruby
<mahtennek>
but the next record ["module_code":"ST2334","module_title":"Probability and Statistics","class_no":"SL1","week_text":"Every Week","lesson_type":"Lecture","day_text":"Monday","start_time":"1200","end_time":"1400","venue":"UT-AUD3","lecture_periods":["Monday Afternoon","Thursday Afternoon"],"tutorial_periods":["Monday Afternoon","Thursday Afternoon"]}]
<mahtennek>
could be class_no SL1 on Monday (day_text)
<mahtennek>
so i want to be able to ensure this 2 entities are correct.
<[k->
so SL is not Monday
<mahtennek>
it is Monday for that case.
<Papierkorb>
Anyone in here knows about rugged? I want to add a file to a git repository as file, and then commit that file. Issue is that when I change this file later on, "$ git status" shows no changes
<[k->
mahtennek, you should have a new method for checking
<mahtennek>
okay.
<mahtennek>
what would you suggest?
tesuji has quit [Ping timeout: 276 seconds]
Pro| has joined #ruby
<Pro|>
what would be a good way to parse "-8,00" to number
<[k->
I'm still not sure how T4 -> Thursday and SL1 -> Monday
<Pro|>
"-8,00" to -8.00
<apeiros>
from the length of the ongoing discussion, I'd suggest writing down a proper problem spec :-p
* apeiros
senses upcoming additional requirements, though
elia has joined #ruby
<[k->
I was going to suggest a library
<apeiros>
[k-: can't. too hot. I'd be pissed within less than 3.87 seconds
atom3 has quit [Ping timeout: 277 seconds]
<[k->
but I have work to do!
davedev24_ has joined #ruby
<mahtennek>
erm. well, this Json determines the Class number, module codes, together with the Day_text which is actually the day it is held. so the class T4 in the JSON is a tutorial class held on Thursday, whereas SL1 is a lecture held on Monday. so as of now, i am able to parse this JSON key value.
<[k->
my problem analysis skills aren't up to par
JakFrist has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<apeiros>
[k-: nobody forces you to help
<[k->
so if the json determines it, what do you need to check?
atom3 has joined #ruby
<[k->
I can't just leave him alone halfway!
<mahtennek>
sorry guys
<[k->
that would be irresponsible
<[k->
no,no its okay
tagrudev has quit [Remote host closed the connection]
<mahtennek>
actually the problem is that my current method is getting all the dates of today and displaying it accordingly.
arup_r has quit []
<mahtennek>
day of today i mean
DaniG2k has joined #ruby
davedev2_ has quit [Ping timeout: 248 seconds]
<mahtennek>
i am not sure if i could actually enforce a check that if the ClassNo is as it is from the JSON, then it would be the DayText as from JSON
Rollabunna has quit [Ping timeout: 248 seconds]
hotpancakes has joined #ruby
<apeiros>
ok, seems Pro|'s don't need to thank for received help. noted.
msnyon has joined #ruby
railsraider has quit [Ping timeout: 252 seconds]
* [k-
pours cold water over apeiros
<[k->
that should cool you down!
<apeiros>
thanks. much appreciated.
* yorickpeterse
throws ice cubes at apeiros
momomomomo has joined #ruby
* ljarvis
throws ice cube at apeiros
<apeiros>
:-o
<[k->
add injury to the heat!
<apeiros>
why'd you throw h2o croutons at me?!? they belong into the whiskey-soup!
ninja-maid-robot has quit [Ping timeout: 265 seconds]
<yorickpeterse>
because clearly you're suffering too much from the heat so we figured throwing them at you would make things easier
<mahtennek>
the problem: i want to get the modules of Today
<mahtennek>
challenge, there is Lecture_periods and tutorial_periods which have multiple values, i need to ensure that it matches today's day
<apeiros>
code formatting, whatsthat?
<mahtennek>
and it has to be checked against Day_text with today's day
werelivinginthef has joined #ruby
<mahtennek>
it's in JSON
aphprentice has quit [Remote host closed the connection]
charliesome has joined #ruby
<apeiros>
yes. and that can't be formatted…
<[k->
?gist_usage
<ruboto>
To properly use gist, please enable syntax highlighting, either by choosing the language manually or by entering a proper filename. If you post multiple things, separate them into multiple files. If you have a Github account, please update your gist with new information instead of posting a new one.
<[k->
!
<apeiros>
mahtennek: hint - I know the days of 80 column screens are over. but when your stuff goes over 120 cols, it's simply unreadable.
<[k->
I knew the command apeiros!
<mahtennek>
sorry. hang ong
<mahtennek>
on
* apeiros
hands [k- the excellent command of ruboto's command medal
willhumphreys has quit [Ping timeout: 246 seconds]
tkuchiki has joined #ruby
<apeiros>
zenspider contributed by deleting 60KLoC :D
<apeiros>
nice
aganov has quit [Quit: Leaving]
* [k-
was brutally murdered by French terrorists (read: adaedra)
cir0x has quit [Quit: Leaving.]
<adaedra>
now now now
<adaedra>
no need to use such nouns
<apeiros>
you mean french freedom fighters
eggoez has joined #ruby
pullphinger has joined #ruby
<dudedudeman>
i read that as french tourists at first, and the image made me chuckle
<jhass>
apeiros: no, concerned citizens
<Pro|>
apeiros: thanks you
<dudedudeman>
anyone going to make it to lonestar ruby?
<neanias>
What are the advantages of a JIT complier?
howdoicomputer has joined #ruby
<neanias>
Speeeeeeeeed?
<jhass>
essentially, yes
<neanias>
Fair enough
uri_ has joined #ruby
kies^ has joined #ruby
ta has quit [Remote host closed the connection]
<adaedra>
Be careful of the ticket
<[k->
speed in the long term
dopie has joined #ruby
<[k->
you don't have speed tickets!
<jhass>
if you get speed tickets it means you just were too slow so the camera could catch you
shredding has joined #ruby
<adaedra>
you're right, I have no speed tickets.
jenrzzz has quit [Ping timeout: 252 seconds]
<adaedra>
The fact I don't have my driver license may help, though.
<neanias>
adaedra: you're not trying hard enough
christiandsg has joined #ruby
<dudedudeman>
are speeding cameras a thing in europe?
<neanias>
Yeah
<neanias>
Well, they certainly are here in the UK
<jhass>
lol, definitely
<[k->
?ot
<ruboto>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
symm- has quit [Ping timeout: 256 seconds]
<neanias>
Although, some have since been taken down
<Burgestrand>
Sweden too.
<neanias>
Booo, [k-
<apeiros>
?ot neanias
<ruboto>
neanias, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
christiandsg has quit [Remote host closed the connection]
<dudedudeman>
ruby
<apeiros>
you can tell [k- booo in #ruby-offtopic :-p
<neanias>
[k-, fiiiin
<neanias>
eee
<adaedra>
dudedudeman: France too
ashemark has quit [Quit: leaving]
IanV0rn2341 has joined #ruby
fgo has quit [Quit: WeeChat 1.1.1]
renderful has quit [Remote host closed the connection]
mistermocha has joined #ruby
senayar has quit [Remote host closed the connection]
bubbys has joined #ruby
<IanV0rn2341>
Hi, I'm having trouble setting an allow and a double on a derived class with class methods. My code looks like https://gist.github.com/anonymous/1bd08d955bcebb44b5fe, but however I stub "client", the real one gets called, can anyone advise me on how to set it up correctly?
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
victortyau has quit [Ping timeout: 250 seconds]
christiandsg has joined #ruby
tfittsy has quit [Ping timeout: 264 seconds]
allomov has quit [Remote host closed the connection]
senayar has joined #ruby
sepp2k has joined #ruby
victortyau has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
<IanV0rn2341>
np, got it! writing it down helps!
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
<jhass>
yw
axl_ has quit [Ping timeout: 245 seconds]
axl__ is now known as axl_
<adaedra>
\_o<
<jhass>
mmmh
<jhass>
I don't get it
<adaedra>
it's a duck
<[k->
lel
<neanias>
Oh, so it is
<dudedudeman>
looks like a sideways person holding a bat
msgodf has quit [Ping timeout: 256 seconds]
<adaedra>
So IanV0rn2341 has a thinking duck
<dudedudeman>
wait. this isn't #ruby-offtopic
<ddv>
,ot
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ddv>
I always forgot the command
<ddv>
forget*
<ddv>
.ot
<neanias>
?ot
<ruboto>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<ruboto>
My owner is apeiros, I have many rulers though
bhuvan_aurora has quit [Ping timeout: 250 seconds]
<ddv>
?abuse
<ruboto>
I don't know anything about abuse
acke has quit [Remote host closed the connection]
<ddv>
?ruboto
<ruboto>
I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
<ddv>
lol
bhuvanaurora has quit [Ping timeout: 256 seconds]
<[k->
?experiment -- Please use local copy of ruboto
<ruboto>
--, Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
jamesaxl has joined #ruby
<neanias>
?pry
<ruboto>
Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<dudedudeman>
?me
<ruboto>
I don't know anything about me
tkuchiki has quit [Remote host closed the connection]
<ruboto>
dudedudeman, I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
<neanias>
>> require 'pp'; pp {hello: 'world'}
<ruboto>
neanias # => /tmp/execpad-e3754f67bf90/source-e3754f67bf90:2: syntax error, unexpected ':', expecting '}' ...check link for more (https://eval.in/393542)
<neanias>
I broke it
<dudedudeman>
:P
acke has joined #ruby
<havenwood>
dudedudeman: Ah, someone beat me to it. Just saw the backlog.
<ddv>
?''
<[k->
time out time out!
<ddv>
?'""'
<dudedudeman>
havenwood: lol. no worries. it's just comical to see the occasional freakout by ruboto
tkuchiki has joined #ruby
<ddv>
?why
<ruboto>
I don't know anything about why
rippa has joined #ruby
ljt has quit [Read error: Connection reset by peer]
Muhannad has joined #ruby
Skelz0r has quit [Ping timeout: 256 seconds]
ndrei has quit [Ping timeout: 264 seconds]
allomov has joined #ruby
Skelz0r has joined #ruby
<yorickpeterse>
?_why
<ruboto>
I don't know anything about _why
<cout>
_why, I think :)
<yorickpeterse>
:>
<cout>
doh!
<cout>
he's succcessfully erased himself!
<havenwood>
prefixed by an underscore it's properly private
DEac-_ has joined #ruby
joelataylor has joined #ruby
cb__ has joined #ruby
cb__ has quit [Changing host]
cb__ has joined #ruby
<apeiros>
?apeiros ddv
<ruboto>
ddv, is nobody. They're one of the four people with founders access in the #ruby channel, owner of ruboto the channel bot and ruby-community.com the companion website for the #ruby channel
<shevy>
lol
<shevy>
well, failing is easy with ruboto
<ruboto>
I don't know anything about life
<shevy>
bad ruboto, bad!
<ddv>
well thanks :(
<apeiros>
oh, dear
<ruboto>
ddv, apeiros is nobody. They're one of the four people with founders access in the #ruby channel, owner of ruboto the channel bot and ruby-community.com the companion website for the #ruby channel
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
ddv is nobody!
<ruboto>
nice, I don't know anything about ddv
<apeiros>
jhass: we did agree on me being nobody, right? and you're anybody?
<shevy>
?ddv nice
<shevy>
lol
mary5030 has joined #ruby
<apeiros>
fail
<[k->
?life
<apeiros>
?apeiros ddv
<apeiros>
ddv: there. fixed.
<ddv>
i'm a nobody
snockerton has joined #ruby
nettoweb has joined #ruby
<ddv>
:)
<shevy>
who was somebody?
<jhass>
apeiros: I told you I can never remember!
hakunin has joined #ruby
mary5030 has joined #ruby
varunwachaspati has joined #ruby
<apeiros>
don't worry. ruboto will.
<cout>
I used 'anybody' as one of my first irc nicks back in '95 or '96
paulcsmith has quit [Quit: Be back later ...]
<apeiros>
?jhass
<ruboto>
jhass is anybody. They're a member of the op staff in #ruby, contributor to ruboto and ruby-community.com
poikon has quit [Quit: Connection closed for inactivity]
<ddv>
lol
last_staff has quit [Remote host closed the connection]
<shevy>
cout cool. did you use mIRC by chance back then?
<ddv>
apeiros: you should have something like apeiros is the supreme overlord of #ruby
werelivinginthef has quit [Remote host closed the connection]
<apeiros>
ddv: the "one of the four people with founders access" is that
<ddv>
breaker of chains, protector of the realm
<jhass>
apeiros: do we accept anyone and noone as aliases?
<shevy>
ddv depends on the ban-hammer. who is leading? I think sevenseacat :)
paulcsmith has joined #ruby
<apeiros>
hehe, yeah, that'd fit ruboto's self description
<apeiros>
jhass: I'd reserve those for other people.
jpfuentes2 has joined #ruby
<jhass>
mmh
<apeiros>
commuting. brb.
<apeiros>
(well, right=30min)
<cout>
shevy: either ircII or mirc, not sure
jlast_ has quit [Remote host closed the connection]
<cout>
shevy: more likely ircII, I think; I had to jump through hoops to get a shell back then
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nettoweb has quit [Max SendQ exceeded]
<cout>
good ol vms/multinet
sharpmachine has joined #ruby
<shevy>
hehe
nettoweb has joined #ruby
jlast has joined #ruby
JakFrist has joined #ruby
JDiPierro has quit [Remote host closed the connection]
blackmes1 has quit [Ping timeout: 276 seconds]
JDiPierro has joined #ruby
<maloik>
It seems you can only destroy a resque job by specifying the worker class, or by specifying the worker class and each of its arguments... is there no way to destroy one using the worker class and the first of the arguments?
JDiPierro has quit [Remote host closed the connection]
alex88 has quit []
jlast has quit [Read error: Connection reset by peer]
enebo has joined #ruby
<maloik>
In our case, we enqueue jobs using a server's hostname and an id. I want to be able to destroy all of the jobs for a certain server, no matter the id
<yorickpeterse>
can't you just pop it from the underlying Redis list?
sharpmachine has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
<maloik>
Technically: probably. Realistically I simply don't know if that's a good idea? Anyone have experience doing that?
<yorickpeterse>
No idea, last used Resque 4-ish years ago
wallerdev has joined #ruby
jlast has joined #ruby
<maloik>
maybe we should make the workers dumber so that theyre not using the rails env... that would allow us to create a queue per server, and just split the workers across them
<maloik>
errr.... assign each one a worker*
livathinos has quit []
dgutierrez1287 has quit [Remote host closed the connection]
<maloik>
splitting the workers doesn't work because then it will empty the first queue before moving onto the second
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
williamherry has quit [Quit: WeeChat 1.2]
Scroff has joined #ruby
werelivinginthef has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
eGGsha has joined #ruby
rfv has quit []
rfv has joined #ruby
Scrofff has quit [Ping timeout: 246 seconds]
fmcgeough has joined #ruby
Xeago has quit [Remote host closed the connection]
<yorickpeterse>
I'd suggest not tying your queueing code to your Rails app in the first place
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
<neanias>
Holy moley
<neanias>
No
<neanias>
It hasn't got that hot
<neanias>
...yet
DCameronMauch has joined #ruby
<shevy>
I saw a slightly similar picture for a train though
<shevy>
let me try to find that one
<neanias>
Apparently we're due for the hottest day ever soon
<adaedra>
We got some molten road in the south
varunwachaspati has quit [Remote host closed the connection]
<neanias>
Well, in the extreme heat, they have to run slightly slower to avoid buckling the rails, I think
jenrzzz has quit [Ping timeout: 255 seconds]
<adaedra>
yep
doertedev has quit [Ping timeout: 276 seconds]
y0da has joined #ruby
doertedev has joined #ruby
blackmes1 has joined #ruby
irk has joined #ruby
<adaedra>
we have the train season cycle: summer: too hot, autumn: leaves on the tracks, winter: cold, spring: ... mh, nothing particular, just people on the tracks.
<shevy>
lol
solocsha1 has joined #ruby
but3k4 has quit [Read error: Connection reset by peer]
<neanias>
Yeah, I had that problem the other day
bronson has joined #ruby
<adaedra>
Last noticeable problems we got were ponies, then sheep on the tracks.
jhwhite has quit [Ping timeout: 256 seconds]
axl__ has joined #ruby
willhumphreys has joined #ruby
<shevy>
ponies on rails?
jblancett has joined #ruby
<adaedra>
And, my favorite is still when they found a WW2 bombshell next to the tracks.
MiracleBlue has quit []
MiracleBlue has joined #ruby
<shevy>
ewww
Muhannad has quit [Ping timeout: 252 seconds]
rcvalle has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 248 seconds]
<shevy>
quite some excitement to travel by train
senayar has joined #ruby
<adaedra>
Yep.
chouhoulis has joined #ruby
<neanias>
Still haven't got to ride the TGV...
Xeago has joined #ruby
Scroff has quit [Remote host closed the connection]
<shevy>
hmm that reminds me...
doertedev has quit [Ping timeout: 264 seconds]
jhwhite has joined #ruby
Scroff has joined #ruby
Ilyas has joined #ruby
Xeago has quit [Remote host closed the connection]
DaniG2k has quit [Quit: leaving]
acke has joined #ruby
amclain has joined #ruby
<shevy>
ah well. I was thinking of some ruby software that would allow two computers to connect and transmit text messages, but I guess icq still exists - if only I could use ruby!
blenny has quit [Max SendQ exceeded]
willhumphreys has quit [Ping timeout: 255 seconds]
blenny has joined #ruby
* jhass
hands shevy a random Ruby XMPP client library
<shevy>
xamp?
<jhass>
xmpp
troydm has left #ruby ["What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset"]
tkuchiki has quit [Remote host closed the connection]
Xeago has joined #ruby
amclain has quit [Client Quit]
cb__ has quit [Remote host closed the connection]
Gnea has quit [Quit: .]
amclain has joined #ruby
DoubleMalt has quit [Ping timeout: 252 seconds]
tkuchiki has joined #ruby
michael_mbp has quit [Excess Flood]
solocsha1 has quit [Ping timeout: 255 seconds]
shredding has quit [Remote host closed the connection]
bronson has quit [Remote host closed the connection]
<josh_be_>
Hi all, how do I add stylesheets to a .html.erb file in my /app/views?
[k- has left #ruby [#ruby]
<eam>
and *that* is to prevent having to copy the input buffer
[k- has joined #ruby
anisha has quit [Quit: Leaving]
bricker has joined #ruby
<shevy>
what the
zendrix has quit [Remote host closed the connection]
<eam>
(which, arguably, isn't a good optimization considering the speed of memory vs syscall)
<[k->
hello how may I use CRLF in puts
<shevy>
are you saying that `puts "hi\n"` is more expensive than `puts "hi"`?
<eam>
shevy: other way around
zendrix has joined #ruby
<shevy>
hmmm
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zendrix has quit [Remote host closed the connection]
<shevy>
who would have known that newlines make your code slower!
<eam>
havenwood: hey, maybe we should patch puts to use writev(2)
jhwhite has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
<havenwood>
eam: :)
JoshL has quit [Read error: No route to host]
JoshL has joined #ruby
<Senjai>
Good morning ruby
axl__ has joined #ruby
<havenwood>
Senjai: g'mornin
* neanias
goes for a cup of tea
christiandsg has quit [Remote host closed the connection]
<eam>
I drank two extra shots of coffee this morning, I'm looking forward to being spastic for the rest of the day
kjones_ has joined #ruby
<shevy>
CUI - coding under the influence
yourwebdevguy has quit [Quit: Bye!]
peteykun has quit [Quit: Leaving]
<eam>
I've drugged myself :(
kjones_ has quit [Max SendQ exceeded]
<Senjai>
eam: I wish coffee did that to me still
<eam>
I had to cut way back, I stopped drinking it for a while
<shevy>
btw adaedra I am showing the ponies pics to a friend, telling him that it's so hot in france now that they are using ponies rather than trains
<eam>
caffine sensitivity will return
solars has joined #ruby
zendrix has joined #ruby
Timba-as has quit [Quit: Be back later ...]
<josh_be_>
How do I add stylesheets to a .html.erb file?
hotpancakes has quit [Remote host closed the connection]
<eam>
they're using ponies because all their taxis and ubers are getting concrete bricks thrown at them
<apeiros>
josh_be_: you add a <style> or a <link> tag
riotjones has joined #ruby
<apeiros>
josh_be_: also that's quite unrelated to it being a .erb file. that's a plain html question.
<phat4life>
eam: are you using some sort of asset pipline?
<eam>
phat4life: I don't do web stuff generally
<josh_be_>
apeiros: I tried linking a stylesheet like I would with regular HTML but it didn't come up
<apeiros>
eam's a surfer, not a weaver
<phat4life>
are you using a framework (sinatra,rails)?
<eam>
apeiros: I do have one rails app though!
<apeiros>
josh_be_: it won't come up for all the normal reasons it won't come up in html too
<adaedra>
shevy: bwahahaha
<apeiros>
eam: so you're a surfer and an engine driver!
<eam>
phat4life: I've used sinatra and rails (even with Sequel)
<eam>
boy, is rails on jruby with sequel not the right platform to learn rails for the first time
<apeiros>
josh_be_: also "it won't come up" is not a helpful problem description. an equally helpful solution is "you're doing it wrong then. just do it right"
<phat4life>
eam: jruby............
allomov has quit [Read error: Connection reset by peer]
<phat4life>
is there even a reason to use jruby, i always though it was because of threads or something
denver has quit [Read error: Connection reset by peer]
bronson has quit [Remote host closed the connection]
<eam>
yes, and it's quite fast for long-lived apps. Quite a few bugs though
<apeiros>
phat4life: real parallelism, access to java libs
quazimod1 has joined #ruby
<apeiros>
phat4life: and in some cases - runs on anything which has a jvm
darkf has quit [Quit: Leaving]
<josh_be_>
apeiros: By it won't come up I mean that despite specifying a stylesheet like I would with regular HTML and linking to it via /app/assets/stylesheets/style.css, the webpage still shows the raw HTML
<eam>
apeiros: doesn't it have some jni, though?
<apeiros>
josh_be_: and what does your browser tell you about the linked file?
<arup_r>
but for now simple_xor method is duplicated
Narzew has joined #ruby
<Senjai>
arup_r: Go with what apeiros suggested
<arup_r>
as I don't have much info .. so I think I should go with what apeiros : said
mary5030 has quit [Remote host closed the connection]
<arup_r>
humm.. thanks
<arup_r>
both of you
flaf has left #ruby ["WeeChat 1.0.1"]
icebourg has joined #ruby
Torrieri has quit [Quit: Be back later ...]
mistermocha has quit [Ping timeout: 265 seconds]
Xiti has joined #ruby
jaycee has quit [Read error: Connection reset by peer]
blaines_ has joined #ruby
yokel has quit [Ping timeout: 248 seconds]
jhwhite has joined #ruby
<eam>
I'm going to go nuts here; after doing a bisect I've determined ... ruby now builds fine on osx - some temporary file is being carried over between builds and making it succeed or fail :(
momomomomo has joined #ruby
yokel has joined #ruby
Kully3xf has joined #ruby
<jhass>
and make clean doesn't nuke it?
veekram has joined #ruby
mleung has joined #ruby
Xeago has quit [Remote host closed the connection]
<veekram>
Konichiwa ! Everyone :)
<eam>
jhass: it didn't at first, but at some point bouncing around in the history it seems to have
<eam>
knowing me I probably did something terrible and forgot about it
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jpfuentes2 has joined #ruby
zz_Outlastsheep is now known as Outlastsheep
podman has joined #ruby
jhwhite has quit [Read error: Connection reset by peer]
last_staff has joined #ruby
ruby-lang116 has quit [Quit: Page closed]
t_ has quit [Ping timeout: 264 seconds]
axl__ has quit [Ping timeout: 245 seconds]
christiandsg has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
loc22 has joined #ruby
Marsupermammal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<loc22>
Hi guys, quick question. Anyone knows what is the equivalent to --binary-data (cURL) in 'http/net' ?
AlphaAtom has joined #ruby
t_ has joined #ruby
khebbie has joined #ruby
Scroff has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
momomomomo_ has joined #ruby
ixti has quit [Ping timeout: 244 seconds]
AlphaAtom has joined #ruby
momomomomo has quit [Ping timeout: 256 seconds]
momomomomo_ is now known as momomomomo
jhwhite has joined #ruby
alakra has quit [Quit: WeeChat 0.4.2]
Carnage\ has quit [Remote host closed the connection]
choke has joined #ruby
solocsha1 has joined #ruby
apt-get_ has quit [Ping timeout: 252 seconds]
nateberkopec has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
jhwhite has quit [Client Quit]
AlphaAtom has joined #ruby
t_ has quit [Ping timeout: 255 seconds]
haxrbyte has joined #ruby
AlphaAtom has quit [Client Quit]
pen has quit [Remote host closed the connection]
jeanlinux has joined #ruby
momomomomo has quit [Quit: momomomomo]
zendrix has quit [Remote host closed the connection]
Marsupermammal has joined #ruby
solocsha1 has quit [Ping timeout: 255 seconds]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NeverDie has joined #ruby
bf4 has joined #ruby
NeverDie has quit [Client Quit]
momomomomo has joined #ruby
bffff_ has joined #ruby
NeverDie has joined #ruby
icflournoy has quit [Ping timeout: 244 seconds]
<bodie_>
I'm using chruby + ruby-install to manage my ruby versions
howdoicomputer has quit [Ping timeout: 276 seconds]
jackjackdripper has joined #ruby
jeanlinux has quit [Remote host closed the connection]
<bodie_>
ruby -e 'puts Gem.user_dir' shows a path for 2.2.0 but I'm using ruby 2.2.2 via chruby
NeverDie_ has quit [Ping timeout: 264 seconds]
slumos has joined #ruby
icflournoy has joined #ruby
genpaku has quit [Ping timeout: 264 seconds]
reset has joined #ruby
reset has quit [Client Quit]
freerobby has joined #ruby
<Senjai>
bodie_: Thats intended
leonardoajim has quit [Quit: Be back later ...]
<Senjai>
bodie_: 2.2.x should all have the same gem path
<bodie_>
okay, cool
<Senjai>
as each gem shouldn't break with patch version releases
ndrei has joined #ruby
genpaku has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
Torrieri has joined #ruby
<Senjai>
It's part of rubys switch to semver iirl
<Senjai>
iirc*
t_ has joined #ruby
leonardoajim has joined #ruby
veekram has quit [Quit: Lost terminal]
bmurt has joined #ruby
* bodie_
smacks the page with an "APPROVED" stamp
DLSteve has joined #ruby
Torrieri has quit [Client Quit]
lee-jon has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
appledroid has joined #ruby
Xeago has quit [Remote host closed the connection]
apt-get_ has joined #ruby
leonardoajim has quit [Ping timeout: 252 seconds]
<bodie_>
Senjai, is there a "right way" to deal with Bundle?
jordsmi has joined #ruby
Xeago has joined #ruby
<bodie_>
I'm just getting into ruby at a basic level, but I need to get some deps and I don't want to mess stuff up
<bodie_>
never mind, I'm being dumb
ixti has joined #ruby
jerius has quit [Quit: /quit]
bikram has joined #ruby
JoshL has joined #ruby
baweaver has joined #ruby
hotpancakes has quit [Remote host closed the connection]
jerius has joined #ruby
bikram is now known as veekram
iateadonut has quit [Quit: Leaving.]
haxrbyte_ has joined #ruby
gattuso has quit [Read error: Connection reset by peer]
tsou has quit [Ping timeout: 250 seconds]
cir0x has joined #ruby
wpp has joined #ruby
AlphaAtom has joined #ruby
rdark has quit [Quit: leaving]
zendrix has joined #ruby
joneshf-laptop has joined #ruby
sargas has joined #ruby
denver has quit [Read error: Connection reset by peer]
hotpanca_ has joined #ruby
haxrbyte has quit [Ping timeout: 252 seconds]
AlphaAtom has quit [Max SendQ exceeded]
bronson has quit [Remote host closed the connection]
msnyon has joined #ruby
seal has joined #ruby
<diegoviola>
redis is in memory key/value store, it doesn't touch the disk, right?
<eam>
diegoviola: correct, unless it pages
sargas has quit [Client Quit]
<diegoviola>
ok
<diegoviola>
so if I restart the server everything is lost
<eam>
yes
<diegoviola>
ok ty
<apeiros>
I think it can write to disk
<eam>
you can configure bgsave or other replication methods
_blizzy_ has joined #ruby
nettoweb has joined #ruby
<eam>
but none are transactional
<diegoviola>
ty
<apeiros>
but there certainly is a redis channel
<diegoviola>
sorry
Xeago has quit [Remote host closed the connection]
gattuso has joined #ruby
<jhass>
doesn't redis periodically persist to disk by default?
<jhass>
at least my log claims so
<eam>
bgsave might be the default
<jhass>
it just keeps the entire db in memory
<eam>
bgsave is a periodic fork/save
bronson has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emptyflask has quit [Ping timeout: 256 seconds]
fabrice31 has joined #ruby
AlphaAtom has joined #ruby
<Senjai>
By default, I believe redis periodically stores state to the disk, but you're never guarenteed when it will.
finisherr has joined #ruby
blackmes1 has joined #ruby
<Senjai>
Or what data is actually persisted
rawtext has joined #ruby
<Senjai>
iirc
<Senjai>
my redis foo is limited
Kully3xf has quit [Remote host closed the connection]
AlphaAtom has quit [Max SendQ exceeded]
AlphaAtom has joined #ruby
joelataylor has quit [Quit: Be back later ...]
pen has joined #ruby
joelataylor has joined #ruby
lkba has joined #ruby
Aswebb_ has quit [Ping timeout: 256 seconds]
zendrix has quit [Remote host closed the connection]
gattuso has quit [Read error: Connection reset by peer]
baweaver has quit [Remote host closed the connection]
lee-jon has left #ruby [#ruby]
Aswebb_ has joined #ruby
okdas has quit [Ping timeout: 256 seconds]
mary5030 has joined #ruby
AlphaAtom has quit [Client Quit]
timonv has joined #ruby
lkba_ has quit [Ping timeout: 246 seconds]
AlphaAtom has joined #ruby
Internet_ has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
howdoicomputer has joined #ruby
mistermocha has joined #ruby
zendrix has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
yfeldblum has quit [Ping timeout: 248 seconds]
okdas has joined #ruby
okdas has quit [Changing host]
okdas has joined #ruby
apt-get__ has joined #ruby
AlphaAtom has joined #ruby
ruurd has joined #ruby
bnobu has joined #ruby
Internet_ has quit [Client Quit]
AlphaAtom has quit [Max SendQ exceeded]
bayed has quit [Quit: Connection closed for inactivity]
abuzze has quit [Ping timeout: 246 seconds]
AlphaAtom has joined #ruby
baweaver has joined #ruby
gattuso has joined #ruby
apt-get_ has quit [Ping timeout: 256 seconds]
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
x1337807x has joined #ruby
ruurd has quit [Client Quit]
x1337807x has quit [Max SendQ exceeded]
chouhoul_ has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
loc22 has quit [Quit: Be back later ...]
arooni-mobile__ has joined #ruby
arooni-mobile has joined #ruby
mistermocha has quit [Ping timeout: 248 seconds]
x1337807x has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Read error: Connection reset by peer]
chouhoul_ has joined #ruby
InternetFriend has joined #ruby
_whitelogger_ has joined #ruby
hardy_ has left #ruby [#ruby]
drPoggs has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
nitenq has joined #ruby
<nitenq>
hi there, Is there a ruby way to get all the ip and netmask of a linux machine ?
subsonik has joined #ruby
gamename has joined #ruby
christiandsg has joined #ruby
EvilJStoker has joined #ruby
elektronaut has joined #ruby
drPoggs has joined #ruby
firevolt_ is now known as firevolt
tomaz_b has joined #ruby
nofxx has quit [Ping timeout: 255 seconds]
Channel6 has quit [Quit: Leaving]
Pupeno has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
JakFrist has joined #ruby
abuzze has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
railsraider has quit [Quit: railsraider]
<shevy>
well I can obtain the IP for localhost nitenq
JoshL has quit [Remote host closed the connection]
okdas has quit [Max SendQ exceeded]
okdas has joined #ruby
okdas has quit [Changing host]
okdas has joined #ruby
<nitenq>
shevy:
emptyflask has joined #ruby
howdoicomputer has quit [Quit: WeeChat 1.2]
<nitenq>
is there another way than parsing ifconfig/ipconfig ?
JoshL has joined #ruby
howdoicomputer has joined #ruby
wpp has quit []
genpaku has joined #ruby
nateberkopec has joined #ruby
AlphaAtom has quit [Excess Flood]
bhuvan_aurora has joined #ruby
bhuvanaurora has joined #ruby
yokel has joined #ruby
zendrix has quit [Remote host closed the connection]
JoshL has quit [Read error: Connection reset by peer]
JoshL has joined #ruby
caseypatrickdris has joined #ruby
<shevy>
not that I know, but I know only little about ruby-ways; I usually just use already existing tools, such as: result = `ifconfig -a` or whatever the switches are
caseypatrickdris has quit [Remote host closed the connection]
serivich has quit [Ping timeout: 248 seconds]
ndrei has quit [Ping timeout: 256 seconds]
Torrieri has joined #ruby
<nitenq>
ok thanks
gix has joined #ruby
workmad3 has joined #ruby
phutchins has quit [Ping timeout: 252 seconds]
joonty has quit [Quit: joonty]
<izzol>
nitenq: you can check ip's from the /proc/tcp too
<izzol>
sorry, /proc/net/tcp.
<nitenq>
yeah I just didn’t want to parse something like this
hotpanca_ has quit [Remote host closed the connection]
<nitenq>
but it’s ok thanks
msmith_ has joined #ruby
<miah>
s/ifconfig -a/ip a l/
<izzol>
yes, on the linux it's better to use just ip command
subsonik has quit [Quit: Leaving]
<eam>
nitenq: getting "the ip" is a difficult concept to get right - machines can have many addresses for many various purposes
<eam>
generally what you want is the ip address of the interface which holds the default route
Musashi007 has joined #ruby
<jhass>
nitenq: Socket.getifaddrs has it apparently
toretore has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
<nitenq>
eam: I want the ip I have by typing ifconfig
<nitenq>
izzol: but don’t you have to create the ip yourself ?
baweaver has quit [Remote host closed the connection]
baweaver has joined #ruby
<eam>
nitenq: ah, you want all interfaces and not a particular one? /proc/net/dev is the linux-specific place to scrape that from (unless you just parse ifconfig)
msmith_ has quit [Remote host closed the connection]
<eam>
ifconfig is a bit more portable, but its output changes so you'll have to do funny things there anyway
<eam>
newer systems would use `ip addr`
* jhass
would imagine Socket.getifaddrs has all that abstracted away
<izzol>
nitenq: so you need to have interfaces or ip's?
<nitenq>
eam: yes basically I want an array : ip[0] = 127.0.0.1/22 ip[1] = 192.168.42.42/12 etc
JDiPierro has quit [Remote host closed the connection]
<eam>
nitenq: jhass' solution is probably best
<eam>
if you want "the" ip, there are some additional tricks
hotpancakes has joined #ruby
<izzol>
nitenq: I would not keep my ip's in array ;P but anyway, you can simply create it as: array << `ip a l | grep ....`
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
prettiestPony11 has joined #ruby
aryaching has joined #ruby
gizmore has joined #ruby
<nitenq>
izzol: why that ?
Xeago has joined #ruby
peter_paule has joined #ruby
railsraider has joined #ruby
railsraider has left #ruby [#ruby]
codecop has joined #ruby
JoshL has quit [Read error: Connection reset by peer]
<eam>
I just realized why I hadn't seen getifaddrs; new in 2
JoshL has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
jenrzzz has quit [Ping timeout: 252 seconds]
aryaching_ has quit [Ping timeout: 252 seconds]
davedev24_ has quit [Ping timeout: 246 seconds]
davedev2_ has joined #ruby
baweaver has quit [Remote host closed the connection]
prettiestPony11 has quit [Ping timeout: 264 seconds]
TheHodge has quit [Quit: Connection closed for inactivity]
thebastl has quit [Quit: Leaving...]
lokulin has joined #ruby
prettiestPony11 has joined #ruby
prettiestPony11 has quit [Max SendQ exceeded]
baweaver has joined #ruby
<izzol>
nitenq: I think it will be hard to say on which element I will have which IP, and if for some reason you will have different output from the ip/ifconfig you will have them on different position in array.
<izzol>
But that's just my opinion ;P
bosma is now known as hodI
autrilla has joined #ruby
bhuvanaurora has quit [Ping timeout: 252 seconds]
<izzol>
but I guess it depends on, if you want to have just a list of ip's or if you want to do something with the specific ip
prettiestPony11 has joined #ruby
prettiestPony11 has quit [Client Quit]
JDiPierro has joined #ruby
bhuvan_aurora has quit [Ping timeout: 256 seconds]
<jfarmer>
That is neither good nor bad per se. It depends on what's in the file, what you intend to do with the contents, and any performance or memory constraints your program might have.
<miah>
you dont even have to tecnically do the File.open bit
<miah>
as File.read will do that too
<jfarmer>
miah Sure, just relating it to the code that he wrote originally
<miah>
ya
Scroff has quit [Ping timeout: 264 seconds]
<miah>
it will also automatically close once the read is complete
<jfarmer>
For example, if the file contains 10GB of data then calling file.read is _probably_ a bad idea: it will read all 10GB into memory and return a Ruby String containing the contents.
allomov has quit [Remote host closed the connection]
abuzze has quit [Remote host closed the connection]
<jfarmer>
But maybe not if you have a super fast hard drive and like 1TB of RAM
<jfarmer>
And you get some benefit from having all that data in memory at the same time
<miah>
right
zendrix has quit [Remote host closed the connection]
<riceandbeans>
omg fake nerd at work
<riceandbeans>
star wars the next generation
wallerdev_ has joined #ruby
<shevy>
riceandbeans give your friend 22 points out of 100 for his code :D
<shevy>
oh I read that as Star Trek for a moment
solocsha1 has quit [Ping timeout: 255 seconds]
<pipework>
Star Trek: A new hope
<shevy>
I always cheered for the BORG
jblancett has quit [Quit: Lost terminal]
jblancett has joined #ruby
zendrix has joined #ruby
peter_paule has joined #ruby
sargas has joined #ruby
sargas has quit [Changing host]
sargas has joined #ruby
kinduff has joined #ruby
kinduff has joined #ruby
<apeiros>
the borg are great, they just have horrible marketing.
baweaver has joined #ruby
sargas has quit [Client Quit]
<apeiros>
also a little inflexible with regards to their product palette
dgutierrez1287 has joined #ruby
<shevy>
lol
<eam>
there's a reason google engineers picked them to represent their infrastructure ;-)
mesamoo has joined #ruby
<shevy>
they are nerds
<riceandbeans>
nerds are lame
<arup_r>
:/
<adaedra>
:/
dgutierrez1287 has quit [Ping timeout: 264 seconds]
<apeiros>
riceandbeans: dangerous to say with many channel ops self-identifying as nerds :-p
bronson has quit [Remote host closed the connection]
Lucky_ has joined #ruby
arooni-mobile__ has quit [Ping timeout: 248 seconds]
arooni-mobile has quit [Ping timeout: 248 seconds]
<eam>
I mean, "lame" means physically disabled so
<adaedra>
it does?
<eam>
yeah, like a lame horse
<riceandbeans>
apeiros: it was supposed to be ironic with me being a nerd too
<pipework>
eam: Horses are cool!
<pipework>
Ain't no such thing as a lame horse.
<eam>
that's the etymology of the popular slang, lame as in "doesn't function properly"
<pipework>
If linux users are lusers, are rubyists rusers, or is that racist?
Shidash has joined #ruby
Marsupermammal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
I don't think rubyists are a race…
<shevy>
we are a race of poetry
<pipework>
apeiros: You're either extending the joke or missing the joke entirely, either way it's still funny.
<jhass>
I don't think racism is about race…
<riceandbeans>
I don't think racism is funny
<pipework>
riceandbeans: It's a joke about the reuse of a term to fit another. similar to how the acronym LUG has been extended.
<arup_r>
I can't think anything except PhP :p
<shevy>
arup_r did you finish porting
jordsmi has quit [Quit: Connection closed for inactivity]
<riceandbeans>
what?
<pipework>
arup_r: Did you also complete starboarding?
<shevy>
I almost finished! At about 98% ... may finish today \o/ but it was ruby code not php
<pipework>
shevy: Blessed is the one that writes ruby and forsakes PHP.
<arup_r>
shevy: 80% .. after that.. I don't a 2 nested loops inside a function what is doing.. so I left as it is.. :)
<pipework>
For they shall not inherit the wordpress.
<riceandbeans>
I also do perl and forsake php
<arup_r>
don't get**
<shevy>
well, wordpress should be written in ruby
<arup_r>
pipework: what do you mean ?
<riceandbeans>
shevy: what?
<pipework>
arup_r: It's probably not worth explaining.
<riceandbeans>
there are ruby based blog engines
<jamesaxl>
hi
<pipework>
Someone just needs to write a PHP implementation that can do full interop with ruby, and then write a long letter of apology to the ruby community.
<jamesaxl>
does ruby have something like twisted?
<pipework>
phuby does not count
<pipework>
jamesaxl: Did you google around?
tomaz_b has quit [Ping timeout: 248 seconds]
<shevy>
riceandbeans I don't know them
<jamesaxl>
pipework: i found EventMachine
lele is now known as Guest24
<riceandbeans>
octopress
kadoppe has quit [Ping timeout: 252 seconds]
ndrei has joined #ruby
<pipework>
jamesaxl: That's the most popular of them. There's also other event-driven libraries. celluloid, jruby has some specific to it, and that's the majority of what I know.
crazydiamond has joined #ruby
<riceandbeans>
toto
<adaedra>
tata
<adaedra>
titi
<jamesaxl>
pipework: thak you ver much
JDiPierro has quit [Remote host closed the connection]
<pipework>
Cheers.
Igorshp_ has joined #ruby
<arup_r>
Why JS folks writing one after another a dozens of framework,, while we have only one RoR ?
<eam>
JS folks haven't made a good one yet
<apeiros>
arup_r: you're quite mistaken
<apeiros>
we don't only have RoR
<riceandbeans>
comfortable mexican sofa
<riceandbeans>
try that one out
<riceandbeans>
looks promising
<arup_r>
sinatra counts ?
<pipework>
arup_r: We have a lot more than Rails.
<jfarmer>
arup_r When Rails came out the landscape was much different.
<pipework>
I don't know why anyone needs a framework for much else than learning.
<eam>
what exactly distinguishes a mexican sofa?
baweaver has quit [Remote host closed the connection]
monod has joined #ruby
Igorshp has quit [Ping timeout: 255 seconds]
<Freijo>
Being a sofa for one
<pipework>
eam: "Hecho en Mexico"
<eam>
well, from other sofas I mean
<Freijo>
and being made in Mexico is a bonus
hanmac has quit [Ping timeout: 256 seconds]
eggoez has quit [Ping timeout: 246 seconds]
<riceandbeans>
omg I just got it
<riceandbeans>
C M S
<riceandbeans>
comfortable mexican sofa
<riceandbeans>
it's a joke
acke has quit [Remote host closed the connection]
<riceandbeans>
it's a false enumaration of the CMS acronym
<jfarmer>
heyoo
zendrix has quit [Remote host closed the connection]
<eam>
does it work well with couchbase
<shevy>
arup_r well javascript is one layer below ruby, so they have an unfair advantage :(
<shevy>
I want jquery in ruby!
momomomomo has quit [Quit: momomomomo]
drewo has quit [Ping timeout: 246 seconds]
<jfarmer>
Huh?
<arup_r>
Jquery is sweet indeed!
workmad3 has joined #ruby
<arup_r>
shevy: But I got your point..
<riceandbeans>
I want a crystal cms
zendrix has joined #ruby
Shidash has joined #ruby
Rahul_Roy has joined #ruby
varunwachaspati has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adaedra>
take crystals, install drupal, you're set.
AvidChronos has quit [Quit: All your base are belong to us]
* adaedra
flees
<shevy>
jhass should write one, that lazy dude
<riceandbeans>
publify
<riceandbeans>
I installed drupal
<riceandbeans>
I don't like it
<riceandbeans>
I was writing my gf a custom thing in mojolicious but she wanted it up overnight
<adaedra>
ahah
<riceandbeans>
so I stood up drupal and cried and then went back to perl
jfarmer has quit []
<adaedra>
I installed a drupal once
<riceandbeans>
I like ruby........but my heart yearns for perl
<adaedra>
Since, I discovered that there is not only PHP for web :x
<riceandbeans>
system side php is a horrible horrible thing
<riceandbeans>
there is a special place in hell for people that do system scripting in php
<adaedra>
every side php is an horrible thing
<arup_r>
lol
Xeago has quit [Remote host closed the connection]
<riceandbeans>
it's right next to brutus and judas
wallerdev_ has quit [Quit: wallerdev_]
<eam>
riceandbeans: let's start a hipster trend about picking up perl
<riceandbeans>
that other mouth, that's for your head
<riceandbeans>
eam: dude totally
<riceandbeans>
it's like the older hotter woman that knows what she wants and what she's doing and doesn't give you stupid drama
hotpancakes has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 246 seconds]
<eam>
oh yeah ruby, lots of kids know that these days, but I'm old school cool
rodferso1 has joined #ruby
<riceandbeans>
perl is the milf of programming languages
<pipework>
Back in the day. It was a tuesday, if I recall.
renderful has joined #ruby
eggoez has joined #ruby
<arup_r>
then...........
<arup_r>
?
<adaedra>
no then
<adaedra>
you don't use that in ruby
<eam>
then;
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
reset has joined #ruby
rodfersou has quit [Ping timeout: 256 seconds]
ndrei has quit [Ping timeout: 276 seconds]
32NACBO7F has quit [Ping timeout: 264 seconds]
howdoicomputer has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
emptyflask has quit [Quit: leaving]
Jackneill has quit [Remote host closed the connection]
<riceandbeans>
no one liked what I said aboout perl?
hotpancakes has joined #ruby
howdoicomputer has joined #ruby
kirun has quit [Quit: Client exiting]
lxsameer has joined #ruby
<shevy>
dunno
<shevy>
can't really relate to it
<jhass>
riceandbeans: most of us are out of their puberty
jcoe has joined #ruby
DLSteve has quit [Quit: Leaving]
<riceandbeans>
jhass: what?
<shevy>
you kinda can do almost everything with a programming language
<shevy>
imagine the moment when you can also use it to create organisms
hanmac has joined #ruby
<shevy>
hmm... everything? anything? anybody? somebody? I am confused...
<riceandbeans>
imagine if there was a comedy sattire show about programming langauges and they were represented by people
<riceandbeans>
their luck and personalities governed by their programming type and their actual concepts
<jhass>
sure that exists somewhere on youtube
<riceandbeans>
we could do it
<jhass>
and I'm sure it's horrible to watch
<riceandbeans>
lol
niemcu has joined #ruby
momomomomo has joined #ruby
<riceandbeans>
harsh
christiandsg has joined #ruby
allomov has joined #ruby
hotpancakes has quit [Ping timeout: 250 seconds]
JoshL_ has quit []
<shevy>
dunno about personalities
<shevy>
who'd wanna pick java riceandbeans :P
<pipework>
Mmm JVM.
wallerdev_ has joined #ruby
r_rios has quit [Ping timeout: 265 seconds]
<adaedra>
Mmm slowness at startup.
k3asd` has quit [Ping timeout: 244 seconds]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
allomov_ has joined #ruby
allomov has quit [Read error: Connection reset by peer]
fabrice31 has quit [Remote host closed the connection]
peter_paule has quit [Ping timeout: 252 seconds]
mistermocha has joined #ruby
loc22 has quit [Quit: Be back later ...]
christiandsg has quit [Ping timeout: 265 seconds]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Spami has joined #ruby
AlphaAtom has joined #ruby
Spami has quit [Client Quit]
<riceandbeans>
java would be played by a smug obnoxious guy, slipping money to school professors to have them teach him to the kids and walking around beating up random people for no reason, but he'd have trouble remembering things all the time like where he was and he'd move really slowly, and if someone made him count too high he'd lose focus and go to another plane and say, aww crap, I fell outta my sandbox again
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
icflournoy has quit [Ping timeout: 244 seconds]
<riceandbeans>
later on you find out ada is really his cousin and uncle sam is really both of their uncle's
bmurt has quit []
Igorshp_ has quit [Remote host closed the connection]
mistermocha has quit [Read error: Connection reset by peer]
<riceandbeans>
I'm pretty sure we just made the pilot episode right here
Narzew has quit [Read error: No route to host]
<pipework>
adaedra: -client ain't so bad. But who cares if jruby is slow to start?
<pipework>
My PS1 won't be using jruby anytime soon anyways. I use it for what it's great at, being a fantastic VM implementation for long-running processes.
mistermocha has joined #ruby
baweaver has joined #ruby
<iszak>
wat?
<pipework>
Le JVM, it is awesome
Gadgetoid has left #ruby ["Leaving"]
<iszak>
Yes I know, I like the combination of JVM and the Java API
<noethics>
turn your jvm into a server if the boot time is an issue
<pipework>
I don't care for the Java language itself, but the API, once massaged into your preferred language, cain't so bad.
peter_paule has joined #ruby
<pipework>
in b4 drip
<noethics>
pipework, what language
<noethics>
just jruby?
dinhani has quit [Quit: Leaving.]
<iszak>
pipework: I'm the same.
<noethics>
i love clojure and scala
gattuso has quit [Remote host closed the connection]
<pipework>
noethics: I actually play around with a few JVM languages, but the implementation I have the most experience with is jruby.
<noethics>
java itself isnt that bad either since j8
<pipework>
Rhino behind that.
pen has quit [Remote host closed the connection]
<riceandbeans>
begone you
<pipework>
noethics: I have a few languages to learn in a list. Ocaml is first, second is clojure (I know lisp and scheme too anyways)
<noethics>
super easy to learn clojure if you know lisp
<Senjai>
?ot
<ruboto>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
Notte has quit []
Spami has joined #ruby
hinbody has quit [Quit: leaving]
pen has joined #ruby
nofxx has joined #ruby
baweaver has quit [Ping timeout: 256 seconds]
mistermocha has quit [Ping timeout: 240 seconds]
chouhoul_ has quit [Remote host closed the connection]
PotatoCrisps has joined #ruby
<pipework>
noethics: Most definitely. I think I'll spend most of my time learning cool things like ring and whatnot. I've been daydreaming about using the jruby to interact with much more complex systems written in clojure.
<pipework>
I have too many projects anyways.
chouhoulis has joined #ruby
gattuso has joined #ruby
<headius>
is that ruboto message automated?
<pipework>
headius: It was triggered by Senjai
momomomomo has quit [Ping timeout: 246 seconds]
<Senjai>
headius: No, it was triggered by ?ot
<headius>
ahhh
<apeiros>
? triggers factoids
<Senjai>
It's also a suitable replacement for vitamin C
Guest64664 has quit [Remote host closed the connection]
pullphinger has quit []
haxrbyte has quit [Remote host closed the connection]
JakFrist has joined #ruby
haxrbyte has joined #ruby
howdoicomputer has quit [Read error: Connection reset by peer]
baweaver has quit [Ping timeout: 250 seconds]
seal has quit [Quit: Ex-Chat]
acke has quit [Ping timeout: 256 seconds]
Scroff has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
pengin has quit [Remote host closed the connection]
icebourg has quit [Read error: Connection reset by peer]
icebourg_ has joined #ruby
haxrbyte_ has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
Xiti has quit [Quit: Xiti]
RegulationD has quit [Remote host closed the connection]
niemcu has quit [Ping timeout: 240 seconds]
Scroff has quit [Ping timeout: 244 seconds]
olistik has quit [Remote host closed the connection]
Carnage\ has quit []
olistik has joined #ruby
haxrbyte has quit [Ping timeout: 244 seconds]
djbkd has quit [Quit: My people need me...]
rawtext has joined #ruby
rawtext has left #ruby [#ruby]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
workmad3 has joined #ruby
Xiti has joined #ruby
olistik has quit [Ping timeout: 255 seconds]
sshuff has quit [Quit: Leaving]
baweaver has quit [Remote host closed the connection]
baweaver has joined #ruby
pengin has joined #ruby
Marsupermammal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Junaos_ is now known as Junaos
Junaos has quit [Changing host]
Junaos has joined #ruby
howdoicomputer has joined #ruby
pskosinski has quit [Quit: Connection closed for inactivity]
fmcgeough has quit [Quit: fmcgeough]
drewo has joined #ruby
jcoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gamename has quit [Read error: Connection reset by peer]
blue_deref has joined #ruby
djbkd has joined #ruby
tmtwd has quit [Ping timeout: 246 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iamse7en has joined #ruby
PotatoCrisps has quit [Quit: Leaving...]
axl_ has quit [Quit: axl_]
sharpmachine has quit [Remote host closed the connection]
<iamse7en>
Hello. I'm trying a row number to my wice_grid table, but getting `unexpected tOP_ASGN` on `g.column do { 0 += 1 } Isn't this the correct way to increment in ruby?
sharpmachine has joined #ruby
<apeiros>
iamse7en: you can't mix do/end and {}
zendrix has quit [Remote host closed the connection]
<apeiros>
this part: `do {`
<iamse7en>
sorry, i didn't actually ahve that in my code. i had a do end block but was converting to one line for irc
<apeiros>
aaaand no, you can't do `0 += 1` either
Papierkorb has joined #ruby
Pupeno_ has joined #ruby
<apeiros>
do/end can be written on a single line without any issue…
<iamse7en>
i just want the row to be 1, 2, 3 etc. how do i increment
iamninja has joined #ruby
<apeiros>
and you can always just replace newlines with ;
sharpmachine has quit [Remote host closed the connection]
dopie has joined #ruby
<apeiros>
x += 1 # this works
wprice has joined #ruby
rodferso1 has quit [Ping timeout: 252 seconds]
<apeiros>
0 += 1 # this does not. you can't assign to 0. think about it, you do: 0 = 0 + 1 - and obviously you can't do 0 = 1
<iamse7en>
right. okay i just need to define x then
mistermocha has joined #ruby
<apeiros>
hard to tell what you have to do from the information you provided…
<iamse7en>
apeiros, thanks! i just changed 0 to x and then defined x as 0 above that line and it works.
christiandsg has joined #ruby
felixjet__ has quit [Read error: Connection reset by peer]
victortyau has quit [Quit: Leaving]
devdazed has quit [Quit: Computer has gone to sleep.]
gamename has joined #ruby
aryaching has quit [Ping timeout: 256 seconds]
mistermocha has quit [Ping timeout: 264 seconds]
felixjet__ has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
mary5030_ has joined #ruby
sgambino has joined #ruby
jpfuentes2 has joined #ruby
<jhass>
sounds like a complicated way to say x = 1
freerobby has quit [Quit: Leaving.]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
sparr has quit [Changing host]
sparr has joined #ruby
mary5030 has quit [Ping timeout: 255 seconds]
r_rios has quit [Remote host closed the connection]
bruno- has quit [Quit: Lost terminal]
<iamse7en>
well i want it to start at 0 and increment for each row
wottam has joined #ruby
solocsha1 has quit [Ping timeout: 255 seconds]
s2013 has joined #ruby
wottam has quit [Client Quit]
bruno- has joined #ruby
charliesome has quit [Quit: zzz]
<al2o3-cr>
iam8ight
eggoez has quit [Ping timeout: 240 seconds]
kevin has joined #ruby
troyready has joined #ruby
kies^ has quit [Ping timeout: 265 seconds]
kevin is now known as Guest94034
Pupeno_ has quit [Remote host closed the connection]
rbennacer has quit [Ping timeout: 248 seconds]
solocsha1 has joined #ruby
<Guest94034>
Hello! Has anyone ever heard of Posty?
s2013 has quit [Ping timeout: 264 seconds]
thalassa has quit [Ping timeout: 264 seconds]
phutchins has joined #ruby
<al2o3-cr>
yeah, they post ya letters don't they?
eggoez has joined #ruby
last_staff has quit [Quit: try {sleep} catch {Z} finally {recharge}]
<al2o3-cr>
ignore me!
quazimod1 has quit [Ping timeout: 252 seconds]
<jhass>
al2o3-cr: yeah, better stick to -offtopic ;P
djbkd has quit [Remote host closed the connection]
<Guest94034>
Its a configuration for Postfix
<Guest94034>
But it wont work. I cant get the mysql working in ruby
Pupeno has joined #ruby
<al2o3-cr>
jhass: will be doing :P
werelivinginthef has quit [Remote host closed the connection]
charliesome has joined #ruby
djbkd has joined #ruby
gamename has quit [Remote host closed the connection]
gamename has joined #ruby
pengin has quit [Remote host closed the connection]
Aswebb_ has quit [Remote host closed the connection]
gamename has quit [Read error: Connection reset by peer]
pdoherty has quit [Ping timeout: 246 seconds]
ruurd has joined #ruby
thalassa has joined #ruby
dellavg has quit [Ping timeout: 264 seconds]
ruurd has quit [Client Quit]
Guest94034 has quit [Quit: Page closed]
howdoicomputer has quit [Ping timeout: 240 seconds]
Igorshp has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
spider-mario has quit [Read error: Connection reset by peer]
pengin has joined #ruby
icebourg_ has quit []
c355E3B has quit [Quit: Connection closed for inactivity]
baweaver has quit [Remote host closed the connection]
acke has joined #ruby
Rickmasta has joined #ruby
hotpancakes has quit [Remote host closed the connection]
acke has quit [Ping timeout: 256 seconds]
emptyflask has joined #ruby
Sid05 has joined #ruby
dgutierrez1287 has joined #ruby
RegulationD has joined #ruby
<slash_nick>
So...Using Net::HTTP, I'm comparing running 2 http requests in series to running the same two requests in parallel. I'm not seeing any noticeable difference between the two; does Net::HTTP do some kind of blocking that would prevent the two from actually running in parallel?
JDiPierro has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
emptyflask has quit [Remote host closed the connection]
dgutierrez1287 has quit [Ping timeout: 248 seconds]
senayar has quit [Remote host closed the connection]
Timba-as has quit [Quit: Be back later ...]
hotpancakes has joined #ruby
RegulationD has quit [Ping timeout: 252 seconds]
JDiPierro has quit [Remote host closed the connection]
ivanskie has joined #ruby
<toretore>
slash_nick: code?
<toretore>
pretty sure ure doin it rong
Sid05 has quit [Quit: Sid05]
JDiPierro has joined #ruby
JDiPierro has quit [Remote host closed the connection]
Rahul_Roy has quit [Quit: Connection closed for inactivity]
rbennacer has joined #ruby
jobewan has quit [Quit: Leaving]
drewo has quit [Ping timeout: 246 seconds]
blaines_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
renderfu_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
<toretore>
well, what does Concurrent::Promise.new(&b) do? unless it ends up running on different threads it's not going to be concurrent
<slash_nick>
toretore: it does...
rbennacer has quit [Remote host closed the connection]
Igorshp has joined #ruby
<slash_nick>
toretore: Concurrent::Promize#zip builds a promise that produces the result of promises in an Array and fails if any of them fails.
stantonnet has joined #ruby
mandarinkin has quit [Ping timeout: 250 seconds]
<toretore>
you should simplify it to see that it actually does do what you think it does
renderful has quit [Ping timeout: 244 seconds]
<slash_nick>
toretore: i zipped 64 requests to httpbin.org/delay/1... the 64 requests finished in 45.6 seconds... would that imply that they ran in a somewhat parallel fashion?
ruby-lang481 has joined #ruby
<toretore>
well, if it were serial it would most likely be >64s
<slash_nick>
right...
jeramyRR has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<toretore>
it may be using a thread pool underneath, so not running each of them concurrently
fenjamin has joined #ruby
Muhannad has quit [Ping timeout: 246 seconds]
howdoicomputer has joined #ruby
jlast has joined #ruby
<fenjamin>
hi, i would like to know how to use javascript within ruby - i have a javascript file I woud like to be triggered by a ruby file.
thiagovsk has quit [Quit: Connection closed for inactivity]
<fenjamin>
this javascript file needs to be triggered and modified by ruby logic
<fenjamin>
the overall logic for the program is ruby however javascript files are dependencies
<toretore>
define triggered and modified
<toretore>
need more information
iamse7en has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cvtsx1 has joined #ruby
Pupeno has quit [Remote host closed the connection]
<fenjamin>
so i would prefer an event to modify the javascript file - update the chart -
leonardoajim has quit [Quit: Be back later ...]
mary5030_ has quit [Remote host closed the connection]
<fenjamin>
when the event initiates, i would like the javascript chart to update with the activity
<toretore>
are you talking about ruby on the server and then this running in a browser on the client?
<slash_nick>
toretore: thanks!
<fenjamin>
im trying to make it a protocol therefore stateless
<toretore>
slash_nick: did you figure it out?
<Shidash>
did rubygems recently switch to udp? suddenly having problems using it over Tor and I never used to
<toretore>
fenjamin: i don't really understand what it is you're trying to do
cvtsx has quit [Ping timeout: 265 seconds]
<fenjamin>
I'm trying to visualize transactions - when the transaction takes place, the chart updates
frem has quit [Quit: Connection closed for inactivity]
Igorshp has quit [Remote host closed the connection]
Ropeney has joined #ruby
Igorshp has joined #ruby
drewo has joined #ruby
<fenjamin>
so when there is a purchase, the chart updates equal to the amount purchased.
<toretore>
you still didn't say in which context this is running.. where is this ruby and js code running?
Igorshp has quit [Remote host closed the connection]
<fenjamin>
it would be hosted locally
<toretore>
are you running the js in a browser?
<fenjamin>
yes
<toretore>
and then running a ruby script that needs to communicate data to the js running in the browser?
arooni-mobile__ has quit [Quit: Leaving]
<fenjamin>
yes!:-)
Sid05 has joined #ruby
<toretore>
ok, finally
<toretore>
so you have an http (presumably) server written in ruby
<fenjamin>
jsonp but yes
<toretore>
the javascript in the browser makes requests to this server via http
<slash_nick>
toretore: not figured out, but reading the documentation a bit more closely I see something suspect... "A *timeout* value can be passed to `value` to limit how long the call will block. If `nil` the call will block indefinitely. If `0` the call will not block."... The methods I'm using don't take the timeout argument, so I'm guessing they'll "block indefinitely"
<toretore>
then you must write the javascript that makes the request, parses the response and uses the data in the response to update the graph
leonardoajim has joined #ruby
<toretore>
slash_nick: which shouldn't be a problem
<toretore>
"block indefinitely" means "until it's done"
Muhannad has joined #ruby
jerematic has quit [Remote host closed the connection]
<slash_nick>
toretore: wouldn't i want "will not block"?
<toretore>
no
bnobu has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
the call to `value` is the synchronization point - where you join the n threads together and get their values
<toretore>
(presumably - value being Promise#value)
<slash_nick>
ok, so i would want that to block until the last one's ready
<toretore>
yes
<toretore>
you don't really need to use a library for something this simple, you can just use threads directly
<fenjamin>
yes i agree - i will use RESTful to make the request then jsonp to update the chart - this can be done entirely in javascript? or can ruby structure the logic?
dopie has quit [Quit: This computer has gone to sleep]
Tarkers34|2 has quit [Ping timeout: 250 seconds]
<toretore>
the client side must be done in js
paulcsmith has quit [Client Quit]
<toretore>
you need to write the js logic for receiving the updates from the server and inserting it into the graph
<fenjamin>
i agree. and the server side can be ruby?
<slash_nick>
toretore: I guess I'll try without the concurrent-ruby library tomorrow... thanks again for the feedback
<baweaver>
Angular isn't bad per-se, but most people don't need it
<Senjai>
I support a component based architecture. Like with backbone, and whatever other libraries you need
<Senjai>
If you want angular, use ember instead.
<baweaver>
Honestly I don't have an opinion of Ember
<Senjai>
Angular has pretty much abandoned its community, and has shown a few poor design decisions
Scroff has quit [Ping timeout: 240 seconds]
<baweaver>
That I have to agree with only partially
<baweaver>
They did a heel-face turn after the community freaked out
<Senjai>
Yeah, but that was all PR, they still have no upgrade path from 1.x to 2.x
<baweaver>
Though letting the lead of Durandal have at it for 2.0 was a nightmare mistake
<baweaver>
I won't disagree that that's a freaking mess.
ndrei has quit [Ping timeout: 252 seconds]
<baweaver>
and I would say go to Ember, but I don't know it well enough to endorse it
<Senjai>
Also google does a lot of stupid stuff, like dropping dart
<Senjai>
It's gotten a lot better
<Senjai>
the best thing to do, is your research
<baweaver>
^
<baweaver>
pretty much that
<Senjai>
But I'm a big fan of backbone, + libraries like react, or whatever view layer you want, or marionette
<baweaver>
I just ended up migrating towards the backend more so I don't do quite as much frontend research
<Senjai>
Simply because I dont believe that a framework can exist for the scope of what a frontend can evolve as, and stay opinionated
<baweaver>
though if it's still a matter of interest I can go over it.
<baweaver>
I hesitate to call React a framework from what I've heard of it.
<Senjai>
We might go a bit ot with that discussion, I think we are already, but always interested in hearing opinions in that other channel
<Senjai>
baweaver: It isnt, I'd call it a library
<Senjai>
or a view layer
<baweaver>
Me and cirwin were talking about it a while back
<fenjamin>
ok i will implement RESTful using $http in Ruby without a backbone
<baweaver>
Don't implement
havenwood has quit [Read error: Connection reset by peer]
<baweaver>
search first
ledestin has quit [Client Quit]
<baweaver>
better: write and article on what you find out
jeramyRR has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver>
teaching someone else is a great way to reinforce what you've learned yourself.
duncannz has joined #ruby
ndrei has joined #ruby
<fenjamin>
baweaver: truth
senayar has joined #ruby
<baweaver>
that, and having a good blog tends to get you a lot of attention
nofxx has joined #ruby
nofxx has joined #ruby
<Senjai>
baweaver: Do you get decent attention on yours? :P
<Senjai>
j/c
<baweaver>
I have 4-5 recruiters a day contacting me if that's any metric
<toretore>
fenjamin: don't try to use anything like ember or backbone - it will only complicate things in your case
<toretore>
you should be concerned with learning the basics first
<baweaver>
depends if they need a RESTful API
<baweaver>
oh, they're new?
<baweaver>
then definitely avoid those for a while
<baweaver>
stay straight Rails
<baweaver>
worry about the fancy stuff later, or you'll burn out
<fenjamin>
thanks, it's clear
<baweaver>
Rails alone from scratch bears that risk, trying to tag on anything else is asking for nightmares early on.
<baweaver>
I've seen people do it, but they were also veterans of other languages first
<baweaver>
not saying you're not, but giving a general frame of reference here.
<baweaver>
honestly I have no idea of your level
blaines has joined #ruby
<Senjai>
is alias a reserved word?
<baweaver>
>> alias
<ruboto>
baweaver # => /tmp/execpad-8b2a12e60bf7/source-8b2a12e60bf7:3:in `<main>': undefined method `Exception' for class ...check link for more (https://eval.in/393754)
<Senjai>
ty
<shevy>
don't alias your dams!
<baweaver>
I call that one hoover
<shevy>
haha
blackmes1 has quit [Ping timeout: 265 seconds]
<baweaver>
it's used for aliasing methods
coffeecupp has joined #ruby
hotpancakes has quit [Remote host closed the connection]