capicue has quit [Read error: Connection reset by peer]
capicue_ has joined #ruby
nanothief has joined #ruby
greenrose has quit [Read error: Connection reset by peer]
larissa has quit [Ping timeout: 246 seconds]
Kamuela has joined #ruby
<PPH>
trying to pass a variable to a partial to say if a column should be display or not... but I don't want other partials to have to set this variable to false they should just not pass the variable at all
<PPH>
other callers of the partial*
<bricker>
PPH: it's bad design if you have to check if it's defined
mikepack has joined #ruby
<bricker>
"I don't want other partials to have to"... well you can't have it both ways.
Banistergalaxy has quit [Ping timeout: 272 seconds]
lukec has joined #ruby
motto has quit [Quit: Sto andando via]
<bricker>
PPH: if your partial needs a variable defined in order to load properly, then you better pass it in.
rickmasta has quit [Quit: Leaving...]
<PPH>
bricker: ok
<shevy>
PPH what I tend to do is, I initialize all instance variables in a method call reset. if I dont need the @ivar to have a specific value, I initialize it to nil. then, if I want to check if it was modified, I just do: if @foo
Kamuela has quit [Remote host closed the connection]
<shevy>
but you can check if a method is defined too, I think
timonv has quit [Remote host closed the connection]
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
<PPH>
shevy: does it apply to rails partials?
<shevy>
I dont know what is a rails partials. if it uses ruby code, it surely apples to ruby code
timonv has joined #ruby
<shevy>
volty, look what I get: defined? x # => "method"; defined? xy # => nil; defined? $array # => "global-variable"
<shevy>
I seem to either get nil, or a string back, through defined?
srji has joined #ruby
<volty>
i don't know about the right way to handle with partials
Kamuela has joined #ruby
<PPH>
well I'll ask my question into the rubyonrails channel thanks for the help :)
<Kamuela>
ok
greenrose has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<PPH>
This question was ruby oriented then it moved slowly to rails... lol
kaspergrubbe has quit [Remote host closed the connection]
<volty>
i just know that if tomorrow I find a case where i call methods if present (instead of checking for 'type' of what is passed) I will do it with defined?
kevinykchan has quit [Quit: Computer has gone to sleep.]
<volty>
(or respond_to?, or whatever appropriate)
JonahR has joined #ruby
<shevy>
respond_to? seems better
<shevy>
it basically is a "does this object have this method xyz?"
<volty>
yes but that is for methods
<shevy>
yeah
kevinykchan has joined #ruby
tharindu has quit [Ping timeout: 252 seconds]
<shevy>
for @ivars you could use .instance_variable_defined?
hiroyuki has quit [Read error: Connection reset by peer]
<shevy>
and if you use global variables then you should use php
<shevy>
:D
<volty>
:)
timonv has quit [Ping timeout: 244 seconds]
lupine has joined #ruby
threesome has joined #ruby
mikepack has quit [Remote host closed the connection]
i8igmac has joined #ruby
havenwood has joined #ruby
srji has quit [Quit: leaving]
Apane has quit [Ping timeout: 246 seconds]
larissa has joined #ruby
kevinykchan has quit [Ping timeout: 272 seconds]
ewnd9 has quit [Ping timeout: 260 seconds]
ckinni has joined #ruby
predator217 has joined #ruby
myappleguy has joined #ruby
vlad_starkov has joined #ruby
<PPH>
just FYI, the answer to my problem was: variable ||= nil :)
CreativeEmbassy has joined #ruby
crazymykl has quit [Read error: Operation timed out]
reset has joined #ruby
nobitanobi has quit [Ping timeout: 246 seconds]
tsykoduk is now known as zz_tsykoduk
carlyle has joined #ruby
nwertman has quit [Ping timeout: 240 seconds]
predator117 has quit [Ping timeout: 272 seconds]
<volty>
ah, an asking expert! :)
Astralum has quit [Ping timeout: 272 seconds]
<shevy>
:P
<shevy>
he hates @ivars!
nwertman has joined #ruby
<volty>
naa, he likes testing ppl
pel_daniel has left #ruby [#ruby]
Hanmac has joined #ruby
hogeo has joined #ruby
Hanmac1 has quit [Ping timeout: 268 seconds]
<volty>
he has a secret register in which he's filling votes :)
felixjet has joined #ruby
<Kamuela>
reinstalling mah rubies
<shevy>
Kamuela oh noes
<Kamuela>
haha, had to. xubuntu reinstall
<Kamuela>
but at least now i has a fat portion of disk space given to lunix :)
mklappstuhl has quit [Remote host closed the connection]
Mars has joined #ruby
chomskiii has quit [Read error: Connection reset by peer]
<Kamuela>
ls
<Kamuela>
wewps
ValicekB has quit [Ping timeout: 246 seconds]
Mars is now known as Guest38382
chomskiii has joined #ruby
volty has quit [Quit: have to concentrate]
jrhe has quit [Quit: jrhe]
maletor has joined #ruby
hogeo has quit [Ping timeout: 246 seconds]
<shevy>
wewps?
bootcoder has quit [Quit: Konversation terminated!]
sn0wb1rd has quit [Quit: See ya]
yfeldblum has quit [Remote host closed the connection]
bootcoder has joined #ruby
ngoldman has joined #ruby
yfeldblum has joined #ruby
vlad_starkov has quit [Ping timeout: 260 seconds]
ngoldman has quit [Client Quit]
<withnale_>
is it possible to do a require_relative on a file without a .rb extension?
baroquebobcat has quit [Quit: baroquebobcat]
<heftig>
withnale_: can't you give it an extension?
<withnale_>
Ideally no
<withnale_>
I'm writing a DSL
mrsolo has quit [Quit: This computer has gone to sleep]
Guest14991 has quit [Remote host closed the connection]
nanoyak has quit [Quit: Computer has gone to sleep.]
Bish_ is now known as Bish
hogeo has quit [Ping timeout: 246 seconds]
kobain has quit [Remote host closed the connection]
kobain has joined #ruby
Hanmac1 has joined #ruby
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamblack has quit [Quit: jamblack]
hogeo has joined #ruby
Hanmac has quit [Ping timeout: 244 seconds]
<rjhunter>
nobitanobi: it's just one of the many literal quoting styles -- ruby inherited many from perl. %{} is useful for when your text contains " or ' characters
<rjhunter>
yanglvxiong's question made me realise i'd never tried embedding Ruby in C before, so I thought I'd take a look
<rjhunter>
I can't find a nice guide, but I managed to fiddle my way through
<rjhunter>
if yanglvxiong comes back, I think I can help him/her
heidi has quit [Quit: Leaving.]
<Kamuela>
ok this is my referral link, as far as i know it doesn't work anymore, but cool enough to check out anyway https://www.nitrous.io/join/XFPnrr7k1SA
<Kamuela>
allows for tandem coding on multiple boxes
<Kamuela>
slick as ishhh
xorgnak has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
blarghmatey has joined #ruby
braincrash has quit [Read error: Operation timed out]
<Kamuela>
shevy, I'm sorry :( But I remembered why I hated it :)
carlyle has quit [Ping timeout: 245 seconds]
mikepack has joined #ruby
<nobitanobi>
Kamuela, Django? And why did you hate it?
<Kamuela>
nobitanobi, I like python, just don't like django very much compared to rails
Mars has joined #ruby
<nobitanobi>
may I ask why though? I tried Django a long time ago
ckinni has joined #ruby
Mars is now known as Guest27594
<Kamuela>
not sure, just didn't seem to "click" with my personality the way rails does. the funnier part is that i finished a small project in django and still haven't one in rails though... lol
gr33n7007h has joined #ruby
<nobitanobi>
:)
rh1n0 has joined #ruby
<nobitanobi>
I recall Django comes with a pretty nice admin interface
<nobitanobi>
'by default'
endash has quit [Ping timeout: 260 seconds]
amacgregor has joined #ruby
mikepack has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Ping timeout: 252 seconds]
<Kamuela>
yeah but then there's a rails_admin gem so not too big of a leap
<Kamuela>
it's gonna come down to, like everything always does, "philosophy"
hornairs has quit [Quit: hornairs]
<Kamuela>
which i was substitute as "self-righteousness" and "resistance to change"
amacgregor_ has joined #ruby
<Kamuela>
if django tweaked itself a little bit and became more like rails i think it could kick some major ass
plotter has quit [Quit: Leaving]
braincrash has joined #ruby
timonv has joined #ruby
<Kamuela>
but to be not rails will likely be a more important guiding principle
Guest27594 has quit [Ping timeout: 268 seconds]
amacgregor__ has quit [Ping timeout: 246 seconds]
ddpunk has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
Monie has joined #ruby
taternuts has quit []
xybre has joined #ruby
dhruvasagar has quit [Ping timeout: 265 seconds]
simoz has joined #ruby
dhruvasagar has joined #ruby
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
Hanmac has joined #ruby
gr33n7007h has quit [Quit: Where's John Conner]
Mon_Ouie has joined #ruby
Guest2443 has quit [Ping timeout: 264 seconds]
Astralum has joined #ruby
Hanmac1 has quit [Ping timeout: 272 seconds]
nowthatsamatt has joined #ruby
nowthatsamatt has quit [Client Quit]
jkhwan has quit [Remote host closed the connection]
apeiros has quit [Ping timeout: 260 seconds]
simoz has quit [Ping timeout: 260 seconds]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
joelteon has joined #ruby
<joelteon>
it's been a long time since I wrote a gem, and I don't remember how you set up the require paths properly in development
<joelteon>
my bin/shipmaster requires "lib/shipmaster", but that requires "shipmaster/version" which isn't in the load path, though it's in lib/. what do I do
ewnd9 has quit [Ping timeout: 272 seconds]
achru has joined #ruby
fgo has joined #ruby
ValicekB has quit [Ping timeout: 268 seconds]
RichardBaker has joined #ruby
`MArceLL` has joined #ruby
Saima has joined #ruby
Saima has left #ruby [#ruby]
nomenkun has joined #ruby
Tearan has joined #ruby
Tearan has quit [Client Quit]
soba has joined #ruby
Tearan has joined #ruby
DanielRb has joined #ruby
wiiw has joined #ruby
<wiiw>
a = true ; b = false ; not a and not b == not ( a or b )
<wiiw>
is it true ?
mercwithamouth has joined #ruby
ewnd9 has joined #ruby
zipper has joined #ruby
lethjakman has joined #ruby
ckinni has joined #ruby
ewnd9 has quit [Remote host closed the connection]
<existensil>
>> a = true ; b = false ; not a and not b == not ( a or b )
<existensil>
joelteon: I'm guessing you want something like this in your bin script: $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
joelteon has left #ruby ["bye"]
<existensil>
add the lib directory of the parent directory to the front of the load path
lethjakm1 has quit [Ping timeout: 264 seconds]
ValicekB has joined #ruby
Soda has joined #ruby
<existensil>
then your bit can just require 'shipmaster', and shipmaster can require 'shipmaster/version' like you want
<existensil>
s/bit/bin
vlad_starkov has joined #ruby
ner0x has quit [Remote host closed the connection]
DonRichie has joined #ruby
sergicles has quit [Quit: sergicles]
Mars has joined #ruby
Mars is now known as Guest43113
baroquebobcat has quit [Quit: baroquebobcat]
fir3bug has joined #ruby
fir3bug has left #ruby [#ruby]
zz_michael_mbp is now known as michael_mbp
funburn has quit [Quit: funburn]
Banistergalaxy has quit [Ping timeout: 248 seconds]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
nomenkun has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 260 seconds]
<sandeepk>
techyOn: use bundle exec middleman server
nomenkun has joined #ruby
<tachy0n>
ah that worked thanks
krz has joined #ruby
<sandeepk>
cool
<tachy0n>
so files named <name>.html.erb in my project path are only loadable this way?
<tachy0n>
I picked this work up off of wrapbootstrap
<tachy0n>
thinking I'd get pure HtML / CSS not a ruby project :)
tagrudev has joined #ruby
<tachy0n>
oh nevermind it puts them in build
mengu has joined #ruby
<rjhunter>
tachy0n: `bundle exec middleman build` compiles all the files. `bundle exec middleman server` loads them per-request (I don't think middleman stores a compiled copy until you tell it to build)
lethjakman has quit [Ping timeout: 260 seconds]
Deele has quit [Ping timeout: 260 seconds]
<tachy0n>
rjhunter: thanks
nomenkun has quit [Ping timeout: 268 seconds]
<wiiw>
>> a = true ; b = false ; (not a and not b) == (not ( a or b ))
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<rjhunter>
tachy0n: the idea is that you can run `server` while you fiddle around with the files (edit file, refresh browser),then run `build` when you're "done" and want to give the files to someone or something without ruby
thekkid has quit [Ping timeout: 260 seconds]
<tachy0n>
yeah its similar to what I use yeoman and grunt
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
nomenkun has joined #ruby
tylersmi_ has quit [Remote host closed the connection]
skaflem has joined #ruby
lnormous has joined #ruby
nomenkun has quit [Remote host closed the connection]
mikepack has joined #ruby
nomenkun has joined #ruby
xorgnak___ has joined #ruby
pragmatism has joined #ruby
Davey has joined #ruby
sayan has joined #ruby
ddpunk has joined #ruby
gstamp has quit [Read error: No route to host]
mikepack has quit [Ping timeout: 272 seconds]
xorgnak___ has quit [Remote host closed the connection]
dangerousdave has joined #ruby
nomenkun has quit [Ping timeout: 264 seconds]
kobain has quit [Ping timeout: 260 seconds]
macmartine has quit [Remote host closed the connection]
xorgnak___ has joined #ruby
gstamp has joined #ruby
Soda has quit [Remote host closed the connection]
<shevy>
Kamuela are you still here?
<shevy>
I cant see much, could be a netsplit
<shevy>
test
<Kamuela>
i'm hrtr
<Kamuela>
btu baskfin up cna u her me
<Kamuela>
shevy, gets a ping
vlad_starkov has quit [Remote host closed the connection]
xorgnak___ has quit [Remote host closed the connection]
ddpunk has quit [Ping timeout: 272 seconds]
xorgnak___ has joined #ruby
xorgnak___ has quit [Remote host closed the connection]
fgo has quit [Remote host closed the connection]
xorgnak___ has joined #ruby
<shevy>
aha
<shevy>
Kamuela how much ruby do you know?
<shevy>
can you use block_given? and yield already?
io_syl has quit []
<Kamuela>
i thought yield was rails!
<sevenseacat>
nope
myappleguy has joined #ruby
jprovazn has joined #ruby
XenoWolf has quit [Read error: Operation timed out]
<Kamuela>
shevy, "can i use" i don't know, but i'm looking at a small example right now and it seems like badassery
xorgnak___ has quit [Remote host closed the connection]
<Kamuela>
is this not what one would call "polymorphism?"
<sevenseacat>
no
xorgnak___ has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Kamuela>
i don't know where ruby decides "run time" and "compile time" split
jbpros has joined #ruby
Mon_Ouie has quit [Ping timeout: 244 seconds]
graydot has quit [Quit: graydot]
<shevy>
Kamuela yield and block_given? relate to blocks in ruby
xorgnak___ has quit [Remote host closed the connection]
xorgnak___ has joined #ruby
Guest43113 has quit [Remote host closed the connection]
myappleguy has quit [Ping timeout: 264 seconds]
<shevy>
Kamuela what is compile time in ruby? :>
<Kamuela>
shevy, so yield is basically shorthand for the block
graydot has joined #ruby
wiiw has left #ruby [#ruby]
<shevy>
with yield you grab the block
<Kamuela>
and with the else case for block_given you have a default behavior?
<shevy>
Kamuela it simply is as if you provided an extra argument to your method
<shevy>
Kamuela which methods in ruby can accept a block?
vlad_starkov has joined #ruby
macmartine has joined #ruby
dnyy has joined #ruby
huttan has joined #ruby
fluffheadsr has quit [Ping timeout: 268 seconds]
<Kamuela>
shevy, which methods? i do not know. but this example uses a try case
bkolden has joined #ruby
<shevy>
Kamuela the answer is
<shevy>
all methods
jbpros has quit [Quit: jbpros]
<shevy>
blocks are a huge difference from ruby to i.e. php
sandeepk has quit [Quit: Leaving...]
<Kamuela>
shevy, ah trick question. i was thinking specifically. but before you said that, all methods. you made me think because you asked it had to be more specific
XenoWolf has joined #ruby
<Kamuela>
but the fact that ruby does that whacky pretty stuff i'm actually very open to
<Kamuela>
reflexive syntax i guess is what i'd call it
<shevy>
Kamuela well it is bad to use questions where people do not have to think
banisterfiend has quit [Quit: Computer has gone to sleep.]
<xorgnak___>
:SYN
<shevy>
ok so now you know what a block is and how to use it
Eiam has quit [Ping timeout: 260 seconds]
<Kamuela>
i don't mind. either way, i am learning something
<shevy>
Kamuela the next question will be around the & symbol in ruby
<Kamuela>
when you say "and how to use it" hmm, i guess not?
lnormous has quit [Ping timeout: 252 seconds]
<shevy>
but let me think to formulate a question...
<shevy>
not?
<shevy>
well that is simple now
<shevy>
with: block_given? you can query if you have passed a block to a method or not
<shevy>
and actually, that is it about blocks... I mean, we can get to Procs soon... but other than that... there is not much else to know about blocks is there?
<xorgnak___>
:SYN
<shevy>
oh
huttan has quit [Ping timeout: 252 seconds]
<shevy>
Kamuela how many blocks can you pass to a method?
baldivia has joined #ruby
xorgnak___ has quit [Remote host closed the connection]
xorgnak___ has joined #ruby
<xorgnak___>
:SYN
<shevy>
xorgnak___ what
<DouweM>
shevy: right, there's not much else to know about blocks once you have yield/block_given?/&block var/block is a Proc
<heftig>
Kamuela: there's no "compile time", closest you get is "parse time", when the code is loaded
OdNairy has joined #ruby
<Kamuela>
shevy, i'm going to say 1 thought it might be possible you end up with an array of blocks?
xorgnak___ has quit [Remote host closed the connection]
xorgnak___ has joined #ruby
<xorgnak___>
:SYN
<shevy>
DouweM yeah... I'll get to the latter two soon I suppose...
sandeepk has joined #ruby
<shevy>
Kamuela how would you call these?
<DouweM>
shevy: and one last thing: array decomposition in block args
<shevy>
Kamuela or let's start simpler, how do you call one block?
<shevy>
don't scroll up ;)
<Kamuela>
yield[0] yield[1] ??
<shevy>
hmmmmmmm
<h0rrorvacui>
whats is going on?
<h0rrorvacui>
teaching him ruby?
noop has joined #ruby
<shevy>
damn
<shevy>
NoMethodError: undefined method `glock_given?' for main:Object
<shevy>
I need some coffee...
<h0rrorvacui>
LoL
<sandeepk>
shevy: I would say it about ruby and other languages here. Ruby has a very unique implementation of closures as compare to other counter parts
<sevenseacat>
this isnt america. no glocks here.
<shevy>
Kamuela cool... that actually works
<Kamuela>
shevy, but that wasn't the way you were used to doing it?
<shevy>
Kamuela haha well it surprised me that it worked :)
<shevy>
I really need a break, be back in some minutes
<Kamuela>
shevy, i swear that i just TRUST ruby to handle all things crazy
<heftig>
sevenseacat: isn't the glock an austrian pistol?
<Kamuela>
no glock is american isn't it
<sevenseacat>
no idea. i know its a gun and they love guns in the states.
<h0rrorvacui>
heftig: nope
warren has joined #ruby
<h0rrorvacui>
yes
lmickh has joined #ruby
<h0rrorvacui>
its austrian
<h0rrorvacui>
its not american *
falood has quit [Ping timeout: 264 seconds]
<h0rrorvacui>
I own one sadly.
<Kamuela>
word
<Kamuela>
why is that sad?
xorgnak___ has quit [Remote host closed the connection]
<warren>
Anyone know of an example code where I can see require 'someffi' and rescue <native implementation>?
falood has joined #ruby
<h0rrorvacui>
I'm an American, fits a stereotype.
xorgnak___ has joined #ruby
<xorgnak___>
:SYN
<Kamuela>
h0rrorvacui, to own a glock? only if you're black or latino in the inner city...
Tearan has quit [Quit: Sleepy Badger....]
<Kamuela>
h0rrorvacui, i thought the new stereotype was "AR-killing machine"
<h0rrorvacui>
I own an AR too.
xorgnak___ has quit [Remote host closed the connection]
ElectronFunBaby has joined #ruby
<Kamuela>
h0rrorvacui, fully auto?
<h0rrorvacui>
No.
<Kamuela>
i don't understand the laws well enough
<heftig>
i think you'd be foolish to admit to owning a fully auto rifle on a public channel
<Kamuela>
lots of technically illegal technically not illegal such
xorgnak___ has joined #ruby
<xorgnak___>
:SYN
<h0rrorvacui>
You can own fully auto if you get the permits in my state.
<h0rrorvacui>
You have to get your sheriff's permission here.
<Kamuela>
nice, no clue for the laws here in hawaii
<Kamuela>
we're very liberal (read: new york/california) but i actually think gun ownership is rising
<h0rrorvacui>
I'm in Alabama.
<h0rrorvacui>
So think what you want :P
bkolden has quit [Quit: ChatZilla 0.9.90.1 [Firefox 25.0/20131025151332]]
<Kamuela>
haha i don't think anything. i love muh freedom
<h0rrorvacui>
I'm just a target shooter. I don't even hunt.
<h0rrorvacui>
I can't kill a fly without feeling bad.
<h0rrorvacui>
I shoo them outside.
<Kamuela>
nothing wrong with that. you're not supposed to have a gun to kill people
<Kamuela>
everyone's supposed to have a gun so that everyone thinks twice about killing people
<existensil>
ha
<h0rrorvacui>
Never thought of it that way.
_HolyCow has joined #ruby
<Kamuela>
states with the highest open carry tend to have the lowest amount of violent crime
<h0rrorvacui>
I think we do have a gun culture here in Alabama that builds respect that might be lost in some areas where hunting and gun ownership was different.
<existensil>
i'd say guns are more likely to make a perp think twice about not killing you. you might have a gun, so they have to kill and rob instead of just rob you.
<Kamuela>
it's not a perfect 1:1, like you can throw in chicago which is VERY anti-gun but has gun murders everyday. you can't immediately say it's because of the gun laws, though i'd like to. it also happens to be extremely dense and dense living is harder
<existensil>
Kamuela: the states with the highest carry do not have the lowest violent crime, despite the fact that suchs states are more rural and should have lower violent crime
tachy0n has quit [Quit: ChatZilla 0.9.90.1 [Firefox 25.0/20131025151332]]
<h0rrorvacui>
I don't think we have hardly a violent crime outside our major city here in Alabama.
xcess_denied has quit [Quit: Leaving...]
<h0rrorvacui>
Okay, gun related I should say.
<Kamuela>
existensil, are you going to make a leap somewhere to say that we should stop people from legitimately owning firearms or discouraging it because people who want to do harm use guns?
<h0rrorvacui>
But thats not empirical obviously
xorgnak___ has quit [Remote host closed the connection]
<existensil>
NYC has extremely low violent crime rate, especially considering the correlation between density and crime rates, and hardly any guns
<existensil>
Kamuela: no, just tyring to keep the conversation honest
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
XenoWolf has quit [Ping timeout: 244 seconds]
<existensil>
i don't propose banning guns. i do think purpose built murder machines, which have no practical application outside of that (read: assault weapons) should probably be more strictly controlled
<existensil>
and i'm not a big fan of concealed carry
jkhwan has joined #ruby
<Kamuela>
well full-disclosure, i am one of those nuts that tends to see very strong pro-gun points outweighing almost any anti-gun points
<Kamuela>
concealed carry is the best
<Kamuela>
you're one of 3 dudes who has a gun on your hip
<Kamuela>
the bad guy now kills you 3 first without warning
<existensil>
countries with stricter gun laws almost universally have much lower crime rates than us
<existensil>
though i will admit at least part of that is cultural
<Kamuela>
having a gun on your hip almost says shoot me
<existensil>
but concealed carry just further enshrines violance in our culture
* sevenseacat
looks at the amount of gun crime in Australia
<sevenseacat>
(spoilers: we dont have any)
<Kamuela>
when you say cultural, do you mean that americans are just blood thirsty?
<Kamuela>
because i believe the cultural argument, but when you look at the statistics, there's a real story
mrsolo has quit [Quit: Leaving]
pragmatism has quit [Quit: Leaving...]
<sevenseacat>
i didnt mean to start such a heated discussion >_>
<existensil>
no, but there is evidence that even when guns are removed, Americans still kill each other at a higher rate than other developed nations
<existensil>
its not clear to me, or to many experts i have read, exactly why that is
<Kamuela>
existensil, it's drug violence
<Kamuela>
we have the highest incarceration rate per capita
<Kamuela>
and that is all non-violent drug
<existensil>
haha. i think any attempt at distilling it into a single sentence is deeply flawed
closures999 has quit [Remote host closed the connection]
<Kamuela>
and violence involves drugs at least half the time
<existensil>
and completely overlooks the many many complex reasons for higher violent crime in the US
<existensil>
it is not just drug violence
<Kamuela>
i'm not talking about the use of drugs, i'm talking about gangs financed by drug dealing because it is illegal and stupidly expensive for no reason
<existensil>
although, i agree that drug violence causes a lot of death and fighting the drug war, at least with our current tactics, is ridiculous
<Kamuela>
and what drives the expense is specifically the fact that its outlawed
<existensil>
any tactics that treat regular users/citizens as dangerous criminals is doomed for failure
zoee has joined #ruby
DouweM has quit [Ping timeout: 252 seconds]
dagobah has joined #ruby
<h0rrorvacui>
I wonder if being exposed to guns at a young age helps. I was using guns at about age 6 probably.
<h0rrorvacui>
I've a lot of respect for guns.
<Kamuela>
h0rrorvacui, i was horribly afraid of guns my whole life and have never held one
<h0rrorvacui>
I'm not afraid of them as long as they are not pointed at me.
<h0rrorvacui>
lol
<existensil>
if you take gang/drug/organized-crime related violence out of the statistics i'm pretty sure the USA would still be pretty high on a list of violent crime among developed nations
xcess_denied has joined #ruby
XenoWolf has joined #ruby
<Kamuela>
h0rrorvacui, no wait, that's a lie, i did end up holding a few at this dude's house he had some rifles and pistols
zoee has quit [Client Quit]
<Kamuela>
h0rrorvacui, exactly though, i could see the lack of respect
<existensil>
i was in the Army. I am more afraid of guns after than before.
<Kamuela>
h0rrorvacui, someone pointed one at me and i pushed him back and pushed the gun down
<Kamuela>
h0rrorvacui, you don't point a fucking gun at someone unless you intend to shoot
zoee has joined #ruby
xcess_denied has quit [Client Quit]
olivier_bK has joined #ruby
sandeepk has quit [Quit: Leaving...]
nwertman has joined #ruby
<Kamuela>
existensil, it might be an interest experiment to try just that. you may be surprised. i may be surprised. too often we rely on the numbers of news articles and stuff
<Reach>
ive never used a gun
<existensil>
i just don't understand why people are so eager to equip themselves with the ability to easily and permanently take the lives of other people. if you're getting robbed, give them your stuff. pulling a gun out only escalates.
<Reach>
and have never felt that i need a gun
<Reach>
you people are weird
macmartine has quit [Read error: Connection reset by peer]
<Kamuela>
existensil, the threat of having a gun pulled on someone has a very marked increase in the apprehension of somoene to rob you in the first place
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<rcs>
We're programmers, right? I think any statements that are made here should be backed by stats, instead of just stated as truth.
<existensil>
Reach: I've used them plenty and agree with you.
<krz>
how can i get the child module without using splits. i.e. Foo::Bar
macmartine has joined #ruby
<h0rrorvacui>
I own a lot of my guns because they are family heirlooms.
<krz>
want Bar
<krz>
module/class
<krz>
is there a method to achieve this?
<rcs>
krz: What do you mean?
<krz>
i want to get the class name without Foo::
<sevenseacat>
rcs: interesting
<Kamuela>
Howard Zinn talked about an "infantilization" of society. The idea that more and more of our problems are handled by other people. I think the general fear of guns is one such area where we are infantilized. sevenseacat, if you were anti-gun in truth, wouldn't you advocate that police didn't have them either?
<rcs>
krz: 'Foo::Bar'.split('::').last ?
<krz>
no splits
<krz>
wondering if there is a method specifically for this purpose
lnormous has joined #ruby
<sevenseacat>
Kamuela: why would i say that?
<ElectronFunBaby>
This is a deep convo... for such a place. +1 for Howard Zinn... he was aware.
vlad_starkov has quit [Remote host closed the connection]
<krz>
ah demodulize
olivier_bK has quit [Ping timeout: 252 seconds]
<Kamuela>
lol, i'm sorry. i was an economics and political science major in university
<existensil>
Kamuela: I advocate that police should only carry them when necessary. Clearly, with concealed carry and widespread ownership, it is always necessary in the US, but in other places (Canada, UK, etc) many officers do not.
<Reach>
Kamuela: it's more complicated than that.
<Reach>
there are criminals with guns, so yes police should have guns. but the normal citizen requires no such thing.
ewnd9 has quit [Remote host closed the connection]
<existensil>
I think guns should be taken from most NYC officers. Too many shootings of pedestrians during pursuit of unarmed perps.
JohnBat26 has joined #ruby
<rcs>
krz: Rails only, and does a string match anyway.
nwertman has quit [Ping timeout: 272 seconds]
<Kamuela>
Reach, but when good people AND police have guns, why is there more harm than good done?
<existensil>
with a reduced lack of a threat of guns, NYC officers could probably do without them
<h0rrorvacui>
Do you think if you live in a rural part of Alabama, your opinion on guns would be different?
<h0rrorvacui>
lived*
joshwines_ has quit [Ping timeout: 264 seconds]
ElectronFunBaby has quit [Quit: Leaving...]
<Kamuela>
existensil, laws don't change things! that's the big fallacy, laws only affect the law-abiding
ewnd9 has joined #ruby
<Kamuela>
that i think is the number one FUNDAMENTAL thing that people just don't get. they think that laws matter
<Kamuela>
there's already a law against robbery!
<sevenseacat>
the ramifications of a cop using a gun in the line of diuty, and the average citizen shooting someone, are very very different
<Kamuela>
but he's doing it!
<Reach>
laws kind of do matter...
<Kamuela>
he's robbing you!
<existensil>
h0rrorvacui: the reality is different (cops would obviously have to have guns and be super cautious) but the opinion would be the same... that we should strive to reduce the need for and practice of concealed carry so citizens can be safer and cops don't need guns
<Kamuela>
there's already a law against murder, but he's doing it!
denysonique has quit [Ping timeout: 252 seconds]
<Kamuela>
he's killing you!
<sevenseacat>
Kamuela: if laws didnt matter, you probably wouldnt be here.
<existensil>
Kamuela: the idea that laws change nothing is even more fallacious
<Kamuela>
existensil, indeed it is because i posit that laws do more harm than good
<sevenseacat>
lol
<h0rrorvacui>
I'm tempted to agree. I just think my guns are just that my guns. I want to own them like a collector or knives wants to own knives.
relix has joined #ruby
<existensil>
if the laws restricted the sale of weapons, guess what? criminals can't make them themselves, so if production is decreased so is their access
<Kamuela>
they transfer power from the law-abiding to the law-ignoring, all other things held constant
<h0rrorvacui>
of*
macmartine has quit [Remote host closed the connection]
<sevenseacat>
trollolololol
<Reach>
Kamuela: depends on the ones implementing the laws
<Kamuela>
as programmers, the simple logic behind that should be understood
<Reach>
what if we implement a law that all Jewish people have to give up their wealth to the state
<Reach>
of course that's causing harm
<existensil>
Kamuela: that's pretty rigid ideology and isn't backed up by really anything
raar has joined #ruby
vlad_starkov has joined #ruby
joshwines_ has joined #ruby
<Kamuela>
all of you need to read anything by Thomas Sowell
h_kon has joined #ruby
<sevenseacat>
Reach: i think they tried something like that in the 30s for starters
<existensil>
laws against pollution don't lead to polluters getting worse... it leads to decreased pollution, as designed
raar is now known as Guest94419
<Reach>
sevenseacat: exactly, and look what happened in some areas of the world
<Reach>
actually, im sure the US benefitted from that German law.
<Kamuela>
existensil, it means that the ones who do pollute gain an unfair advantage
ephemerian has joined #ruby
<Kamuela>
existensil, do you think pollution laws are "equal" or do you think big polluters put them on the books to cut smaller firms out of the market?
dhruvasagar has quit [Ping timeout: 244 seconds]
<Kamuela>
existensil, the idea that any law exists within a moral vacuum is ludicrous
<existensil>
Kamuela: no, because if the law is structured right, the increased risk to the polluter exceeds the value of their advantage, so they reduce pollution as required
<Kamuela>
yet the analysis often goes morality FIRST when looking at any law whatsoever, falllllacy
<existensil>
what? so EPA regulations are helping the worst polluters? are you hearing yourself?
camilasan has joined #ruby
<Kamuela>
existensil, they are
vlad_starkov has quit [Read error: Connection reset by peer]
<existensil>
example please
<h0rrorvacui>
existensil: What do you think of the suggestion that our high gun possession protects us from invasion?
<existensil>
h0rrorvacui: our military is bigger than the closest 20 combined
<existensil>
invasion from what?
visof has joined #ruby
<existensil>
aliens?
<visof>
hi
<Kamuela>
ohhh noes, da big oil and gas companies are so evil, we need the epa to stop them!
<Kamuela>
h0rrorvacui, he probably means by spending
<existensil>
Kamuela: thats a seperate problem, the bending of laws by those with money. that has to do with money in politics and is mostly unrelated. its an undeniable fact that many of the worst pollutants have been reduced or even eliminated since we started regulating
Guest2496 has joined #ruby
<Kamuela>
existensil, the bending of laws by those with money, clout, whatever, is literally the backbone of your law-creating society
<existensil>
I mean in spending and capability. true, we'd have a tough time in a ground war to china, but how do you propose they wage such a war? any other theatre and we would crush them pretty decisively
Spami has joined #ruby
<Kamuela>
existensil, ok, but at what cost? that's the other point. do we want zero pollution? what if we could achieve zero pollution? you need to ask at what cost
<h0rrorvacui>
existensil: What about competition marksmen who shoot in competitions and have extended background checks?
JeanMertz has joined #ruby
<existensil>
Kamuela: proper governing is all about weighing those costs and taking the approach that does the most good for the most people
<Kamuela>
h0rrorvacui, ah, don't peddle to that. it's not about sport or qualifications. it's about balance of power man
<Kamuela>
existensil, proper governing is done at the level of the individual
<existensil>
when contrasted against the alternative: no governing, proper governing clearly wins out as a way of organizing effort
zigomir has joined #ruby
<h0rrorvacui>
I'm just curious because I'm live in an area thats largely a hive mind for pro-gun.
<existensil>
right. i agree that is a bit of a strawman, but that did seem to be where you and h0rrorvacui were headed
<Kamuela>
h0rrorvacui is just chillin, i'm doing the crazy stuff :P
<existensil>
getting the laws right is far more important than the number of laws/regulations
<h0rrorvacui>
I think should be excluded...
<Kamuela>
who do you propose would get the laws right?
<h0rrorvacui>
I didn't say anything other than I owned weapons.
<existensil>
Kamuela: well, that's why we have democrazy. ideally.
<Kamuela>
existensil, because the majority is right about things?
warren has left #ruby ["Leaving"]
<existensil>
its not perfect, but its better than all the alternatives we've tried
<existensil>
do you propose something better?
heftig has quit [Quit: Quitting]
rjhunter has quit [Remote host closed the connection]
<Kamuela>
uh, a constitutional republic is kind of a million times better...
<h0rrorvacui>
I just propose extremely difficult screening for firearms
<Kamuela>
but i suppose it isn't perfect either, because it has devolved into what we have now
<existensil>
exactly
<h0rrorvacui>
To own a fire arm you should have to take a test much like a drivers license
<Kamuela>
wow
<Kamuela>
h0rrorvacui, who decides the tests?
<rcs>
I do.
<h0rrorvacui>
State law
<h0rrorvacui>
I mean each state.
<Kamuela>
does every state have to have a test?
<h0rrorvacui>
But a bare federal minimum
<Kamuela>
a bare federal minimum...
cricri_ has joined #ruby
<h0rrorvacui>
Yes, each state has to do so much in their testing. But like driver licenses they have their own testing in a sense.
JeanMertz has quit [Ping timeout: 272 seconds]
<Kamuela>
step 1. identify a problem step 2. devise a law
graydot has quit [Quit: graydot]
jkhwan has quit [Remote host closed the connection]
Zeeo has joined #ruby
tylersmith has joined #ruby
lnormous has quit [Ping timeout: 265 seconds]
pragmatism has joined #ruby
jkhwan has joined #ruby
pragmatism has quit [Client Quit]
<jrobeson>
Kamuela, as a programmer i think your'e speaking nonsense and being completely illogical
<jrobeson>
lol
<Kamuela>
i'll stop. i understand everyone's points
<Kamuela>
jrobeson, which part was illogical?
wallerdev has quit [Quit: wallerdev]
<jrobeson>
no sense in getting back into it after you just stopped .. it's not really topical
graydot has joined #ruby
<Kamuela>
jrobeson, i'd like a chance to clear things up for you
<h0rrorvacui>
I feel sorry for the non-Americans having to hear that tbh...
<h0rrorvacui>
lol
dhruvasagar has joined #ruby
<jrobeson>
Kamuela, you can't clear up nonsense you already said and are standing hard on
<jrobeson>
nothing of value would be gained
<h0rrorvacui>
oagnageal dkaljega ;leajkea
<Kamuela>
h0rrorvacui, the United States government occupied Hawaii and stole it from our sovereign queen at gunpoint
<Kamuela>
by joint resolution, Hawaii was annexed
<h0rrorvacui>
I ment to say: that wasn't true.
<Kamuela>
so I am not really an american after all
<jrobeson>
that is true tho..
xcess_denied has joined #ruby
akonny has joined #ruby
<Zeeo>
Good day gentlemen, I'm gonna need some help with this. I'm trying to join two words into a regular exp (using r =Regexp.union). Everything works fine, no problem with that but I wanna make this case insensitive, so I make it (r2 = Regexp.new(r, Regexp::IGNORECASE) and I get this warning:
<jrobeson>
i mean.. we basically forced japan to open up the same way..
<Zeeo>
warning: flags ignored
jkhwan_ has joined #ruby
<existensil>
Kamuela: well, by that logic none of us are, except direct native american descendents
<Zeeo>
what does it even mean and how do I get rid of this?
tharindu has quit [Quit: Leaving...]
<Kamuela>
existensil, slippery slope fallacy
<existensil>
the vast majority of the US was taken by force, or bought from someone who took it by force (Alaska and the Louisianna purchase)
<jrobeson>
well.. same as every other conflict ever..
sandeepk has joined #ruby
<jrobeson>
at least we gave some of it back
justsee has quit [Ping timeout: 272 seconds]
<Kamuela>
i don't get it
<existensil>
hahaha, for very small definitions of the word some
jkhwan has quit [Read error: Connection reset by peer]
<Kamuela>
so wait, let me be clear
<Kamuela>
the nonsense i have spoken, that everyone is completely clear that is nonsense
<Kamuela>
is that if i have a gun and i want to rob you
tylersmith has quit [Ping timeout: 264 seconds]
<jrobeson>
Zeeo, i've never used regex by calling it as a class.. i just use /someregex/i
<Kamuela>
i should do it because none of you will be armed except h0rrorvacui
<Kamuela>
?
baldivia has quit [Remote host closed the connection]
zipper has quit [Remote host closed the connection]
<jrobeson>
how about removing the need to rob people..
<Kamuela>
EXACTLY!
zipper has joined #ruby
<sevenseacat>
if you want to do that and end up in jail, sure
<Zeeo>
jrobeson: I need to use it this way, I'm dumping an array in it
<Kamuela>
jrobeson, that's a great point! and that's what i'm saying. when you create a law that says make guns harder to get, you aren't addressing the need to rob people. what you are addressing is the ability of law-abiding to have a deterrent to the problem of robbery
<h0rrorvacui>
In kamuela's defense isn't targeting guns and declaring them the problem in a way a strawman argument?
<jrobeson>
well.. i'd suggesting taclking both problems..
<jrobeson>
and not a single one in a pretend vacuum
<Zeeo>
jrobeson: and it's not always all the strings but sometimes one or another
<sevenseacat>
this is such a bizarre conversation
<Kamuela>
h0rrorvacui, so it's not just guns... don't take knives out of the kitchen! you heartless b***ards!
<sevenseacat>
yes, because you get people going on massive killing sprees armed with knives
<jrobeson>
just get renters/home owners insurance .. so if you get robbed.. wahtever
<Kamuela>
jrobeson, what is the problem that gets addressed with stronger gun laws?
<jrobeson>
just get new stuff
sesco has joined #ruby
bubbajones has quit [Ping timeout: 244 seconds]
<h0rrorvacui>
sevenseacat: actually they do happen
<Kamuela>
jrobeson, but if robbery rates went up, you'd pay more for rental insurance
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jrobeson>
there's no evidence that that would happen
<Kamuela>
...
jbpros has joined #ruby
<jrobeson>
unless you wanna seriously twist shit around
<Kamuela>
that's how insurance works
fysaen has joined #ruby
<Kamuela>
do you understand the insurance business model?
petey has quit [Remote host closed the connection]
<jrobeson>
no.. no evidence about mroe robberies.. not the insurance rates
<Kamuela>
ah
<sevenseacat>
h0rrorvacui: oh they probably do but it would be a lot harder to do
bubbajones has joined #ruby
<jrobeson>
nothing is gonna stop people who wanna kill people from killing people.. anything that focuses on that part is fooling you
<jrobeson>
trying to fool you*
jbpros has quit [Client Quit]
<Kamuela>
jrobeson, yes. in addition to that, i'm trying to argue the net positive of more firearms
<sevenseacat>
guns create a false illusion of safety 'no-one will shoot me if i have a gun' yes they can, and you'll die just the same
<jrobeson>
there is no net positive from firearms
<jrobeson>
not a single one
<jrobeson>
unless you hunt your own food
<jrobeson>
i meant to say
<jrobeson>
no net positive in a city* not a single one
sesco has quit [Write error: Broken pipe]
zipper has quit [Ping timeout: 260 seconds]
<jrobeson>
for rural folks.. i understand
<Kamuela>
jrobeson, guns are used in self defense more than they are used in crimes at about a 10:1 ratio every day
<Kamuela>
jrobeson, so a gun law addresses the 10, and leaves the 1 alone
<sevenseacat>
say what
<jrobeson>
and thousdands of kids die a year from unnecessary gun deaths
<Kamuela>
sevenseacat, in the United States
<sevenseacat>
that doesnt make sense
zipper has joined #ruby
<shevy>
jrobeson zombies need human flesh so they need guns
<jrobeson>
so.. i'd rather have those kids alive
<shevy>
in a city
<sevenseacat>
self defense against what that isnt a crime?
<jrobeson>
than somebody not to get robbed
timonv has joined #ruby
<jrobeson>
it's ridiculous
<shevy>
it's a wanted feature
<jrobeson>
it's all about an illusion of safety like sevenseacat said
<Kamuela>
jrobeson, it's not either-or. take a proposal, weight its benefit against its cost
<existensil>
+1 on "illusion of safety"
<jrobeson>
and the benefits don't match the costs
Spami has quit [Quit: This computer has gone to sleep]
<jrobeson>
the costs are too high
brtdv has joined #ruby
<Kamuela>
jrobeson, youd have to start with a proposal though. i'll be honest, i'm just assuming you're onboard with some stuff that you didn't actually say, that others said, earlier
<jrobeson>
ah i didn' read it all
<bigkevmcd>
Kabaka: do you have a link to your 10:1 statistic? I'm intrigued by those numbers...
<jrobeson>
i just know that i don't want guns in my city
<jrobeson>
btw.. i'm also american..
<Kamuela>
that doesn't matter lol
<shevy>
jrobeson where?
<jrobeson>
any city i live in? :)
<shevy>
I mean, geographically... western area... east... southern texas maniacs...
<jrobeson>
but really.. i'm more interested in getting rid of handguns than anything ..
<h0rrorvacui>
gunpolicy.org has all you need
<jrobeson>
i grew up in virginia
Xeago has joined #ruby
rjhunter has joined #ruby
<jrobeson>
but really.. i'm not interested in getting rid of all guns.. handguns would generate a great net win
<existensil>
I'd draw the line at weapons that are purpose built for killing humans and don't have much utility beyond that. Handguns and assault weapons are generally ineffective hunting weapons and they clearly weren't designed for that.
<existensil>
The irony is, for protecting your home your best bet is a shotgun, which i wholely support remaining legal
<jrobeson>
and note.. i'm saying that as a person who was actually robbed with a handgun.. althoguh they idn't get what they wanted..
<existensil>
they can't be concealed in public, and are very effective hunting tools, so i'm very pro shotgun
<Kamuela>
hmm, those statistics tend to prove one thing conclusively
<h0rrorvacui>
existensil: yes they can
<Kamuela>
if someone's gonna die, in the united states, we don't f- around, we shoot em
<Kamuela>
lol
<shevy>
hmm via << we can merge two arrays, but then I have to apply .flatten on them. is there a way to just easily append one array to another?
dweeb_ has joined #ruby
<h0rrorvacui>
I've seen illegal modifications to shotguns that made them more lethal and just about as easy to conceal as a pistol
<Kamuela>
but overall violence and such is kinda comparable
<jrobeson>
or uhmm.. poison them with depleted uranium ..
<Kamuela>
jrobeson, can't help we're such a civilized nation :)
<existensil>
h0rrorvacui: yes, and I *can* use a screwdriver to hammer a nail... clearly wasn't built for it though and its not particularly effective
<shevy>
ah ... #concat
<h0rrorvacui>
not to mention guns that are both a pistol but fire shotgun cartridges
noname001__ has joined #ruby
* jrobeson
fires a shotgun in the room
<h0rrorvacui>
shotguns are the most effective killing machine
<shevy>
>> array1 = %w( a b c ); array2 = %w( e f g ); array1.concat(array2)
<existensil>
h0rrorvacui: illegal, so if you are caught just even holding one you are likely headed to jail. that makes the risk of ownership high, which generally reduces said ownership
farmswort has joined #ruby
<h0rrorvacui>
there is permit-able ownership
<shevy>
h0rrorvacui cars are also rather solid weapons
tharindu has joined #ruby
kaspergrubbe has joined #ruby
<Kamuela>
existensil, i wish i could ask you a question in isolation of everything else but then i guess the reason for asking you would be to try to prove something anyway so it would be pointless
<existensil>
:-)
<h0rrorvacui>
I agree shevy
<h0rrorvacui>
The thing is, shotguns are more effective than pistols and rifles for killing.
<existensil>
h0rrorvacui: that was the exact point i made... which is why it baffles me further that everyone seems to want a handgun in their home
<Kamuela>
h0rrorvacui, yeah rifles are like a perimeter control thing
<shevy>
really? (I am really asking, I have absolutely no idea)
<Kamuela>
existensil, so your major concern is that people can sneak guns around, produce them at random, and cause problems/
sergicles has joined #ruby
<emocakes>
is say we should equip everyone
<emocakes>
kids going to school
<h0rrorvacui>
lol
<emocakes>
policemen, firemen
<existensil>
Kamuela: my major concern is that the utility of the items I listed is outweighed by their danger
<emocakes>
everyone
<h0rrorvacui>
Nurses
<emocakes>
when everyone has a gun
<emocakes>
no one will want to pull out a gun on anyone
<emocakes>
nurses, babysitters, old ladies
<emocakes>
postmen
<Kamuela>
it's not. i wish you could measure how many people are NOT killed as a result of guns
<Kamuela>
the hardest part of economics is really conveying the hidden stuff, the unintended consequences
<Kamuela>
it's always so easy to see the immediate effects but not the what-if effects of an alternate scenario
<Boohbah>
/topic
* Kamuela
sets topic "Ruby is still C"
<existensil>
Kamuela: if there were severe risks to removing handguns and assault weapons, wouldn't the statistics bear that out in the many developed nations that have removed them?
<existensil>
it seems the UK is doing just fine
pragmatism has joined #ruby
<jrobeson>
does anybody hae an opinion on pusher or any other "realtime" event type service?
<Kamuela>
existensil, well Godwin's law is coming in 3...2...1...
<jrobeson>
NAZIES
<existensil>
jrobeson: i've used pusher with good results
<jrobeson>
err NAZIS
<h0rrorvacui>
dito
<existensil>
honestly, I wanted to build the real time notification system myself, but pusher saved a ton of time
<h0rrorvacui>
pusher is nice
<Kamuela>
yep, the nazis collected the guns before they started the mass killings
<Boohbah>
existensil: that is because all of the freedom loving englishmen emigrated to the united states in the 18th century
<Kamuela>
it was for a safer germany btw
<jrobeson>
there's one built into rails.. buti t's broken .. although not to the fault of rails necessarily..
<existensil>
lol
<Kamuela>
not making that shit up, well known propaganda posters and such
<existensil>
Boohbah: wasn't that long before the UK took guns away?
<existensil>
:-P
<Kamuela>
existensil, didn't violent crime and murders go up when the UK took guns away? not by guns, but in general?
<jrobeson>
let's just take the guns away from insecure dudes.. that'll be a good start..
<existensil>
Kamuela: the Nazis also liked Opera. maybe we should fear its rising popularity in Seattle?
<Kamuela>
jrobeson, good in theory, but when you ask who to take guns away from, who comes up with the criteria?
<h0rrorvacui>
Kamuela: Thats likely because it was now illegal to own a gun.
<existensil>
Kamuela: absolutely not
<jrobeson>
that's something that is acdtually provable.. right now.. go get the stats
sergicles has quit [Ping timeout: 264 seconds]
<h0rrorvacui>
what do we need?
<jrobeson>
i wish pusher supported server sent events
andikr has joined #ruby
<Kamuela>
jrobeson, which part? i'll look em up. you mean the UK stuff?
<jrobeson>
yes
<jrobeson>
i've randomly heard multiple things about it.. but never cared enough to look up
heftig has joined #ruby
jkhwan_ has quit [Remote host closed the connection]
d45h has joined #ruby
<jrobeson>
guns aren't my favorite political topic as i don't really expect much to come from anything
aganov has joined #ruby
<Kamuela>
jrobeson, i'm trying to find raw statistics, while searching i find a lot of stuff supporting my assertion but they're news articles
jkhwan has joined #ruby
io_syl has joined #ruby
<jrobeson>
it's not like it'd ever be possible to get rid of all the guns that are already here
jbpros has joined #ruby
<existensil>
jrobeson: what do you mean? I can push events from my rails app pretty easily
<jrobeson>
let's just go with the chris rock solution and charge tons of money for bullets..
<h0rrorvacui>
I've found several sources saying there is no hard evidence or research conducted.
tvw has joined #ruby
<h0rrorvacui>
That is on UK post gun ban laws
jkhwan has quit [Read error: Connection reset by peer]
<jrobeson>
existensil, i meant the html5 "server sent events"
jkhwan has joined #ruby
<jrobeson>
server sent events are a lot easier to deal with support wise.. only a simple polyfill is required
dhruvasagar has quit [Ping timeout: 252 seconds]
<jrobeson>
and no firewall issues or anything else
<existensil>
the massive drop in crime in the US over the past 20 years, even when the economy was doing bad and unemployment was high, has thrown a lot of the established research on what causes violent crime out the window
dhruvasagar has joined #ruby
<jrobeson>
lots of talk about lead and things in there too
xorgnak___ has joined #ruby
<xorgnak___>
I'm using a simple bot to compile traffic from a few freenode channels
<jrobeson>
so. pusher users.. what does a connection really mean?
<existensil>
no one has come up with very compelling reasons to explain it. obviously there are many reasons involved but the significance of each is still pretty unknown
xorgnak___ has quit [Remote host closed the connection]
<Kamuela>
where the hell are the statistics? i'm googlin' and finding it difficult
<jrobeson>
so.. i have a usb dongle thing.. that currently submits to my ruby based app via http.. 1 or every "event" . i also have events happening on the app itself for starting the game, stopping it, etc..
<h0rrorvacui>
Yeah but it compiles information about the relations of crimes with guns
<existensil>
so its going to be tough to find a before/after event to examine statistics against
<h0rrorvacui>
and those without
<jrobeson>
s/or/on/
<existensil>
but, it does have one of the lowest gun death rates in the world
<jrobeson>
oh.. webhooks.. i think that's what i'm looking for.. they seem to have it
jhaals has joined #ruby
<jrobeson>
i have found some other interesting stuff in my research.. some that even let you upload js or lua scripts to do a little processing on the provider hosted side
<existensil>
like most big political issues, as much as we want it to be simple, the reality is very complicated
joshwines_ has quit [Ping timeout: 268 seconds]
<jrobeson>
but existensil THEY ARE TAKING OUR FREEDOMS
<jrobeson>
LOL
ezkl has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
einarj has joined #ruby
<jrobeson>
ok.. pusher users.. what is your response times tend to be? what is "real time"
mrsolo has joined #ruby
<existensil>
in general you will be hard pressed to find a country on the very low end of the homicide rate that has really relaxed gun regulation... but the factors for their homicide rate are way more complicated than gun laws so that alone only explains a small part
TigerWolf has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<h0rrorvacui>
existensil: I'm actually seem a disconnect with guns and crime. It just doesn't help that guns are more effective at killing.
<h0rrorvacui>
seeing*
joshwines_ has joined #ruby
<Kamuela>
i gotta go to sleep guys, good points from everybody
<Kamuela>
shevy, i learn more ruby tomorrow :)
aapzak has quit [Read error: Connection reset by peer]
iliketurtles has joined #ruby
<h0rrorvacui>
I think handguns are the big problem.
<h0rrorvacui>
Just do away with handguns.
<existensil>
h0rrorvacui: i think in general you're right. it does appear that guns has a very very weak correlation with violence.
<existensil>
but, really, all the factors do
<h0rrorvacui>
I think we have a broken culture.
<h0rrorvacui>
I blame hollywood.
<h0rrorvacui>
:P
<existensil>
clearly there is some influence from things like income, unemployment, population density, etc, but you will find giant exceptions to any of them
<h0rrorvacui>
Guns are not cool.
<existensil>
lol, yeah Hollywood has clearly gone out of their way to make guns *uncool* :-P
<h0rrorvacui>
We should do an anti-drug style campaign against guns.
RichardBaker has quit [Quit: RichardBaker]
Kamuela has quit [Quit: Leaving]
<jrobeson>
hmm.. i don't really think that'll help or be worth it
<jrobeson>
plenty of people enjoy movies or games that happen to have guns in them.
<jrobeson>
but they still don't ever get a real gun.. or kill real people
<h0rrorvacui>
The problem is guns allow you to separate yourself from the act of killing. It allows you to dehumanize the "target"
<existensil>
for the most part i think guns in the USA are used as a wedge issue to get people to vote a certain way. In the end they matter very little. you should be voting based on education, support for scientific research, investment in infrastructure, economic policies, etc... guns are more than anything a giant distraction
xorgnak___ has joined #ruby
<xorgnak___>
I'm using a simple bot to compile traffic from a few freenode channels. If you'd like to try it, download my gist at https://gist.github.com/xorgnak/7481117
<jrobeson>
existensil, i agree .. that's why i mostly ignore it..
<jrobeson>
xorgnak___, is that what the ACK stuff earlier was about?
<h0rrorvacui>
thats a good point
xorgnak has joined #ruby
<h0rrorvacui>
However, its not something that can be done with the seemingly endless spree killings going on in the US.
<xorgnak>
jrobeson: glad you asked.
jkhwan has quit [Remote host closed the connection]
<existensil>
if you vote based on issues like that you have very likely been duped into voting against your own self interest
<jrobeson>
so freakin true..
drumusician has joined #ruby
aapzak has joined #ruby
jkhwan has joined #ruby
<xorgnak>
jrobeson: wrote a little bot for ii, and I forgot to change my channels back from testing.
<xorgnak>
check it out if you like
<jrobeson>
h0rrorvacui, a lot of people have been blaming the media for those killings due to making it seem like a way to get a national airing of your grievances
michael_mbp is now known as zz_michael_mbp
<jrobeson>
and that the real fix for that.. is stop focusing so much on it.. it's still important news.. just stop sharing their manifestos.. and showing all the sad families over and over and over
<existensil>
i think its also worth noting, that even with the recent spat of shootings included, our violent crime rate is near the lowest its been in 30+ years
<jrobeson>
yep..
rippa has quit [Read error: Connection reset by peer]
<h0rrorvacui>
Also, apparently spree killings are not really up according to some.
<h0rrorvacui>
They are just favored by the media.
<h0rrorvacui>
For coverage.
<existensil>
the shooting sprees are just given an undue amount of attention in the media. the actual danger is incredibly small and for the most part these shootings have always happened, they are just getting more attention.
<sevenseacat>
that i would believe
visof has quit [Quit: leaving]
<existensil>
motherjones did a giant compilation of mass shooting events
sandeepk has quit [Quit: Leaving...]
<h0rrorvacui>
Has anyone watched cpgrey's youtube videos?
<existensil>
appears to show that they are not, in fact, increasing
<jrobeson>
it's just hard to know what to cover these days for those lazy bastards
<jrobeson>
when some huge natural disaster isn't happening
<existensil>
if it doesn't make it onto arstechnica or hacker news, i probably won't see it
<h0rrorvacui>
Has anyone noticed the mistakes in coverage seem more abundant in media?
heftig has quit [Quit: Quitting]
<existensil>
i know that means i'm living in a bubble/echo-chamber, but its easier that way :-P
<h0rrorvacui>
Than they used to be.
<jrobeson>
i'm not so sure if tha'ts true or not.. it might be the same thing as we were just saying about the mass shootings
<jrobeson>
you just never heard
<existensil>
h0rrorvacui: yes. for good reason too... scaled back budgets trying to fuel a 24hr news cycle
<h0rrorvacui>
I think it is true, I just believe its because they are tying into social media for their reporting.
<jrobeson>
but it is funny to watch jon stewart skewering them
jkhwan has quit [Ping timeout: 272 seconds]
aagdbl has joined #ruby
<existensil>
the replacement of investigative journalism with punditry
<existensil>
also factors in
mrfoto has joined #ruby
<existensil>
its cheaper and gets better ratings, so can't really blame the media exactly
tesuji has joined #ruby
<h0rrorvacui>
I think we could get more done if we had another big political party in the mix.
<existensil>
there is no question though that many major sources of investigative journalism (newspapers) have been scaled back massively in recent years
fluffheadsr has joined #ruby
<existensil>
that business model is undergoing severe disruption. it will probably get better when things stabilize a bit some day.
fluffheadsr is now known as Guest25635
<existensil>
h0rrorvacui: i think getting money out of politics would have a much bigger impact than getting another party in
<existensil>
though i would like to see both
dnyy has quit []
myappleguy has joined #ruby
<h0rrorvacui>
I was looking at district lines etc in my state. It seems they are gerrymandering a good bit here.
mikepack has joined #ruby
frankforest has joined #ruby
xorgnak___ has quit [Remote host closed the connection]
xorgnak___ has joined #ruby
<xorgnak___>
I'm using a simple bot to compile traffic from a few freenode channels. If you'd like to try it, download my gist at https://gist.github.com/xorgnak/7481117
<existensil>
it happens almost anywhere where one party has firm control over a state legislature. definitely happens a bit more often in republican controlled states, though.
<h0rrorvacui>
The "black belt" is broken up into a bunch of districts seemingly to dilute the their democratic vote. I wonder why we don't just do away with electoral college.
<poutine>
xorgnak, that violates freenode AUP
<existensil>
h0rrorvacui: inertia
xorgnak___ has quit [Remote host closed the connection]
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
marr has joined #ruby
nism-pi1 has joined #ruby
xorgnak___ has joined #ruby
dEPy has joined #ruby
<xorgnak___>
I'm using a simple bot to compile traffic from a few freenode channels. If you'd like to try it, download my gist at https://gist.github.com/xorgnak/7481117
xk_id has joined #ruby
<jrobeson>
poutine, it does?
* existensil
kicks xorgnak___
frankforest has quit [Quit: frankforest]
<poutine>
* - We would like to remind you that unauthorised public logging
<poutine>
* - of channels on the network is prohibited.
<poutine>
in /motd
daxroc has joined #ruby
<jrobeson>
what's unathorized? and why who? the channel owner?
<poutine>
you committed a stage A5 Freenode Felony
<jrobeson>
xorgnak, but this this particular channel.. read the topic "other public logging is prohibited"
<sevenseacat>
you're screwed now
<jrobeson>
lol poutine
<xorgnak>
damn. no lube or anything? shucks?
beardedninja has joined #ruby
<jrobeson>
i could use some poutin tho ..
Hanmac has quit [Ping timeout: 260 seconds]
nism-pi1 has quit [Client Quit]
<jrobeson>
poutine is delicious
Hanmac has joined #ruby
<jrobeson>
sevenseacat, ever had it?
<poutine>
you know you like poutine's hot cheesy wad sloshing around in your mouth
myappleguy has quit [Ping timeout: 264 seconds]
<xorgnak>
geez guys. I'm just trying to put the news up on an old monitor at the shop. You'd think I stole someone's grammy or something.
<jrobeson>
uhmm..
mikepack has quit [Ping timeout: 246 seconds]
<jrobeson>
xorgnak, i'm not mad at you.. just pointing out the topic
<poutine>
oops forgot the indefinite article there
<sevenseacat>
jrobeson: no
<sevenseacat>
its a canadian thing isnt it
<jrobeson>
sevenseacat, well if you like things that are cheesy and fried.. you'd probably like it
<sevenseacat>
i sure do
<sevenseacat>
cheese is one of my favorite food groups
<jrobeson>
i think it is canadian.. it certainly seems most popular in the montrealish area
xk_id has quit [Client Quit]
<xorgnak>
what can I say? the idea of an irc client that you can only watch has a certain appeal to me.
olivier_bK has joined #ruby
daxroc has quit [Client Quit]
<existensil>
that's basically how i use twitter
daxroc has joined #ruby
<h0rrorvacui>
same
mephux has quit [Ping timeout: 272 seconds]
<jrobeson>
it's becoming popular in the US too though
<existensil>
even had a read only client i was using for a while
<xorgnak>
me too. but irc's just so much better.
<poutine>
I am not trying to be off-topic here, but every time I see a grown man consuming dairy products, I have to wonder how he's able to live his life knowing he will forever be unable to please a woman sexually
<jrobeson>
sevenseacat, in canada, you'd probably put gracy on it ..
zipper has quit [Remote host closed the connection]
teoric has joined #ruby
<jrobeson>
uhmm?
<existensil>
lol poutine ... wat?
nvrch has joined #ruby
<xorgnak>
dirty.
<jrobeson>
how does that make any sense?
<h0rrorvacui>
what?
zipper has joined #ruby
<sevenseacat>
lol
<sevenseacat>
i dont get it, but its funny
<h0rrorvacui>
I guess I'll have to eat my cheerios without milk.
* sevenseacat
continues eating cheese
mephux has joined #ruby
Hanmac1 has joined #ruby
ahawkins has joined #ruby
<xorgnak>
sevenseacat: no pleasing women for you.
<sevenseacat>
im fine with that.
parduse has quit [Ping timeout: 264 seconds]
iliketurtles has quit [Quit: zzzzz…..]
dodosan has joined #ruby
huttan has joined #ruby
OdNairy has joined #ruby
h0rrorvacui has quit [Quit: ZQ]
mrsolo has quit [Quit: This computer has gone to sleep]
xcess_denied is now known as xcess_denied|awa
Hanmac has quit [Ping timeout: 272 seconds]
<jrobeson>
lol
parduse has joined #ruby
<tobiasvl>
20 minutes left till chess
workmad3 has joined #ruby
<jrobeson>
xorgnak, might wanna remember that not everybody here is a) into women b) is a guy
<sevenseacat>
;)
<xorgnak>
who's business is it of mine who spends time with whom?
<jrobeson>
you're right about that :)
<jrobeson>
it just came out funny to me
<jrobeson>
sevenseacat.. i meant gravy up there.. GRAVY on your poutine
<sevenseacat>
even more unhealthy and tasty.
<sevenseacat>
excellent.
<jrobeson>
australians have gravy right? :)
<jrobeson>
hah
joshwines_ has quit [Ping timeout: 246 seconds]
nisstyre has joined #ruby
timonv has quit [Remote host closed the connection]
huttan has quit [Ping timeout: 272 seconds]
Banistergalaxy has quit [Ping timeout: 272 seconds]
<rjhunter>
Australians do have gravy -- in Melbourne, you can even get poutine (from "Lord of the Fries")
blackmesa has joined #ruby
timonv has joined #ruby
<jrobeson>
rjhunter, how about in perth?
* sevenseacat
makes note about next trip to melbourne
<sevenseacat>
we dont have lord of the fries over here
<xorgnak>
it's funny that I was asked about the ACK stuff. this little bot in a previous life was the heart of a little project that used irc in the back for communication. ii needs something in it's fifo in order to receive traffic from the channel. so you can use the opprtunity to send a 'hello' message to the channel to let everyone know you're there. I used it to trigger a callback. worked pretty well. standard bot stuff, but handy.
<xorgnak>
food for thought.
<rjhunter>
i've not had Real Canadian Poutine but it's pretty hard to get a bad result out of chips + gravy + cheese
pyx has joined #ruby
pyx has quit [Client Quit]
<jrobeson>
i suppose not
maasha has joined #ruby
<xorgnak>
I haven't had a poutine since I was in Windsor a decade ago
<maasha>
morning all
<xorgnak>
greetings.
<existensil>
given the ingredients I am quite certain I would love poutine
<xorgnak>
replace the gravy with bacon and I'm all for it.
<jrobeson>
or just add bacon..
<existensil>
replace the cheese with bacon... and then put the cheese back in there
<existensil>
mmm
<maasha>
.oO(wtf?)
<xorgnak>
you could, but doesn't it just take up room that should be used for more bacon?
<jrobeson>
maasha, we were talking about poutine and how people who've never had it might like it
<rjhunter>
tonight on #ruby, gun control and canadian snacks
<jrobeson>
MMM snacks
drumusician has quit [Ping timeout: 264 seconds]
decoponio has joined #ruby
<xorgnak>
and the freenode penal code
<jrobeson>
the freenode cops are coming to get you
<xorgnak>
I hear they have black helicopters
Advocation has joined #ruby
<zipper>
Uh how can I undo a rails generate scaffold?
<existensil>
git clean
<rjhunter>
zipper: git reset
<existensil>
:-)
timonv has quit [Ping timeout: 264 seconds]
<xorgnak>
zipper: rm -fRvv /your/rails/directory; then go cry in a corner.
<maasha>
I think I will check in later to see if the situation has improved :o/
<rjhunter>
zipper: seriously though, lean on your version control system. that's what it's there for.
<shevy>
cvs
<xorgnak>
rjhunter: true story.
teoric has quit [Quit: WeeChat 0.4.1]
<xorgnak>
shevy: git
dodosan has quit [Remote host closed the connection]
<shevy>
what! insult!
<shevy>
:(
<rjhunter>
zipper: manually figuring out exactly what changed and *hopefully* getting all of it exactly right... not worth it
<mrfoto>
zipper: there is a destroy
<zipper>
rails destroy scaffold
<zipper>
I was told so
<mrfoto>
instead of g or generate use destroy with the same parameters
<mrfoto>
should work in most of the cases
<zipper>
It did
<mrfoto>
also for this questions go to #rubyonrails
<xorgnak>
zipper: good work
Advocation has quit [Ping timeout: 265 seconds]
jbw has quit [Ping timeout: 272 seconds]
TMM has joined #ruby
Guest25635 is now known as bassclef
<sevenseacat>
he cross-posted it there too :P
Es0teric has quit [Quit: Computer has gone to sleep.]
kaspergrubbe has quit [Ping timeout: 260 seconds]
<xorgnak>
sevenseacat: smart
<xorgnak>
sevenseacat: effective use of recources
Apane has quit [Ping timeout: 272 seconds]
<rjhunter>
were the responses any more useful?
pragmatism has quit [Quit: Leaving...]
pragmatism has joined #ruby
sevenseacat has quit [Quit: Leaving.]
Clooth has joined #ruby
shaunbaker has joined #ruby
drumusician has joined #ruby
dweeb_ has quit [Quit: Computer has gone to sleep.]
blackmesa has quit [Ping timeout: 240 seconds]
sandeepk has joined #ruby
Al_ has joined #ruby
shaunbaker has quit [Remote host closed the connection]
shaunbaker has joined #ruby
jbw has joined #ruby
pragmatism has quit [Quit: Leaving...]
<shevy>
only those who dare go to #rubyonrails may know the answer!
xorgnak___ has quit [Remote host closed the connection]
<shevy>
define_method(key.to_sym) {|i = ''|
<shevy>
I feel dirty dynamically generating methods that way :(
tkuchiki has quit [Remote host closed the connection]
xorgnak___ has joined #ruby
<xorgnak___>
I'm using a simple bot to compile traffic from a few freenode channels. If you'd like to try it, download my gist at https://gist.github.com/xorgnak/7481117
<existensil>
your bot should be less chatty
<xorgnak>
it's friendly
jbw has quit [Read error: Operation timed out]
jbw has joined #ruby
timonv has joined #ruby
kaspergrubbe has joined #ruby
<xorgnak>
oh dynamic method creation!
<shevy>
lol
shaunbaker has quit [Ping timeout: 272 seconds]
<shevy>
omg
<shevy>
in bash
<shevy>
I hate you xorgnak
<xorgnak>
metaprogramming how I love the
<xorgnak>
I did one in ruby too, but I rebuilt it better in ruby.
<xorgnak>
go figure
camilasan has quit [Remote host closed the connection]
<xorgnak>
fan-freakin-tastic at what it does
camilasan has joined #ruby
nisstyre has quit [Quit: Leaving]
blackmesa has joined #ruby
<shevy>
he must be on LSD or something
<xorgnak>
nicotine and caffine
<xorgnak>
but I do have a 256 color terminal, so I am seeing pretty colors. sortof.
rdark has joined #ruby
<existensil>
gnome-terminal ftw!
<xorgnak>
xterm-256colors
<existensil>
found out GTK3 is styled via CSS, so now me and gnome-terminal get along much much better
<xorgnak>
that's good to know
<existensil>
it always looked like crap with a thick border whenever i used tabs... but now it looks just how i want :-)
<xorgnak>
I'm still fascinated by .Xresources
Lewix has quit [Remote host closed the connection]
<existensil>
not sure what that is
<xorgnak>
it's how colors are set in command line land
camilasan has quit [Ping timeout: 272 seconds]
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
nari has quit [Ping timeout: 245 seconds]
tkuchiki has joined #ruby
hogeo has quit [Remote host closed the connection]
jlebrech has joined #ruby
<xorgnak>
dwm is about as heavyweight as I get on my own machines, and clients get standard ubuntu desktops from us so I do most everything by config file.
<shevy>
existensil, can you style in a custom way with CSS now?
<shevy>
I mean in gnome
karupanerura is now known as zz_karupanerura
<xorgnak>
anything gtk3 I guess
<xorgnak>
which is pretty cool
dweeb_ has joined #ruby
lkba has quit [Ping timeout: 272 seconds]
amritanshu_RnD has quit [Quit: Leaving]
JimmyNeutron has quit [Ping timeout: 277 seconds]
<existensil>
shevy: yeah, i can gist my .config/gtk-3.0/gtk.css ... looks like this right now: http://imgur.com/OaFqH25
jibi has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
tesuji has quit [Read error: Connection reset by peer]
jibi has joined #ruby
zarubin has joined #ruby
mikepack has quit [Ping timeout: 272 seconds]
aagdbl has quit [Quit: This computer has gone to sleep]
heftig has joined #ruby
hiall has quit [Quit: hiall]
aagdbl has joined #ruby
Guest80281 has joined #ruby
sergicles has joined #ruby
dhruvasagar has quit [Ping timeout: 272 seconds]
dhruvasagar has joined #ruby
ghr has joined #ruby
mikecmpbll has joined #ruby
petey has joined #ruby
<maasha>
I have been speculating on how to emulate piped streams inside a Ruby script: cat file | cut | grep | sort > new_flie
shredding has joined #ruby
<maasha>
But in a way that only one record of data is loaded into memory at any one time.
<xorgnak>
any ideas?
<maasha>
I was thinking chainable methods cat.cut.grep.sort.puts, but also a class of methods that could be called one at a time.
Advocation has joined #ruby
Zeeo has quit [Ping timeout: 260 seconds]
Guest23283 has quit [Remote host closed the connection]
<shevy>
orc.hates.peas
<shevy>
maasha you can always parse it on your own and keep snapshots between data passed between these different programs
<Hanmac1>
maasha: something like? i didnt add the cut part, because i dont know that you want with it File.open(new_file,"w") {|f| File.forach(file).lazy.select{"greppart"}.to_a.sort.each {|l| f << l}}
<shevy>
and > is just "save file"
petey has quit [Ping timeout: 260 seconds]
jbw has quit [Ping timeout: 252 seconds]
<xorgnak>
how about a module which implements the self.methods and standardizes the outputs to match the inputs?
Hanmac1 is now known as Hanmac
dhruvasagar has quit [Ping timeout: 252 seconds]
<xorgnak>
then instantiate a class to act on a file
Advocation has quit [Ping timeout: 260 seconds]
timonv has quit [Remote host closed the connection]
<xorgnak>
so you'd have something like @obj = Class.new filename
<Hanmac>
maasha: i would add this stuff as methods directly or method_missing
<shevy>
maasha also add the input string :)
sergicles has quit [Quit: sergicles]
<shevy>
method_missing can lead to complicated code
<Hanmac>
imo this Pipe class would be very fun
<maasha>
So first I would like to compile a pipeline, and then at run its should start iterating, but I am unsure how to get it to process the pipeline without loading all of the input into memory at once.
allsystemsarego has joined #ruby
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
<maasha>
bleh and s/b/p/
<shevy>
yes
<xorgnak>
.gsub
<shevy>
why not process commandlet by commandlet one after the other?
<maasha>
Hanmac: very good! I need some ideas on how to get it going! :o)
<shevy>
and you could always store transition states somewhere
<maasha>
Hanmac: I fear one will have to construct some clever enumerator - and maybe even have to mess with fibers and other low level stuff.
zipper has quit [Read error: Operation timed out]
<maasha>
shevy: because I would like to setup the pipeline first. Then it can be tested for syntax and typos and missing arguments. And when that is ok, execute the pipeline.
<maasha>
shevy: it would work phantastic in irb!
<Hanmac>
maasha: i would like to chain it like that: Pipe.new.cat(input: "table.txt").cut(field: 2).grep(pattern: "foo").sort.puts("result.txt").run
zipper has joined #ruby
dodosan has joined #ruby
sergicles has joined #ruby
<maasha>
Hanmac: I also considered this. I think both should be tested.
kitak_ has quit [Ping timeout: 246 seconds]
camilasan has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
jbw has joined #ruby
<maasha>
Hanmac: and I still favor Pipe.new.command(:cat, input: "table.txt").command(:cut, field: 2). etc ...:o)
dodosan has quit [Ping timeout: 246 seconds]
zipper has quit [Ping timeout: 260 seconds]
sergicles has quit [Ping timeout: 260 seconds]
nomenkun has joined #ruby
ua has joined #ruby
Rollabunna has quit [Remote host closed the connection]
<keanehsiao>
Hanmac: I actually render like <%=text%>
<Hanmac>
hm yeah and how do you set "text"?
mikepack has quit [Ping timeout: 268 seconds]
joshwines has quit [Ping timeout: 259 seconds]
<keanehsiao>
just grab from db. nothing special… actually, these text works if I do it via ajax. there another 95% same page I called via ajax.. and that works..
joshwines has joined #ruby
<keanehsiao>
it's really weird..
hogeo has joined #ruby
zipper has quit [Ping timeout: 272 seconds]
<Hanmac>
keanehsiao: maybe the db did something wrong ... did you use rails?
zipper has joined #ruby
<keanehsiao>
Hanmac: no I use rack with erubis. I think it has nothing wrong with db.. since another page go through same code and works fine, the only difference is it called via ajax..
Thanatermesis has joined #ruby
ckinni has joined #ruby
hiall has joined #ruby
hello_world has joined #ruby
hogeo has quit [Remote host closed the connection]
OdNairy has quit [Ping timeout: 264 seconds]
ckinni has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
Tuxist has joined #ruby
parduse has quit []
shredding has quit [Quit: shredding]
kaspergrubbe has joined #ruby
mengu has quit [Remote host closed the connection]
OdNairy has joined #ruby
zipper has quit [Ping timeout: 252 seconds]
parduse has joined #ruby
pranny has quit [Quit: Leaving.]
coderhs has joined #ruby
DouweM has joined #ruby
shredding has joined #ruby
seich- has quit [Ping timeout: 240 seconds]
m8 has joined #ruby
lkba has joined #ruby
intuxicated has joined #ruby
sandeepk has quit [Quit: Leaving...]
jb41 has joined #ruby
zarubin has quit [Ping timeout: 265 seconds]
sandeepk has joined #ruby
jonfer has joined #ruby
jonfer has left #ruby [#ruby]
mengu has joined #ruby
atmosx has joined #ruby
tesuji has joined #ruby
OdNairy_ has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
OdNairy has quit [Ping timeout: 253 seconds]
Deele has joined #ruby
hogeo has joined #ruby
hogeo has quit [Remote host closed the connection]
phansch has joined #ruby
platypine has joined #ruby
platypine has joined #ruby
platypine has quit [Changing host]
vlad_starkov has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
hogeo has joined #ruby
tesuji has quit [Read error: Connection reset by peer]
samuel02 has joined #ruby
tesuji has joined #ruby
<Danielss89>
Hey, i'm having trouble with gem on osx mavericks.. i'm trying to install localtunnel, but i get this error: http://pastebin.com/zCmASfvL
platypine has quit [Ping timeout: 264 seconds]
hiall has quit [Read error: Operation timed out]
<Hanmac>
Danielss89: i think your ssl is broken, how did you install ruby?
hiall has joined #ruby
<Danielss89>
with brew
<Danielss89>
Hanmac: i tried 'brew reinstall openssl' too
<havenwood>
Danielss89: looks like from your path you're using rvm ruby
<Hanmac>
i installed my stuff with ports and then used rvm to install ruby ... i dont have problems like that
Xeago has joined #ruby
<Danielss89>
hmm, i dont know what rvm is -.-
hogeo has quit [Remote host closed the connection]
<havenwood>
Danielss89: rvm pkg install openssl
timonv has quit [Remote host closed the connection]
sevenseacat has joined #ruby
kaspergrubbe has joined #ruby
<Hanmac>
"osx mavericks" is one of the shittiest updates i have ever seen ... from system-update its much more worse than vista
<havenwood>
Danielss89: So i guess first pick if you want to keep using RVM. If you do ^ and reinstall Ruby. If you don't, uninstall RVM: rvm implode
<s3itz>
xcode-select --install was pretty sweet, xcode is becoming huge
kaspergrubbe has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
<workmad3>
havenwood: I'm anticipating a not massive amount of time with the use of homebrew and brew-cask :)
<Hanmac>
what i hate on osx: each time you open a program it might popup a "there is a new version" message, but osx is not insteligent enough to make a central service for that
aagdbl0 has joined #ruby
<s3itz>
afterwards, brew was quick and painless
<s3itz>
Hanmac: that's for apps that aren't on the store
<s3itz>
and that's because the developers chose to use that system
zoee has joined #ruby
<shevy>
how big is xcode?
timonv has joined #ruby
<shevy>
on linux gcc + assorted tools are quite large too
<s3itz>
~1GB
<shevy>
wow
aagdbl has quit [Ping timeout: 272 seconds]
<s3itz>
where as just install the tools for terminal use is about 1/5th
mojjojo has joined #ruby
ravster has joined #ruby
Guest57248 has quit [Ping timeout: 240 seconds]
krz has quit [Ping timeout: 272 seconds]
<s3itz>
correction, 5.0.2 is 2.0GB~
dhruvasa1ar has joined #ruby
<s3itz>
cmdline tools is barely 100MB
<s3itz>
lol
<shevy>
cool
<shevy>
slackware .iso file is about 2.5 gigs
<shevy>
expands to around 7.5 gig on hdinstall
jrhe has joined #ruby
<Hanmac>
shevy: it rows if you add Water ;P
hogeo has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
anderson has joined #ruby
includex has joined #ruby
xk_id has joined #ruby
vlad_starkov has joined #ruby
apeiros has joined #ruby
mikepack has joined #ruby
Dave has joined #ruby
dgellow has joined #ruby
Dave is now known as Guest85781
nateberkopec has joined #ruby
hamakn_ has quit [Remote host closed the connection]
hamakn has joined #ruby
JJMalina has joined #ruby
obs has joined #ruby
nateberkopec has quit [Read error: Connection reset by peer]
seich- has joined #ruby
dangerousdave has quit [Ping timeout: 252 seconds]
pothibo has quit [Read error: Connection reset by peer]
coderhs has quit [Ping timeout: 272 seconds]
evenix has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
<shevy>
:(
obs has quit [Remote host closed the connection]
sergicles has quit [Quit: sergicles]
vlad_starkov has joined #ruby
evenix has joined #ruby
<matti>
I wonder.
<matti>
Should I stop supporting 1.8.x?
OdNairy_ is now known as OdNairy
ananthakumaran has quit [Quit: Leaving.]
jerius has joined #ruby
pushpak has joined #ruby
mojjojo has quit [Quit: mojjojo]
enebo has quit [Quit: enebo]
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegoviola has joined #ruby
zoee has quit [Quit: This computer has gone to sleep]
justsee has quit [Ping timeout: 260 seconds]
lfox has quit [Quit: ZZZzzz…]
Cygnus has joined #ruby
aagdbl0 has joined #ruby
Cygnus is now known as Guest49533
evenix has quit [Ping timeout: 260 seconds]
aagdbl0 has quit [Client Quit]
heftig has joined #ruby
mmitchell has joined #ruby
Guest49533 has left #ruby [#ruby]
keanehsiao has quit [Quit: keanehsiao]
Cygnus_ has joined #ruby
drumusician has joined #ruby
kraljev has joined #ruby
Cygnus_ has left #ruby [#ruby]
IceDragon has joined #ruby
sayan has quit [Ping timeout: 272 seconds]
<kraljev>
What is the recommended solution to write desktop application using javascript?
<kraljev>
And so javascript can call ruby backend
<kraljev>
so basicall, webkitQt like behaviour
Mars has joined #ruby
zoee has joined #ruby
Mars is now known as Guest86255
linduxed has joined #ruby
_maes_ has quit [Ping timeout: 246 seconds]
Ox6abe has quit [Remote host closed the connection]
mojjojo has joined #ruby
asobrasil has joined #ruby
simoz has joined #ruby
hashpuppy has joined #ruby
Guest86255 has quit [Ping timeout: 268 seconds]
mlpinit has joined #ruby
mjs2600 has joined #ruby
jonathanwallace has joined #ruby
banisterfiend has joined #ruby
EvanR has joined #ruby
EvanR is now known as Guest92131
h_kon has quit [Remote host closed the connection]
<gebbione>
hi i just the same question earlier but i keep getting this error http://pastebin.com/d7uGH2x7 … anyone can suggest what i might be doing wrong?
vlad_starkov has quit [Remote host closed the connection]
<gebbione>
should i use .to_i ?
sambao21 has joined #ruby
Astralum has quit [Read error: Connection reset by peer]
soba has quit [Ping timeout: 252 seconds]
Astralum has joined #ruby
MrZYX|off is now known as MrZYX
ddpunk has joined #ruby
shredding has joined #ruby
jonathanwallace has quit [Ping timeout: 272 seconds]
zoee has quit [Quit: This computer has gone to sleep]
bricker has quit [Ping timeout: 260 seconds]
bricker`away has joined #ruby
habanany has joined #ruby
thejoecarroll has joined #ruby
elux has joined #ruby
drag00n has joined #ruby
snuffeluffegus has joined #ruby
raphaelivan has joined #ruby
havenwood has quit []
<shevy>
gebbione why won't you just expand and use proper variables
yfeldblum has quit [Remote host closed the connection]
<MrZYX>
then it does return nil
Randomage has joined #ruby
IceDragon has quit [Disconnected by services]
jwest has quit [Quit: WeeChat 0.4.1]
pedda has joined #ruby
IcyDragon is now known as IceDragon
<shawnjgoff>
Yeah, send returned nil.
jwest has joined #ruby
shredding has quit [Quit: shredding]
<shawnjgoff>
So, the method is returning what it's returning, but `a = something` isn't a method call, so the return value is not the result from the method.
<MrZYX>
so as I said, syntactically it's an assignment and thus its value is the assigned one
verywiseman has quit [Remote host closed the connection]
habanany has quit [Quit: Leaving.]
d45h has joined #ruby
ValicekB has quit [Ping timeout: 272 seconds]
rudisimo1 has joined #ruby
yfeldblum has joined #ruby
mercwithamouth has joined #ruby
Advocation has quit [Ping timeout: 252 seconds]
rudisimo has quit [Read error: Connection reset by peer]
<MrZYX>
ocx: most people prefer loop do over while true, your indentation is off and the parens around the if are entirely superfluous. But getting to the logic: iirc #read doesn't ensure to read a whole line or a full word or anything, it just returns whatever is currently available, so command might be "star" in the first iteration and "t_s" in the second or even more splitted etc.
<MrZYX>
try puts command_received
baroquebobcat has quit [Quit: baroquebobcat]
hamakn has joined #ruby
<ocx>
momomomomo: the if statement in that code is not being matched, i tried also to check with include?("") but doesnt match too
d45h has quit [Client Quit]
boboc has joined #ruby
sooli has joined #ruby
<sooli>
Hi there, I'm working on a new Ruby CMS http://solicms.com ... a free DB CMS powered by GWAN server
sambao21 has quit [Quit: Computer has gone to sleep.]
<NickiMinaj>
When are reference errors (reference to a variable not defined in scope, not reference to an undefined property on an object that exists) discovered in a Ruby program?
<NickiMinaj>
i.e., at run time or compilation
hamakn has quit [Remote host closed the connection]
linduxed has joined #ruby
boboc has quit []
<ocx>
MrZYX: print works but puts doesnt output anything
hamakn has joined #ruby
canton7 has joined #ruby
<workmad3>
NickiMinaj: there's a compile time in ruby??? :P
<MrZYX>
NickiMinaj: easy to find out. define a method using an undefined local, never call the method, see if you get an error, call the method, see if you get an error
timonv has quit [Remote host closed the connection]
jbpros has joined #ruby
<NickiMinaj>
MrZYX: I don't have Ruby locally, sorry
<MrZYX>
ocx: puts always outputs something, it may only be a newline though
timonv has joined #ruby
danshultz has quit [Remote host closed the connection]
<eval-in>
workmad3 => undefined local variable or method `undefined_local' for main:Object (NameError) ... (https://eval.in/68584)
<workmad3>
NickiMinaj: oh look, we have a ruby interpreter in-channel ;)
<NickiMinaj>
Sweet! :)
<ocx>
yes i get a blank screen MrZYX but with pritn i dont get the blank screen i just get the text when serial is written to
<momomomomo>
workmad3: in Rubinius...
danshultz has joined #ruby
<ocx>
MrZYX: ^
mlpinit_ is now known as mlpinit
<MrZYX>
ocx: now read my explanation again
nwertman has joined #ruby
<NickiMinaj>
Okay, so you guys must have a lint tool you use to check for reference errors?
apeiros has joined #ruby
erry_ has joined #ruby
<ocx>
MrZYX: how can i resolve that? i got your point
danshult_ has joined #ruby
ValicekB has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
<workmad3>
NickiMinaj: yeah, it's called the test suite.. :P
atno has quit [Remote host closed the connection]
Liquid-- has joined #ruby
hamakn has quit [Ping timeout: 260 seconds]
<MrZYX>
ocx: checkout the docs for IO (or the serialport gem), there's stuff like #readline and #read takes an argument of how many bytes it should read etc.
erry_ has left #ruby [#ruby]
<workmad3>
NickiMinaj: also, static analysis linting is not a good way to check for that sort of error in ruby
tylersmith has quit [Remote host closed the connection]
diegoviola has quit [Ping timeout: 246 seconds]
<workmad3>
NickiMinaj: there are plenty of ways that the 'undefined reference' could be made valid
<NickiMinaj>
workmad3: Obviously you could define a property later on, but how would a reference to a variable that's not declared be changed at runtime?
<workmad3>
NickiMinaj: a 'reference' (or local variable) is indistinguishable from a method call
<workmad3>
NickiMinaj: and methods can be created dynamically
macmartine has joined #ruby
heidi has joined #ruby
TigerWolf has joined #ruby
<NickiMinaj>
That makes sense. I didn't know local variables were treated as method/property refs in Ruby. Thanks.
<workmad3>
local variables aren't treated as methods... but they're indistinguishable from them to the interpreter
<workmad3>
so if the local variable doesn't exist, the interpreter goes looking for a method
ghr has quit [Quit: Computer has gone to sleep.]
aa47f8 has quit [Remote host closed the connection]
rudisimo1 has quit [Quit: Leaving.]
aa47f8_ has joined #ruby
rudisimo has joined #ruby
tharindu has joined #ruby
sayan has joined #ruby
mark_locklear has quit [Quit: Leaving]
mjs2600 has quit [Remote host closed the connection]
camilasan has quit [Remote host closed the connection]
AlSquirrel has quit [Read error: Connection reset by peer]
camilasan has joined #ruby
dubsteph has quit [Ping timeout: 264 seconds]
kaspergrubbe has quit [Remote host closed the connection]
xeno_ has joined #ruby
macmartine has quit [Remote host closed the connection]
nvrch has quit [Quit: nvrch]
<xeno_>
I was trying to figure out if there was any way to hack an instance constant in ruby. It doesn't look like it.
mjs2600 has joined #ruby
jrhe has quit [Quit: jrhe]
<xeno_>
I was hoping there might be some kind of construct like the Javascript closures that inherit from the outer function, but that doesn't exist.
<xeno_>
Any suggestions?
acrussell has left #ruby [#ruby]
evenix has joined #ruby
Mars has joined #ruby
^Chris^ has joined #ruby
RichardBaker has joined #ruby
Mars is now known as Guest67082
kaspergrubbe has joined #ruby
mrsolo has joined #ruby
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xeno_>
I guess the one thing you could do is break convention and have a new singleton class for each object.
sambao21 has joined #ruby
carlyle has quit [Remote host closed the connection]
nari has joined #ruby
<xeno_>
But the main problem is that Ruby just doesn't take object oriented immutables seriously.
camilasan has quit [Ping timeout: 272 seconds]
<NickiMinaj>
workmad3: Thanks so much for explaining.
mikepack has joined #ruby
ephemerian has quit [Quit: Leaving.]
<Hanmac>
xeno_ show that you try todo
kaspergrubbe has quit [Remote host closed the connection]
<apeiros>
"object oriented immutables" - and what'd that be?
saarinen has joined #ruby
<apeiros>
ruby has immutables, ruby allows you to create your own immutables too.
<apeiros>
see Object#freeze
Guest67082 has quit [Ping timeout: 253 seconds]
ahawkins has quit [Quit: leaving]
<xeno_>
class x def initialize(a) { A=a} end where A is an instance constant, rather than a class or global constant.
gebbione has quit [Quit: This computer has gone to sleep]
<apeiros>
xeno_: I think you're confusing objects and variables
<apeiros>
an "immutable" variable is not the same as an immutable object.
<apeiros>
and correct, ruby doesn't allow you to single an ivar out to be unreassignable. all you can do is freeze the entire object (and that's quite object oriented :-p)
<xeno_>
aeiros. No, a language should allow you to set a constant at any scope. I cannot set it except at global or class scope, unless this freeze works. I will look at that. Thanks.
<apeiros>
wow, new mutilation…
<ocx>
MrZYX: i tried readline(5) or readlines doesnt work the strange thing is that: http://pastebin.com/4wSRmTGi works fine for line3 and prints the correct serial data with a newline but does not mattch the if statement
lnormous has joined #ruby
<apeiros>
xeno_: use tab completion for nicks. less embarrassing
<apeiros>
xeno_: "a language should" - no. no language owes you anything.
AlSquire has joined #ruby
mikepack has quit [Ping timeout: 258 seconds]
<apeiros>
xeno_: and if you think you have a better understanding how language design works as a whole - go ahead and create a language.
mmcdaris has joined #ruby
thelorax123 has quit [Remote host closed the connection]
<ocx>
this is my main issue: if (command_received.include?("stream"))
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zxq9 has joined #ruby
<MrZYX>
ocx: again, use puts, you can't tell if it was one or thirty calls to read to generate the "right" output with print. with readline(5) you limited the line to 5 bytes, that's "strea" for example
terrellt has quit [Ping timeout: 277 seconds]
pragmatism has joined #ruby
<xeno_>
Okay, it looks like freeze will work. Thanks guys. I'll come back and whine more if I find problems.
thelorax123 has joined #ruby
jkhwan has joined #ruby
cpruitt has quit [Quit: cpruitt]
rubydreamr has joined #ruby
ner0x has joined #ruby
<rubydreamr>
yoyoyo
jprovazn has quit [Quit: Odcházím]
<rubydreamr>
Got a fun one for ya'll - using ruby, how can you detect a sequence of +1s... 1,2,3,4 or 2,3,4,5 or 3,4,5,6
<Hanmac>
xeno_ like that?
<Hanmac>
>> class X;def initialize(a); self.singleton_class.const_set(:A,a);end;end; X.new(4).singleton_class::A
<xeno_>
Well, I need to freeze a specific variable, to be like a val in Scala.
Lewix has joined #ruby
Lewix has joined #ruby
bluenemo has quit [Remote host closed the connection]
<bklane>
I am running stupid right now and cant figure out why these instance variables i set in a method aren't available in the controller. How do I make them accessible? https://gist.github.com/blklane/497cf19e074a86fac411
Spami has quit [Quit: This computer has gone to sleep]
mojjojo has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
dagobah has quit [Remote host closed the connection]
<MrZYX>
ocx: no
<MrZYX>
ocx: do your commands have a fixed width?
<xeno_>
Closures, for instance, in Ruby, merely depend on anonymous functions, and don't realy preserve an inherited scope, so you cannot use that.
<ocx>
MrZYX: yes
<ocx>
i can design them that way
<apeiros>
xeno_: eh, wrong?
<xeno_>
This is an odd but important place where Javascript is literally superior to Ruby.
thekkid has joined #ruby
<ocx>
like a12345 for first command b12345 for second etc
mmcdaris has quit [Quit: mmcdaris]
Xeago has quit [Remote host closed the connection]
<MrZYX>
ocx: any parameters?
<thekkid>
What's the easiest way to get milliseconds since epoch from a datetime object
<Hanmac>
xeno_: to prevent an instance variable from been changed you need to freeze the object which owns the instance variable
<MrZYX>
ocx: how do you separate the commands?
nobitanobi has joined #ruby
alup has quit [Quit: Leaving]
<xeno_>
But I need some things to be variable in the object.
<apeiros>
xeno_: anyway, if you want to write fortran, don't use C - or however that saying went.
<apeiros>
alternatively: when in rome, do as the romans do
<Hanmac>
thekkid: Time.at ?
<apeiros>
xeno_: then change your design.
<ocx>
they are sent one at a time and there is a newline at the end of each command
<Hanmac>
ups from direction
<ocx>
MrZYX: ^
cburyta_ has quit [Remote host closed the connection]
<apeiros>
xeno_: you don't write ruby as if it was javascript.
<xeno_>
Immutables are a basic part of functional programming.
<apeiros>
xeno_: durr
<xeno_>
Javascript doesn't have immutables either.
<apeiros>
xeno_: again, ruby has immutables.
<thekkid>
Hanmac: Does that give you number of milliseconds
<MrZYX>
ocx: did you try readline without a parameter? what about gets?
<xeno_>
But at least it has real closures to compensate.
<ocx>
MrZYX: yes i tried readline no good
jrhe has joined #ruby
timonv has quit [Remote host closed the connection]
<MrZYX>
try gets
natevick has joined #ruby
nfk has quit [Read error: Operation timed out]
<apeiros>
obj.freeze # obj is now immutable - easy as pie
<pedda>
i'm working on my chef based cookbook for vagrant (VM provisioning software written in ruby) and i want to pass some parameters to a cookbook without being interpreted as strings
<ocx>
test.rb:9:in `<main>': undefined method `include?' for nil:NilClass (NoMethodError) MrZYX
<thekkid>
Hanmac: Thanks
<nobitanobi>
morning guys
<pedda>
how can i avoid this: :max_execution_time => 360 to become this: max_execution_time="360"
<ocx>
^ MrZYX
hamakn has quit [Ping timeout: 268 seconds]
<pedda>
is this even a valid question for this chan ? :)
<xeno_>
I would like to do something like "this.freeze" at the end of the initialize method, but I cannot remember what Ruby uses for "this"
<apeiros>
wald0: did you consider reading the API docs on Time.utc?
<Mon_Ouie>
Just "freeze", which would be equivalent to self.freeze
<Mon_Ouie>
(unless you have a local variable called freeze)
<xeno_>
Okay, thank you.
<MrZYX>
ocx: either begin; command = sp.readline; other code; rescue EOFError; end; or command = sp.gets; if command.nil?; next; elsif .....
<xeno_>
Thanks again guys. That usage of freeze will get me there, at least in this case.
<wald0>
apeiros: i get that command from a book of ruby which im reading/learning :/
sambao21 has joined #ruby
<apeiros>
wald0: ok, then time to get acquainted with the docs. you can use e.g. `ri Time::utc` in your bash or other shell
<apeiros>
wald0: alternatively you can use sites like rdoc.info or ruby-doc.org
<apeiros>
make sure you use the docs of the ruby version you're actually using (ri should always be the right version)
daxroc has quit [Ping timeout: 260 seconds]
<nobitanobi>
In a Ruby application, if I want to use gems I need to require them (despite using Gemfile). Why in Ruby on Rails for example I don't need to require them? How is that done?
<MrZYX>
so, .to_s converts an object into a string
<MrZYX>
nil is an object too
<MrZYX>
what does return nil on a EOF?
mansi has quit [Remote host closed the connection]
<ocx>
nil ?
AlSquire has quit [Ping timeout: 264 seconds]
kaspergrubbe has quit [Remote host closed the connection]
happydude has quit [Quit: Leaving]
alekst has quit [Quit: Computer has gone to sleep.]
nobitanobi has quit [Read error: Connection reset by peer]
<MrZYX>
yes, nil, rubys NULL object
stkowski has joined #ruby
burlyscudd has joined #ruby
Davey has joined #ruby
duggiefresh has quit [Remote host closed the connection]
terrellt has joined #ruby
d45h has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
<ocx>
MrZYX: ok so i am getting a nill exception
<MrZYX>
there's not really such a thing as a "nil exception"
Guest86774 has quit [Ping timeout: 252 seconds]
<MrZYX>
we pass nil to a method that expects a string
<ocx>
how can i handle that MrZYX
<MrZYX>
so we need to convert nil to a string first
<ocx>
ok
<MrZYX>
with the to_s method
<ocx>
thats new to me
<lupine>
amusingly, "raise nil" raises a TypeError
kaspergrubbe has joined #ruby
jrhe has quit [Read error: Connection reset by peer]
<ocx>
nil.to_ MrZYX ?
<ocx>
_s
<MrZYX>
you need to find the method that returns nil
<MrZYX>
when it encounters an EOF
mmcdaris has joined #ruby
danshult_ has quit [Remote host closed the connection]
schickung has quit [Quit: schickung]
jhulten has quit [Remote host closed the connection]
danshultz has joined #ruby
raphaelivan has quit [Ping timeout: 252 seconds]
jhulten has joined #ruby
mjs2600 has quit [Remote host closed the connection]
<MrZYX>
I sent you a link to its documentation earlier
schickung has joined #ruby
<ocx>
MrZYX: i think its line 8: line << sp.gets until line.end_with?("\n") since: 01test.rb:8:in `readline1': can't convert nil into String (TypeError)
<MrZYX>
exactly
<MrZYX>
so we call three methods in that line
jhulten has quit [Read error: Connection reset by peer]
<MrZYX>
String#<<, IO#gets and String#end_with?
jhulten has joined #ruby
<MrZYX>
which might return nil and which doesn't like to be passed a nil?
rdark has quit [Quit: leaving]
<MrZYX>
*which one
<ocx>
line.end_with?("\n")
danshult_ has joined #ruby
<Hanmac>
end_with? returns bool
<ocx>
it will return nill since it does not match until a \n is reached MrZYX
<MrZYX>
and we pass a static string value to it
eldariof has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
<MrZYX>
no, it does return true or false
<ocx>
ok then sp.gets
myappleguy has quit [Ping timeout: 265 seconds]
<ocx>
so i do line.sp.gets.to_s ?
<MrZYX>
yes
<MrZYX>
hm
aryaching_ has joined #ruby
<MrZYX>
almost
surrealanalysis has quit [Quit: surrealanalysis]
<MrZYX>
does line (String) have a #sp method?
<ocx>
`<main>': undefined method `include?' for nil:NilClass (NoMethodError)
workmad3 has quit [Ping timeout: 246 seconds]
lfox has quit [Quit: ZZZzzz…]
Norrin has quit [Excess Flood]
schickung has quit [Client Quit]
<MrZYX>
hm, no idea how you made that happen again...
kaspergrubbe has quit [Remote host closed the connection]
khushildep has quit [Quit: khushildep]
RichardBaker has joined #ruby
Norrin has joined #ruby
lmickh has quit [Quit: lmickh]
jbpros has quit [Client Quit]
eldariof has quit [Ping timeout: 268 seconds]
sandeepk has quit [Ping timeout: 264 seconds]
DrCode has quit [Remote host closed the connection]
Bry8Star{T2 has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 246 seconds]
carraroj has joined #ruby
DrCode has joined #ruby
allanm_ has quit [Read error: Connection reset by peer]
allanm_ has joined #ruby
schickung has joined #ruby
schickung has quit [Client Quit]
camilasan has joined #ruby
carlyle has joined #ruby
Liquid-- has quit [Quit: Computer has gone to sleep.]
pskosinski has joined #ruby
allanm has joined #ruby
erry_ has joined #ruby
xeno_ has quit [Ping timeout: 250 seconds]
Reach has quit [Remote host closed the connection]
zoee has quit [Quit: Leaving]
pskosinski has quit [Client Quit]
^Chris^ has quit [Read error: No route to host]
wald0 has quit [Quit: Lost terminal]
Thanatermesis has quit [Quit: ɯlɐɔ uı ʞɹoʍ oʇ ƃuıoƃ]
Bry8Star{T2 has joined #ruby
erry_ has left #ruby [#ruby]
Runkle has joined #ruby
<Runkle>
hiya.
zoee has joined #ruby
<Runkle>
i'm a rubynooby and i heard the term "RBN" but from the github page i'm unsure of what it is.
allanm_ has quit [Ping timeout: 260 seconds]
rickmasta is now known as Rickmastaa
duggiefresh has joined #ruby
mmitchell has joined #ruby
Thanatermesis has joined #ruby
johnnyfuchs has joined #ruby
percival__ has joined #ruby
burlyscudd has quit [Quit: Leaving.]
<havenwood>
Runkle: What Github page? I've never heard of RBN. How did you hear of it?
embryoconcepts has joined #ruby
tris has quit [Excess Flood]
aspiers has quit [Read error: Operation timed out]
<havenwood>
Runkle: I don't think that is a "thing" Rubyists will be generally familiar with, but maybe I'm just odd man out. :P
jrhe has joined #ruby
<MrZYX>
I second that :P
<MrZYX>
(the first part)
tris has joined #ruby
jondkinney_afk is now known as jondkinney
<havenwood>
Yeah, dunno why i said the last part, since I know it isn't true. Seems harsh sometimes to be clear in what you're saying though.
maxamillion has joined #ruby
poikon has quit [Ping timeout: 246 seconds]
<maxamillion>
random question, but is highline the defacto-standard rubygem for building command line apps or is there something more common(or better)? thor? $other?
<havenwood>
We've got plenty of three-letter gibberish initialisms, just not that combo. :P
heftig has quit [Ping timeout: 264 seconds]
<MrZYX>
hmmm, irb, pry, what else?
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
heftig has joined #ruby
<MrZYX>
oh gem of course, if you want to count that in
<havenwood>
drb
<havenwood>
rom
myappleguy has joined #ruby
<MrZYX>
hm, see, rom, I'm out already :P
hiall has quit [Quit: hiall]
<havenwood>
i guess rom is an acronym not an initialism
<havenwood>
i was just thinking irb and drb
Grantlyk has joined #ruby
Grantlyk has left #ruby [#ruby]
Rickmasta has joined #ruby
<havenwood>
<3 pedantry
<MrZYX>
so two is already plenty? ;P
<havenwood>
rbx
Desert_eagle has quit [Quit: Leaving]
<havenwood>
MrZYX: More than plenty!
<havenwood>
MrZYX: Our need for them was low to start with. Supply being low is no prob.
AleksEst_ has joined #ruby
Rickmastaa has quit [Remote host closed the connection]
<havenwood>
i'm glad Pry and Gem are words not char to work mappings
<havenwood>
word*
<MrZYX>
yeah
Skelz0r has quit [Ping timeout: 244 seconds]
petey has quit [Remote host closed the connection]
yourmysin has joined #ruby
Skelz0r has joined #ruby
duggiefresh has quit [Ping timeout: 252 seconds]
<havenwood>
I'd love to see Pry in the stdlib. I think the biggest impediment to that is its deps.
mmcdaris has quit [Quit: mmcdaris]
petey has joined #ruby
Bry8Star{T2_ has joined #ruby
eyckelbo1m has joined #ruby
SirFunk has quit [Ping timeout: 244 seconds]
eyckelboom has quit [Ping timeout: 244 seconds]
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
jrhe has quit [Ping timeout: 246 seconds]
AleksEst has quit [Ping timeout: 244 seconds]
jrhe_ has joined #ruby
typicalbender has quit [Quit: Leaving.]
duggiefresh has joined #ruby
forced_request has quit [Ping timeout: 244 seconds]
A124 has quit [Ping timeout: 244 seconds]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
drumsrgr8forn8 has quit []
<Runkle>
nm. rbenv it what i heard him say
<havenwood>
Runkle: Ahh. A tool to switch between using different Ruby implementations.
lfox has joined #ruby
pel_daniel has joined #ruby
typicalbender has joined #ruby
SirFunk has joined #ruby
<havenwood>
Runkle: I prefer ruby-install and chruby instead of ruby-build and rbenv. RVM is the other popular option.
SJr has quit [Ping timeout: 244 seconds]
SJrX has joined #ruby
A124 has joined #ruby
mrsolo has joined #ruby
aganov has quit [Remote host closed the connection]
clusterfoo has joined #ruby
petey has quit [Ping timeout: 252 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
maxamillion: Seems you hear more about Thor these days. But yeah, I think Highline is popular. I think just an option parser upgrade like Slop or Trollop is enough for small tools. I think of Highline as the most burly option, but I need to look more closely at Thor.
camilasan has quit [Remote host closed the connection]
philtr has joined #ruby
philtr_ has quit [Ping timeout: 244 seconds]
iaj has quit [Read error: Connection reset by peer]
iaj_ has joined #ruby
camilasan has joined #ruby
<havenwood>
maxmanders: Some of the stuff that was only in Highline is in Ruby now, which does make it easier to go it on your own.
digital-ghost has joined #ruby
jlast has quit [Remote host closed the connection]
<havenwood>
Oops, mixing up my maxs, sorry!
<maxmanders>
;-)
farn has quit [Ping timeout: 244 seconds]
carraroj has quit [Read error: Operation timed out]
<clusterfoo>
I have a module Workers, and a class Tasks::Foo inside modue Tasks. I'm trying to call Workers::Bar from inside Tasks::Foo, but I keep gettin "uninitialized constant Workers" because it looks fo Tasks::Workers... I've tried "include Workers" inside Foo, but it will keep looking inside the Tasks scope. How do I call a module from inside another module?
farn has joined #ruby
ShellFu has joined #ruby
mmcdaris has joined #ruby
<havenwood>
clusterfoo: ::Workers::Bar
<MrZYX>
that should just work, are you sure the files that define the workers module are actually loaded?
mneorr has joined #ruby
<clusterfoo>
<havenwood> tried that too... I guess my problem is something else?
<havenwood>
clusterfoo: show the code?
<clusterfoo>
hold on I'll gist it.
Aloysius1 has quit [Remote host closed the connection]
bean has joined #ruby
cburyta has joined #ruby
drumsrgr8forn8 has joined #ruby
camilasan has quit [Ping timeout: 272 seconds]
heftig_ has joined #ruby
Grantlyk has joined #ruby
heftig_ has quit [Remote host closed the connection]
zoee has quit [Quit: This computer has gone to sleep]
<clusterfoo>
<MrZYX> derp, that's probably the problem. right. thanks.
<law>
yaaay! thank you
<typicalbender>
if i remember t hat article is pretty good
<typicalbender>
np
Xeago has joined #ruby
jrhe_ has quit [Quit: jrhe_]
jhaals has joined #ruby
iliketurtles has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood>
i prefer my lambdas stabby
mlpinit has quit [Remote host closed the connection]
macmartine has joined #ruby
olivier_bK has quit [Ping timeout: 268 seconds]
mlpinit has joined #ruby
gasbakid has joined #ruby
mikepack has joined #ruby
jlebrech has quit [Quit: Konversation terminated!]
nobitanobi has joined #ruby
tvw has joined #ruby
petey has joined #ruby
<nobitanobi>
prova = { "255,244,233" => 2, "433,222,333" => 3 }; prova.max_by { |k,v| v }; Why would this max_by return an Array?
momomomomo has quit [Quit: momomomomo]
mojjojo has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby
<MrZYX>
nobitanobi: because it's a method from Enumerable and Hash#each yields [key, value]
<nobitanobi>
it treats each element (k,v) of the hash as an array?
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nobitanobi>
oh ok.
jrhe has joined #ruby
<MrZYX>
if you want the maximum value in the hash: hash.values.max
nanoyak has joined #ruby
<nobitanobi>
I actually need the key
<MrZYX>
ok, then just add .first
mikepack has quit [Read error: Operation timed out]
<MrZYX>
to what you have
<nobitanobi>
yup
<nobitanobi>
I was doing .keys.first
<nobitanobi>
:P
<nobitanobi>
thanks
AlSquire has joined #ruby
<law>
I'm just having trouble trying to think of use cases where I would use procs/lambdas
evenix has quit [Remote host closed the connection]
<law>
my ruby-fu is quite weak, but I'm going through the codeschool.com courses
jbw has quit [Ping timeout: 272 seconds]
<MrZYX>
law: store passed code for later execution for example
aspiers has joined #ruby
<coldmethod>
law: procs are to automate the use "blocks".. lambdas do the same .. with one difference
evenix has joined #ruby
<law>
what makes code 'passed'?
<law>
keep in mind, I'm a sysadmin who mainly uses Ruby for scripting :-)
mlpinit_ has joined #ruby
<MrZYX>
defined by the caller, like a block or a passed proc/lambda of course
<law>
I'm sort of starting to come around to 'yield' and how that works, but it's slow going
<coldmethod>
law: lamda passes the control back to the invoking method
<coldmethod>
that's the only difference
atno has quit [Remote host closed the connection]
ckinni has joined #ruby
<coldmethod>
law: do you know what's a block?
<law>
i read stuff like "lambas and procs are just drop-in code snippets", and I think to myself "isn't that what we call a 'function'?"
<law>
err, 'blocks and procs', not lambdas and procs, sorry
krz has quit [Quit: krz]
zipper has joined #ruby
mjs2600 has joined #ruby
<DouweM>
procs and blocks are lambdas. a lambda is, indeed, an unnamed function
failshel_ has joined #ruby
mlpinit has quit [Ping timeout: 260 seconds]
atno has joined #ruby
<law>
I'll figure it out, eventually. it'll just take a real-life "oh, this is TOTALLY what blocks/procs/lambdas are for, this makes things so much easier!"
<coldmethod>
law: you basically need to first understand what truly a block is.. before you move ahead.. what you said is logically right but technically there are "methods" in Ruby.. but blocks are very agile rudimentary thing.. seems like you don't know those yet
<coldmethod>
yes, start with a block
<MrZYX>
law: did you use #each yet?
evenix has quit [Ping timeout: 268 seconds]
ddd has quit [Ping timeout: 252 seconds]
<law>
when I think of 'block', I think of stuff like 'somearray.each do |variable| puts variable end'
Tarential has quit [Excess Flood]
<law>
yeah, I get 'each' and have used it often
drumsrgr8forn8 has quit [Remote host closed the connection]
Tearan has joined #ruby
AleksEst has joined #ruby
Tarential has joined #ruby
<coldmethod>
nice then law
drumsrgr8forn8 has joined #ruby
jbw has joined #ruby
<law>
so, I get how to *use* 'each', but I guess I don't know how 'each' works under the hood to the point where I can say 'this is how each operates'
AleksEst_ has quit [Ping timeout: 260 seconds]
p8952 has joined #ruby
<coldmethod>
law: consider blocks as "arguments" that come after "methods" (anything with a dot, like .each, .map, yada yada)
aagdbl has joined #ruby
<coldmethod>
what material are you referencing / reading? (i may guide you to the correct resource for beginning things out)
surrealanalysis has joined #ruby
aryaching has joined #ruby
<DouweM>
law: do you know JS and its forEach or underscore's _.each ?
<MrZYX>
def each; while element = get_next_element; yield element; end; end;, basically
failshell has quit [Ping timeout: 246 seconds]
aryaching_ has quit [Ping timeout: 252 seconds]
Advocation has joined #ruby
<Xeago>
MrZYX: [false].each would yield nothing
<Xeago>
:3
<law>
DouweM: I do not. I speak bash and Ruby, pretty much. I've done a fair bit of Perl back in the day, but that's about it
<MrZYX>
Xeago: sure, not the point ;)
<law>
coldmethod: right now I'm just going through the coldschool.com courses
<Xeago>
:D
failshel_ has quit [Ping timeout: 272 seconds]
<law>
I just finished RubyBits 1, and the very last course was procs/blocks/lambdas. I *barely* made it through
zipper has quit [Ping timeout: 272 seconds]
<Xeago>
that sounds like a very weird ordering of concepts law
zipper has joined #ruby
<law>
how so?
jlast has joined #ruby
drumsrgr8forn8 has quit [Ping timeout: 246 seconds]
bklane has quit [Quit: Leaving...]
jalcine has quit [Excess Flood]
<coldmethod>
law: last time i checked codecademy.com, this stuff was better explained there
lmickh has joined #ruby
<law>
oooOOOOOoo, I will check there too
<law>
thank you
<coldmethod>
law: np
<Xeago>
because these required deeper knowledge of ruby internals
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby
lmickh has quit [Client Quit]
<Xeago>
whereas you are getting started with ruby internals
<law>
the codeschool.com courses went from "yep, I know and have done this a few dozen times now" to "....great googly moogly, talk about 100 miles an hour!" VERY quickly
<coldmethod>
Xeago: right said.. the whole point of starting OOP takes a little bit of time at first
Davey has quit [Quit: Computer has gone to sleep.]
<law>
I'm learning that I'm a project-based learner
<law>
if that helps at all
zipper_ has joined #ruby
<law>
I can't just read something and go "Huh, that's interesting" and then go out and use it. I tend to need to build something (or several things) with it before it starts to sink into my thick skull
<iajrz>
law: rubymonk has several problems
<coldmethod>
Codecademy is free and gets straight to coding.. for beginners I recommend that .. you might find OOP quite intriguing or confusing at first, but that's natural if you have never heard or read about it.. just Google stuff out
<iajrz>
it's kind of fun... I'm using it to compliment what I learnt with rubykoans
zipper has quit [Ping timeout: 261 seconds]
jkhwan has quit [Remote host closed the connection]
<Xeago>
ruby-warrior is very oop'y
motto has joined #ruby
jkhwan has joined #ruby
burlyscudd has joined #ruby
<coldmethod>
law: Keep in mind almost everything in Ruby is an object, meaning it has something to do with OOP. Sooner or later you may wanna familiarize yourself with that. But do that gradually.
zipper_ is now known as zipper
m8 has quit [Ping timeout: 272 seconds]
<Xeago>
I hands down think that ruby-warrior is a very very good thing to go through with people that have problems with oop
iliketurtles has quit [Quit: zzzzz…..]
burlyscudd has quit [Read error: Connection reset by peer]
* coldmethod
checking what Xeago is saying
mikepack has joined #ruby
burlyscudd has joined #ruby
<law>
I kinda sorta think I 'get' the whole 'everything is an object' part of OOP
<law>
here's a script I wrote awhile ago to help me more quickly create Puppet manifests - http://pastebin.com/ihftz4hQ
taternuts has quit [Read error: Connection reset by peer]
<iajrz>
omg, nice retro music
* iajrz
falls in love
jlast has quit [Ping timeout: 272 seconds]
* coldmethod
likes ruby-warrior
<Xeago>
law: line 12 reads so much better if you do not use parentheses around the argument
* coldmethod
and approves it
stkowski has quit [Quit: stkowski]
<Xeago>
f.write <<EOF is fine
<coldmethod>
law: Go ahead and try ruby-warrior
<law>
I already am
<Xeago>
:D
<law>
jammin' to that funky music :-)
CreativeEmbassy has quit [Ping timeout: 265 seconds]
jkhwan has quit [Ping timeout: 272 seconds]
aspiers has quit [Read error: Operation timed out]
taternuts has joined #ruby
jkhwan has joined #ruby
Liquid-- has joined #ruby
kaspergrubbe has joined #ruby
<Xeago>
I can play this on drums and a harmonica
<Xeago>
:D
Advocation has quit [Quit: Advocation]
mikepack has quit [Remote host closed the connection]
<yxhuvud>
law: I would really recommend breaking out a method for the whole create a file with a class thing. You are repeating yourself, and it messes heavily with your indentation
mansi has joined #ruby
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<agorman>
Running make install again fixes it for a day or two then the error returns.
javos_ has joined #ruby
lethjakm1 is now known as lethjakman
lolmaus has joined #ruby
<lolmaus>
Hi! Is there a more elegant way of saying: `if (defined? external_var && external_var)` ?
nanoyak has joined #ruby
reset has joined #ruby
Es0teric has joined #ruby
watermel0n has quit []
Mars has joined #ruby
<MrZYX>
lolmaus: where does external_var come from?
mmcdaris_ has joined #ruby
Mars is now known as Guest90389
mmcdaris has quit [Read error: Connection reset by peer]
mmcdaris_ is now known as mmcdaris
<MrZYX>
because it'll always be defined unless you're inside eval'd code
scarolan has quit [Ping timeout: 272 seconds]
momomomomo has joined #ruby
dhruvasagar has quit [Read error: Operation timed out]
javos_ has quit [Client Quit]
<lolmaus>
MrZYX, just as the previous time asked, it comes from a call to Middleman/Padrino partials: `partial('partialName', locals: { external_var: 'foo' })`. It's not defined if not mentioned in the call.
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mmitchell has joined #ruby
<MrZYX>
well, then my recommendation stays the same
scarolan has joined #ruby
<iajrz>
aw, ruby warrior is so short
alvaro_o has joined #ruby
rezzack has joined #ruby
lmadrigal has joined #ruby
zipper has joined #ruby
Grantlyk_ has joined #ruby
<lolmaus>
MrZYX, to not use Middleman? :(
Guest90389 has quit [Ping timeout: 260 seconds]
<lolmaus>
Or to explicitly name ALL variables in ALL calls of ALL partials?
<MrZYX>
to place sane defaults at the top if you can't get the users of your partials to define the vars
ckinni has joined #ruby
<MrZYX>
also it should be a rare case that a var is optional, maybe rethink your partials
<MrZYX>
or what you pass to them
coldmethod has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
jbw has quit [Ping timeout: 260 seconds]
hadees has joined #ruby
<lolmaus>
MrZYX, so there's no way to say `defined? external_var && external_var` with a single clause?
<MrZYX>
no
<MrZYX>
and that's a good thing
<MrZYX>
doing that is supposed to be ugly
hiyosi has quit [Ping timeout: 260 seconds]
jb41 has quit [Ping timeout: 260 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
mansi has quit [Read error: Connection reset by peer]
mansi has joined #ruby
<lolmaus>
MrZYX, why is that ugly for local vars but not ugly for array/hash elements? `{}[:foo]` => nil
brtdv has quit []
<MrZYX>
I say it's ugly to have optional parameters for partials
<lolmaus>
MrZYX, uhm... why? What if my partial accepts a JSON-like structure to render?
nouitfvf has joined #ruby
blackmes1 has joined #ruby
<MrZYX>
because your partial should represent one thing, like a user in your system, or an entry in a todo list etc.
<MrZYX>
something you ideally have floating around as object
mercwithamouth has quit [Ping timeout: 272 seconds]
Reach has joined #ruby
<MrZYX>
(and I won't even ask why you'd want to render JSON with html or whatever)
<ShellFu>
BraddPitt, man I wish you were the real one so I could tell you how much I was disappointed with WWZ!
<nobitanobi>
h0rrorvacui, I think it's hacky because you are "forcing" to be a Symbol, trying to take advantage of how the to_proc of Symbol will do that for you, but is not actually why to_proc of Symbol is that way
<nobitanobi>
I guess ~~
<BraddPitt>
ShellFu who says I'm not?
<h0rrorvacui>
How do you know that to be true?
<ShellFu>
pfft he couldnt script his way out of an already open paper bag
<BraddPitt>
also has anyone read Beginning Ruby before?
<BraddPitt>
by Peter Cooper
<h0rrorvacui>
I mean a lot of things we take for granted were at one point hacks that became accepted use.
gazarsgo has joined #ruby
<nobitanobi>
h0rrorvacui, that's true.
momomomomo has quit [Quit: momomomomo]
<law>
alright block-folk, here's a concrete example of what's confusing the hell out of me about these things
<gazarsgo>
if i puts an object and it's formatted like [#<Namespace::Class…..] shouldn't I be able to parse it again with Marshall.load? I get a version problem
dayepa has quit [Quit: dayepa]
asobrasil has left #ruby [#ruby]
<atmosx>
BraddPitt: even numbers I think, not sure if he implemented the method or exists for fixnum (probably exists)
<law>
why bother doing it the first way instead of just doing it the second way?
dayepa has joined #ruby
tris has quit [Excess Flood]
edwardly has quit [Ping timeout: 246 seconds]
tris has joined #ruby
<MrZYX>
law: that's not the best example granted. lets say you're actually reading the message to tweet from that block
<MrZYX>
and generating is very very very expensive
<MrZYX>
*generating the message
<MrZYX>
you don't want do it until you're sure you can actually post it
<MrZYX>
so you postpone until the authentication succeeded
erinb has quit [Quit: My Mac has gone to sleep. ZzZzZz...]
<law>
right, that's what the 'if' statement is for
binaryplease has joined #ruby
<law>
'if authenticate succeeds, THEN do whatever'
<h0rrorvacui>
I feel like you are also missing a benefit from doing it the block way
<MrZYX>
and what I missed is that there are no two ways that are the same to generate the message
<MrZYX>
but as said that example isn't the best one
RichardBaker has quit [Quit: RichardBaker]
lnormous has quit [Ping timeout: 264 seconds]
edwardly has joined #ruby
<MrZYX>
it really comes down to "I want to run a user defined action here" instead of a predefined action
<shevy>
guys, it's time again
<shevy>
get undressed!!!
<shevy>
law where is order?
<Kamuela>
what's going on?
<MrZYX>
lolmaus: so for my taste that are waaay too many parameters
<Kamuela>
too cold to be playing around with this nudity ish
<shevy>
Kamuela you should live in canada man
nicoulaj has joined #ruby
<shevy>
they have trucks sliding over ice streets
typicalbender has joined #ruby
<law>
alright, let me try a different example
<Kamuela>
yeah screw that
<MrZYX>
lolmaus: I'd consider two things: extract the parameters into a class and/or define a bunch of subtype partials that call the general partial, filling in the defaults
jlast has joined #ruby
christopherdupon has joined #ruby
<lolmaus>
MrZYX, i'm not familiar with this technique. :( Is there an article over the web that describes it? I'm kinda new to Middleman.
<MrZYX>
I never used middleman
<atmosx>
I need to retrieve data from RPi clients via VPN. They all have ssh enabled.. I actually need to read a small file, sqlite3 database... usually it's less than 100 kb. You think it's better to scp the file to the server or work remotely?
<MrZYX>
lolmaus: I'd rather call this technique "OOP"
<atmosx>
I was even thiking to write a client/server app but imho it's an overkill :-/
christopherdupon is now known as _Chris
<atmosx>
what is middleman?
<atmosx>
lol
Guedes0 has left #ruby ["Saindo"]
<shevy>
atmosx the guy that accepts the money and then gives it to the assassin
<atmosx>
I mean NEVER, the guy (which-ever-guy) talks like 45 minutes straight... wtf
mansi has quit [Remote host closed the connection]
<shevy>
Hanmac you scare me
TDJACR has joined #ruby
<atmosx>
hmm I got it. I'll use rsync...
momomomomo has joined #ruby
momomomomo has quit [Client Quit]
* atmosx
puts his cheap low-level sony headphones one
<atmosx>
shit on/one/s
pragmatism has quit [Quit: Leaving...]
mansi has joined #ruby
<h0rrorvacui>
atmosx: what does rsync have to do with a turkish tv-series?
AleksEst has quit [Ping timeout: 260 seconds]
gasbakid has quit [Remote host closed the connection]
AleksEst has joined #ruby
<lolmaus>
MrZYX, i'm not putting any logic. Just inserting data from variables, that's the most basic usage of templating.
<atmosx>
h0rrorvacui: you are clearly not a programmer
mansi has quit [Remote host closed the connection]
ezkl has joined #ruby
ezkl has quit [Max SendQ exceeded]
mansi has joined #ruby
ezkl has joined #ruby
saarinen has joined #ruby
Mars has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
<MrZYX>
lolmaus: so this is all data anyway, it should come from the place where you call the root view. Now if you properly describe this data with objects, like a ProfileField class, your view will even get shorter, because all you need to do then is iterating over the array of ProfileField objects you'll get and pass each to the partial. Many templating languages even support a syntax to their render/partial for further simplifying that
<MrZYX>
hm, grew that to big?
Mars is now known as Guest74546
gr33n7007h has joined #ruby
gr33n7007h has quit [Client Quit]
sambao21 has quit [Quit: Computer has gone to sleep.]
mmitchell has joined #ruby
gr33n7007h has joined #ruby
<h0rrorvacui>
lolmaus: I agree with MrZYX that you could clean that up even if it is just filling in a template. The best way to do that is break it up into some objects.
_phansch has quit [Remote host closed the connection]
mansi has quit [Read error: Connection reset by peer]
<h0rrorvacui>
It just seems ugly
mansi_ has joined #ruby
<billy_ran_away>
Can anyone help me with this? "hey \xAE".force_encoding("UTF-8").blank? raises an exception ArgumentError: invalid byte sequence in UTF-8
kcombs has quit [Remote host closed the connection]
gr33n7007h has quit [Max SendQ exceeded]
<shevy>
atmosx why would anyone wanna watch turkish videos... have you seen turkish comedy? it's not funny!
gr33n7007h has joined #ruby
<h0rrorvacui>
atmosx: I still don't see the answer to why rsync and turkish tv series have in common.
<atmosx>
shevy: I have no idea. No I don't watch videos usually.
ezkl has quit [Client Quit]
<h0rrorvacui>
Is there some use of rsync that I do not know of.
gr33n7007h has quit [Read error: Connection reset by peer]
<law>
the only way I could see it even beginning to make sense is if I wanted to print different 'Sent!' messages depending on where in the program I would send a successful tweet
nouitfvf has joined #ruby
<shevy>
hmmmmm
<law>
other than that, I kind of see it as 'what's the point?'
<shevy>
billy_ran_away weird
<h0rrorvacui>
atmosx: and to be clear the unix world doesn't include all programmers
<atmosx>
h0rrorvacui: only the skilled ones. (sic)
<shevy>
Hanmac, why does the code above not work? ^^^
tharindu has quit [Quit: Leaving...]
<atmosx>
h0rrorvacui: I'm just trolling, ndr
<billy_ran_away>
cool bot though
<billy_ran_away>
and page... I didn't know about that
vlad_starkov has joined #ruby
tsykoduk is now known as zz_tsykoduk
<shevy>
atmosx do you dance to "simarik"? :)
<Hanmac>
shevy because split likes to have a valid encoding
<Evan_Donovan>
i'm running CentOS 5 and i just installed the capistrano gem, but when i run cap production deploy, it says "-bash: cap: command not found"
<shevy>
Evan_Donovan does capistrano come with this binary
<shevy>
"binary"
<shevy>
a file in bin/ directory
mansi has joined #ruby
bazaretas has quit [Ping timeout: 252 seconds]
zipper has joined #ruby
<shevy>
I just installed it
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
it comes with bin/cap and bin/capify
interact_ has joined #ruby
<shevy>
Evan_Donovan if I were you, I would try to find out where capify is
mikeg has quit [Remote host closed the connection]
<shevy>
my guess is it is not in your $PATH
jkhwan has joined #ruby
<shevy>
for me it works
<Evan_Donovan>
ok that is a fair assumption to make; i will check
ckinni has joined #ruby
mikeg has joined #ruby
scarolan has joined #ruby
<shevy>
on my system it is at /Programs/Ruby/Current/lib/ruby/gems/1.9.1/cache/capistrano-3.0.1.gem
interactionjaxsn has quit [Read error: Connection reset by peer]
<shevy>
for default ruby it should be in /usr/lib/ruby* etc...
<shevy>
for home installations, it should be in $HOME, perhaps .rvm or somewhere else
<shevy>
some crazy people have it installed in /usr/local/lib
burlyscudd has quit [Quit: Leaving.]
<Evan_Donovan>
i am using rvm
<shevy>
:-)
nanoyak has quit [Quit: Computer has gone to sleep.]
yalue has quit [Quit: Leaving]
thumpba_ has joined #ruby
<Evan_Donovan>
where would it go with rvm? i am still a newbie to this
Zeeo has joined #ruby
Andrevan has joined #ruby
elux has quit [Quit: Bye!]
surrealanalysis has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<shevy>
Evan_Donovan surely your home dir
<shevy>
but on linux you can find it anyway
pragmatism has joined #ruby
<shevy>
find / -name capify
<shevy>
or your home dir rather than /
p8952 has quit [Write error: Broken pipe]
typicalbender has quit [Quit: Leaving.]
<lolmaus>
MrZYX, :collection just lets you combine multiple partial calls into one.
<MrZYX>
which is my entire point m(
zz_tsykoduk is now known as tsykoduk
platypine has joined #ruby
platypine has joined #ruby
platypine has quit [Changing host]
<lolmaus>
h0rrorvacui, so i have a lot of small partials. In page template, do you suggest that i manually assemble the required structure with those small partials?
<benzrf>
what i want is composition & sections & currying
<benzrf>
is this so much to ask
bazaretas has joined #ruby
<Hanmac>
benzrf: normaly memory usage would not cause a freeze, or how much memory is the process using? ... does it have a loop where its waiting for something?
<benzrf>
no, my COMPUTER freezes
<benzrf>
one sec ill show you my code
<benzrf>
you may want to wear sunglasses to prevent eye damage
thelorax123 has joined #ruby
saarinen has joined #ruby
<nobitanobi>
lol
<nobitanobi>
shiny code?
<benzrf>
no, overly-functional code
<benzrf>
perhaps
<benzrf>
im doing a challenge on codewars, the details are here:
<shevy>
Evan_Donovan I could not tell you why it is not recognized, I do not use and do not believe in rvm. I compile programs into "versioned app-dirs" into /Programs directory. my different rubies are at /Programs/Ruby/VERSION_HERE
sn0wb1rd has quit [Quit: See ya]
<shevy>
benzrf perhaps a big loop
bazaretas has quit [Quit: Leaving]
bazaretas has joined #ruby
surrealanalysis has quit [Quit: surrealanalysis]
mengu has joined #ruby
mengu has joined #ruby
<benzrf>
shevy: look at muh code?
tharindu has joined #ruby
reset has joined #ruby
sn0wb1rd has joined #ruby
mary5030 has quit [Remote host closed the connection]
* iajrz
dances as he starts learning rails
<iajrz>
thanks for being here, guys, learning ruby feels less lonely
<shevy>
why do you use bpaste.net
<shevy>
there are no colours
<benzrf>
shevy: cuz of my #python background
<benzrf>
and there are
mary5030 has joined #ruby
capicue has quit [Quit: Leaving...]
maletor has quit [Quit: Computer has gone to sleep.]
<benzrf>
my pasting program is wrong atm
<benzrf>
it tries to paste it as plaintext for some reason
<benzrf>
maybe it does not recognize ruby syntax
<benzrf>
1 sec repasting thru the website
<iajrz>
why not gist?
steinsgate is now known as dreamchaser
<benzrf>
pfft, gist
cescalante is now known as ce_afk
<benzrf>
im way too hipster to use something THAT popular
<shevy>
do you want to build a castle made from sand or made from granite
jbw has joined #ruby
<nobitanobi>
hahaha
<benzrf>
that's not a concrete nswer
<shevy>
sure it is
tobyink has joined #ruby
<benzrf>
why should i use a class
<shevy>
you build on sand
<benzrf>
how should i use it
<benzrf>
you sound like a person stuck in an OO frame of mind
<benzrf>
you use OO for when OO makes sense
<shevy>
it's almost the same as non-class usage, except that you put things into a namespace for once (your class) and lend your code towards easier reusability
nitish has joined #ruby
Grantlyk has quit [Ping timeout: 272 seconds]
nitish has quit [Client Quit]
<shevy>
I use OO because it is efficient
<nobitanobi>
benzrf... shevy is a pretty open minded man
<benzrf>
o rly
lmadrigal has joined #ruby
<tobyink>
Maybe dumb question but, if I have a mixin module X and a class Y, how can I check if Y includes X. (And if a parent class of Y includes X, that does count!)
<shevy>
benzrf just look at a living organism
<benzrf>
classes are for defining a class of object
<benzrf>
which is not something im doing here
<shevy>
benzrf every cell is like a little minicomputer
atmosx has quit [Quit: computer went to sleep...]
<benzrf>
shevy: have you accepted FP into your heart yet
<shevy>
tobyink hmm tried with .ancestors yet? not sure if that covers it
<shevy>
benzrf I don't see FP in biology, sorry
<shevy>
it's more for mathematicians
gtc has quit [Quit: kill -9 gtc]
<benzrf>
pfft yeah RIGHT
<benzrf>
well OOP is more for engineers
<shevy>
benzrf other than .all? and concat_concat your code seems fine
<tobyink>
shevy: that does look like it will work - thanks!
JohnBat26 has quit [Ping timeout: 252 seconds]
<benzrf>
whats wrong with all?
<benzrf>
and collect_concat
<benzrf>
also it runs real slow
<benzrf>
and it has interesting issues
<shevy>
benzrf depends on which kind of OOP, I don't like the C++ OOP much. my favourite guy on OOP is Alan Kay
<shevy>
the problem with .all? is that you chain it to end
<benzrf>
when run that way, it freezes my comp
<shevy>
where are the colours
atmosx has joined #ruby
<shevy>
benzrf that code looks scary
cek has joined #ruby
<cek>
i'd like to add some stuff to yaml emitter output
<Eiam>
I have a website that I cannot get to give me a json feed for anything, so I need to scrape its content
angusiguess has quit [Ping timeout: 245 seconds]
<Eiam>
anyone recommend a gem for doing that or should I just start regexing html?
<cek>
i've done that in syck, now psych doesn't take that quick_emit method properly. Any guidelines on that?
<benzrf>
;p
<shevy>
benzrf I don't actually know the card game rules but I would really try to turn it into a class and use some @ivars, at least for me that is much easier to debug or analyze. with benchmark module you can also see the bottlenecks, right now I dont know what is happening
ezkl has joined #ruby
<shevy>
I still have not understood .concat_fattard
ezkl has quit [Client Quit]
Bry8Star{T2 has joined #ruby
<shevy>
cek dunno, psych is still the reason I am not on 2.x :(
<Kamuela>
shevy, yeah exactly. it comes down need someone else to process all your ideas faster than you can type em lol
<Kamuela>
to needing*, hmm, my fingers are lazier than I am I think
d45h has quit [Ping timeout: 265 seconds]
danman has quit [Quit: danman]
mjs2600 has joined #ruby
simoz has joined #ruby
aspires has quit [Quit: sudo making a sandwich]
Grantlyk has joined #ruby
mjs2600 has quit [Remote host closed the connection]
typicalbender has joined #ruby
watermel0n has joined #ruby
thumpba_ has quit [Remote host closed the connection]
<nobitanobi>
Say I have a Hash object, and I want it to pass to several functions to fill it up. Is it ok ("ok" Ruby) if those functions don't return anything, but just fill the Hash up?
mary5030 has quit [Ping timeout: 263 seconds]
<benzrf>
nobitanobi: !!!
<benzrf>
nobitanobi: GOOD LORD HOW AWFUL
d45h has joined #ruby
<nobitanobi>
benzrf, ?
<benzrf>
jk
<benzrf>
but seriously, imo at least a method should only ever mutate self
<benzrf>
and nothing else
boboc has quit []
<benzrf>
*nothing else that persists outside of the method
capicue has joined #ruby
<benzrf>
otoh sometimes that leads to bad performance
<benzrf>
its your callf
ner0x has quit [Quit: Leaving]
stringoO has quit [Quit: stringoO]
vlad_sta_ has joined #ruby
<shevy>
Kamuela I would do that, but right now I only have time, not money ;)
typicalbender has quit [Client Quit]
mjs2600 has joined #ruby
mjs2600 has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
<shevy>
nobitanobi I dont quite grok it yet
<benzrf>
nobitanobi: anyway mutation of state is a major cause of bugs
<benzrf>
WHICH IS WHY YOU SHOULD USE HASKELL
<benzrf>
8D
<shevy>
nobitanobi you can use methods to populate your hash with valid data, sure
hiyosi has joined #ruby
<nobitanobi>
shevy, ok
four33 has quit [Remote host closed the connection]
<shevy>
nobitanobi ruby is all about data structures anyway
<benzrf>
shevy: what if you momentarily forget that it mutates, though?
<benzrf>
you could get nasty bugs
mikeg has joined #ruby
<shevy>
benzrf mutates what or how
<shevy>
my hash?
<benzrf>
also, the code is less clear to outsiders
<Kamuela>
shevy, I'm actually looking for a rails prototyper on odesk right now :)
<benzrf>
the hash passed in
<shevy>
sure it must change my hash and I will ensure with my own code how it does so
diegoviola has quit [Quit: WeeChat 0.4.2]
<shevy>
benzrf my code is clear :)
<benzrf>
if I say:
<benzrf>
foo = {}
<benzrf>
bar(foo)
vlad_starkov has quit [Ping timeout: 265 seconds]
<shevy>
what is this shit
<benzrf>
in general, foo being different is more confusing than not
<benzrf>
foo = bar(foo) is more clear
<shevy>
I would never do that
<atmosx>
shit
<benzrf>
do what?
<shevy>
either that
<benzrf>
??
<nobitanobi>
shevy, how would u do it?
<atmosx>
neither I
<shevy>
benzrf first off you don't use @ivars here!
<benzrf>
wat
<benzrf>
he is asking about that
<atmosx>
I eat nutella
* atmosx
is a ninja
<benzrf>
if it is ok to write a function that takes a hash and populates it directly
<shevy>
atmosx fat ninja
<benzrf>
i.e. mutation of argument
<benzrf>
i.e.
<benzrf>
foo = {}
Tarential has quit [Excess Flood]
<benzrf>
bar(foo)
<benzrf>
# foo is different now
<shevy>
benzrf yeah as said, it makes little sense what he wants to do but he should do what he wants to do
<benzrf>
pfft
<atmosx>
shevy: hey, you take that back... I'm a little fat lately.
Tarential has joined #ruby
<atmosx>
I need to do some sort of diet
<shevy>
atmosx and jogging
snatch has joined #ruby
vlad_starkov has joined #ruby
nateberkopec has joined #ruby
<benzrf>
if we let everybody do what they wanted to, code would be unreadbable!
<benzrf>
*ignore that first b
<shevy>
benzrf it already is in ruby :(
<benzrf>
HA
* snatch
bans benzrf
<snatch>
I could do w/e I want
Guest95462 has quit [Ping timeout: 265 seconds]
* snatch
sees myself out
<benzrf>
snatch: excuse me but i subscribe to the zen of python
mikeg has quit [Remote host closed the connection]
<nobitanobi>
shevy, how would you do it though?
<benzrf>
1-27: they do not write functions that mutate their args
mjs2600 has joined #ruby
<benzrf>
:p
<benzrf>
atmosx: 1 is true for me; python
<benzrf>
i should hope most people go for 2
<shevy>
nobitanobi I dont know what you are trying to solve, it just barely comes to me. I let the objects solve such things, what they use internally is never an issue for me
myappleguy has quit [Ping timeout: 264 seconds]
danshult_ has quit [Remote host closed the connection]
<benzrf>
i try for 3
vlad_sta_ has quit [Ping timeout: 252 seconds]
<benzrf>
ok 4 is not true for me >.>
<Eiam>
damn I fail at #1. I don't know any languages inside an out
mikepack has quit [Ping timeout: 272 seconds]
danshultz has joined #ruby
<shevy>
Eiam haha same here
<benzrf>
i know python real good
<shevy>
I speak a bit python
<Eiam>
I fail at almost all of these, good thing I'm not a professional programmer =p
<benzrf>
if python just had HOFs like ruby it would be easily my favde
<shevy>
sshss zzss Szshh?
<benzrf>
*fave
danshultz has quit [Read error: Connection reset by peer]
<benzrf>
shevy: sshhhhhsss zzzhhhsssh
<shevy>
damn you are better
mjs2600 has quit [Remote host closed the connection]
<nobitanobi>
shevy, ok...
<nobitanobi>
:)
<Eiam>
i interviewed a guy the other day and he said "well we call ourselves Engineers don't we"
hiyosi has quit [Ping timeout: 252 seconds]
mjs2600 has joined #ruby
<benzrf>
Eiam: ...
<Eiam>
I thought man, I sure hope we learned to call ourselves "programmers" or "Developers" to not disparage real engineering~!
<shevy>
my cat occupies my learning chair :(
nanoyak has quit [Quit: Computer has gone to sleep.]
binaryplease has quit [Ping timeout: 246 seconds]
<h0rrorvacui>
Eiam: I prefer developer over software engineer tbh.
<Eiam>
yes, I don't like the word engineer being used to describe software dudes
<shevy>
engineer are those guys that build skyscrapers no?
<benzrf>
shevy: FP is all about flow of data & messing with functions
<shevy>
benzrf sounds like ruby
<Eiam>
I build sky scraping code, its big & heavy!
<Eiam>
and probably uses some regex to scrape something somewhere =)
<benzrf>
shevy: the key part of FP is reusability and combinability & stuff
<h0rrorvacui>
Though its reasonable that some people are applying engineering principles to software development and are software engineers
<benzrf>
genericness etc
<Eiam>
h0rrorvacui: yeah for me engineer implies a set of rigor and officialness that I don't think programming generally has.
<shevy>
benzrf yup, totally ruby now
<shevy>
:)
<benzrf>
well that's a feature of most modern paradigms
<h0rrorvacui>
Just most of what we call software engineers are not really doing any engineering in that sense.
RichardBaker has joined #ruby
<benzrf>
FP & OOP are both approaches to this
<h0rrorvacui>
FP just doesn't model the real world as well :P
<h0rrorvacui>
lol
<benzrf>
In FP it's more about writing simpler functions that can be composed and reused in interesting ways
<benzrf>
h0rrorvacui: pfft
<h0rrorvacui>
FP is like a utopia in programming.
<Evan_Donovan>
i've got the following line of code throwing a 500 Error: referer_data = cookies[:"_pk_ref.3.d77e"]
<shevy>
ruby could be made simpler
<h0rrorvacui>
Thats why something in-between is best imo
<shevy>
benzrf can you become a guru in C and make a better language?
<benzrf>
shevy: haskell is incredibly bare bones as languages go really
<Evan_Donovan>
the error is NoMethodError (private method `gsub' called for ["", "", "1384552632", "https://www.google.com/"]:Array):
<benzrf>
shevy: what are you asking
mjs2600 has quit [Ping timeout: 265 seconds]
<shevy>
benzrf create a new programming language
<benzrf>
shevy: why dont you tell me what you want in a language
<h0rrorvacui>
we could really do that if you watn
<h0rrorvacui>
want*
<benzrf>
then ill tell you why haskell can do that for you
<benzrf>
( ͡° ͜ʖ ͡°)
<shevy>
Evan_Donovan you have an array and you try .gsub on it, which does not exist on array
<h0rrorvacui>
List the features lets do ti.
<h0rrorvacui>
it*
zoee has quit [Quit: This computer has gone to sleep]
snatch has left #ruby ["Leaving"]
<shevy>
benzrf hmm that's quite a long list of features
<benzrf>
^^wasbeing facetious
jbpros has joined #ruby
<h0rrorvacui>
no really list them
<benzrf>
shevy: ok what do you not like about ruby
sooli has quit [Ping timeout: 260 seconds]
mjs2600 has joined #ruby
<Evan_Donovan>
i thought that cookies in ActionDispatch was supposed to return a value (i.e., a string)
<shevy>
benzrf basically something that very closely resembles real biological cells. but in addition to that, also allows for pragmatic solving of problems with terse/succint syntax
<shevy>
benzrf I hate that modules and classes are artifically separated
<benzrf>
the latter resembles haskell for me
<benzrf>
;p
ItSANgo has joined #ruby
<benzrf>
what in ruby does not sound like real biological cells?
<benzrf>
can you be more detailed
<shevy>
benzrf uh didn't you say haskell does not store state? but a biological cell always has state, the genome. if you combine this in a multicellular organism, you have like a collection of minicomputers with different internal data
<h0rrorvacui>
some reason that made me think of turing machines and the finite state representations
<shevy>
benzrf ruby is very far away from being anywhere close to biological cells
aryaching has joined #ruby
<h0rrorvacui>
maybe because the drawings look like little cells
<h0rrorvacui>
lol
<benzrf>
basically in haskell, you cannot set state outside of your current function
<benzrf>
nor can you mutate anything
zipper has quit [Ping timeout: 272 seconds]
<shevy>
benzrf I think for one, you would need to be able to make reliable snapshots of everything at all time. If you use marshall, I dont think you can restore the original code that gave rise to the object
<benzrf>
so data flow happens entirely through function arguments
<benzrf>
shevy: oh haskell has that
<h0rrorvacui>
currying
watermel0n has quit []
<benzrf>
like compeltely
lnormous has quit [Ping timeout: 252 seconds]
<h0rrorvacui>
?
<h0rrorvacui>
ohh
heidi has joined #ruby
<benzrf>
shevy: by 'lack of state', the real meaning is that data cannot move through any means other than function args & returns
<h0rrorvacui>
You want to be able to unmarshall the code?
<benzrf>
most other usages of state work
<shevy>
h0rrorvacui I want to restore everything all the time and continue to work and modify it. a bit like that squeak thing of smalltalk, that would be cool
<benzrf>
shevy: so you cannot set an ivar, then see it from another functoin without returning anything
platzhirsch has joined #ruby
nouitfvf has quit []
mjs2600 has quit [Remote host closed the connection]
<benzrf>
shevy: one cool thing about haskell is that since there is no universal state and no side effects, functoins will ALWAYS behave the same, regardless of context
<benzrf>
so you can rely more on the behavior of your program
allsystemsarego has quit [Quit: Leaving]
<benzrf>
this also allows better compiler optimization
sexist has joined #ruby
<sexist>
>> class Woman; end; Woman.new.is_a? Object
<platzhirsch>
that's the closest you get to a language specification
ngoldman has joined #ruby
<shevy>
yes, memorize the ruby spec after that too
yfeldblu_ has quit [Ping timeout: 240 seconds]
cgore has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
<jimmy_birer>
Will do.
<shevy>
people are so eager to learn everything
<jimmy_birer>
Especialy the String one
<platzhirsch>
I was kind of confused with RubySpec, because I read over "executable specification" and expected something similar to the Java Language Specification
<shevy>
back in the day it was sufficient to just write ruby scripts
s_e has joined #ruby
interact_ has quit [Remote host closed the connection]
<jimmy_birer>
shevy: i dont see anything bad with that
<platzhirsch>
some implementation specifics are not even documented in English, but in Japan
<platzhirsch>
japanese
randomnick_ has joined #ruby
<platzhirsch>
jimmy_birer: don't dig too deep. You might not like what you find
<shevy>
jimmy_birer if you have a lot of time sure, but when one does not it becomes difficult to want to know everything
banister has joined #ruby
<jimmy_birer>
well i understand the need to grasp only what's useful
<shevy>
I didnt read the rubyspec
<jimmy_birer>
when you need to get stuff done
<jimmy_birer>
but i am getting work done in ruby etc
<jimmy_birer>
i want ruby as a hobby language to play with
<platzhirsch>
:o)
banisterfiend is now known as banister`
banister is now known as banisterfiend
mansi has quit [Ping timeout: 252 seconds]
<jimmy_birer>
i am getting work done in php etc*
<benzrf>
D:
<platzhirsch>
You mean getting shit done? Being productive
<jimmy_birer>
yup
<jimmy_birer>
productivity using php / mysql etc (I am a Web Dev)
sriehl has quit [Quit: Leaving...]
RichardBaker has joined #ruby
<jimmy_birer>
might even learn rails
<jimmy_birer>
after this
<platzhirsch>
I feel very uncool with Rails, like the Party is over and I am drinking from the half empty-cups
<shevy>
hehe
ngoldman has quit [Ping timeout: 272 seconds]
<platzhirsch>
no idea what the cool kids are doing that day. Probably I should write Go libraries
ngoldman has joined #ruby
RichardBaker has quit [Client Quit]
OdNairy has quit []
lmadrigal has joined #ruby
RichardBaker has joined #ruby
<Kamuela>
remember that ultimately rails is rooted in ruby
ivanoats has joined #ruby
amacgregor has quit [Read error: Connection reset by peer]
<Kamuela>
at first, i didn't think much of that. but damn, ruby is so awesome that it becomes hard to ignore
amacgregor has joined #ruby
Liquid-- has quit [Quit: Computer has gone to sleep.]
<platzhirsch>
sure, Ruby puts the fun in function
<Kamuela>
haha
<shevy>
except that it uses methods
<Kamuela>
it pretty much has to use methods right
<Kamuela>
since everything is an object
<shevy>
hmm
<platzhirsch>
yeah, I mean the fun in functions of a DSL written in Ruby
<shevy>
there is UnboundMethod
<benzrf>
Kamuela: python has eiao
<Kamuela>
i'm thinking of how Java categorized things though
<Kamuela>
shevy, what is that showing me? can you use instance_method to define a function?
<shevy>
Kamuela, I thought an unbound method was free
<platzhirsch>
wow, 53 people in #go. This language is super hipster stuff
<shevy>
like a function
simoz has joined #ruby
<shevy>
platzhirsch google must die in a fire
<platzhirsch>
oh the board game, nvm
<shevy>
lol
<zigomir>
platzhirsch, why even bother what "cool kids" are using?
<Kamuela>
shevy, ok then yeah ruby does seem to have functions technically
<SloggerKhan>
Maybe go is so amazing it doesn't need people chatting about it in IRC.
<shevy>
Kamuela I am not sure...
<platzhirsch>
875 people, yeah more like it
<shevy>
Kamuela, lemme try to find out
<Kamuela>
zigomir, it's funny you say that. I went looking at Dart the other day...
mrsolo has quit [Quit: This computer has gone to sleep]
banister has joined #ruby
<shevy>
CAN ANYONE HERE GIVE ME OF A TRUE FUNCTION EXAMPLE IN RUBY?
<shevy>
the OF was too much
<benzrf>
shevy: explain
<shevy>
benzrf a function in ruby
<benzrf>
ruby has methods
<Kamuela>
zigomir, and I found that even though I've only been using rails for a week and a half, and ruby for the same time, wow. what a stupid-ass clumsy DSL dart is
<platzhirsch>
zigomir: because I want to constantly move on and not spent my last days coding COBOL
<benzrf>
they are mostly equivalent with functions in most imperative langs
<shevy>
benzrf is there any function in ruby?
<benzrf>
if you consider methods to be functions, then yes
banister is now known as banisterfiend
<platzhirsch>
zigomir: no seriously, I think there are languages which teach overarching concepts and you can learn from them
<shevy>
are methods functions and are functions methods?
thesheff17 has quit [Ping timeout: 252 seconds]
<platzhirsch>
Ruby does not distinguish between methods and functions, does it
havenwood has joined #ruby
<benzrf>
shevy: depends on your definition
<zigomir>
i think you can learn a lot from ruby, it won't do you any bad to learn it and move this knowledge to next platform you'll use
elux has joined #ruby
<Kamuela>
shevy, yeah, as a definition, i tend to think of it the java way: e.g. that functions are procedural and methods are OOP
<Kamuela>
shevy, that methods have mommies and daddies
<zigomir>
platzhirsch, if it can solve your problems of today I wouldn't spent too much time of seeking "the cool one" just yet
nicoulaj has quit [Remote host closed the connection]
jkhwan has quit [Remote host closed the connection]
jkhwan has joined #ruby
Fire-Dragon-DoL has joined #ruby
<platzhirsch>
zigomir: well then I could have sticked savely to Java :D I learned Ruby more out of interest and employabability
nisstyre has joined #ruby
* Eiam
doesn't think Ruby is a good "first language"
* platzhirsch
agrees
<zigomir>
sure... maybe you're right. I'm always for learning new stuff ... but learning or doing something new just for the cause sometimes seems not a good option
<jimmy_birer>
my first was C
talntid has quit []
<Eiam>
I love ruby, its totally my favorite language right now
<Eiam>
but I don't recommend it to new programmers.
<Eiam>
jimmy_birer: mine was C++ ha =/
<platzhirsch>
zigomir: Sorry, I overstated that a bit ;) I was mildly joking
<benzrf>
holy shit Array#uniq is slow
kaspergrubbe has quit [Remote host closed the connection]
<benzrf>
how should i check for repeat elements in an array quickly?
<Eiam>
benzrf: depending on what you are doing you may try doing a set intersection
<zigomir>
Kamuela, so you were turned off by Dart? I've seen some videos online and it looked nice ... but when I tried it, the DartEditor was enough for me to run away :D
danshultz has joined #ruby
agent_white has joined #ruby
mengu has quit [Remote host closed the connection]
<Kamuela>
zigomir, turned off by dart just by the syntax alone. seemed archaic compared to Das Rube
<DouweM>
benzrf: AnyObject#hash is used by Hash
simoz has quit [Ping timeout: 252 seconds]
<platzhirsch>
so, shouldn't we recruit from #ruby-lang in the obvious danger of #go-nuts having more peoples in their room?
<benzrf>
DouweM: hmm
<benzrf>
I am not using hashes though
<Reach>
recruit?
<benzrf>
would it be used by == or by uniq
<jimmy_birer>
Huh
<Reach>
I'm looking for a recruition
<benzrf>
*that is, would either use it
<jimmy_birer>
871 people in #go-nuts
emocakes has quit [Quit: Leaving...]
<jimmy_birer>
lol
<benzrf>
which #golang ->
jkhwan has quit [Ping timeout: 272 seconds]
<jimmy_birer>
Why the hell people would gathet there instead of here btw
<DouweM>
benzrf: Array#== wouldn't use it directly, but it could be some object in the array uses hash as a result of Array#==, which calls obj#== on its elements
duggiefresh has quit [Remote host closed the connection]
<havenwood>
benzrf: [*0...cards.length]
<benzrf>
?
<Kamuela>
what are 3d game engines that are written in ruby?
<havenwood>
benzrf: instead of `(0...cards.length).to_a` do `[*0...cards.length]` and instead of `(0...cards[0].length).to_a` do `[*0...cards[0].length]` etc
kaspergrubbe has joined #ruby
<benzrf>
ok but that's not a significant speed increase
<havenwood>
benzrf: you could try: possible_answers.keep_if
EHLOVader has joined #ruby
<havenwood>
bench #keep_if or #select! over #select
<benzrf>
i already did profiling
<benzrf>
check the link
<benzrf>
>:P
petey has quit [Ping timeout: 272 seconds]
<benzrf>
can I somehow memoize ?
terrellt has quit [Ping timeout: 260 seconds]
h0rrorvacui has joined #ruby
jkhwan has joined #ruby
kevinykchan has joined #ruby
osvico has joined #ruby
<platzhirsch>
Has someone a bit or a lot experience with Ruby development at work in a team? I am really curious how well Ruby does in maintaining a code base
<havenwood>
platzhirsch: seems good to me, but admittedly i've never been on a *big* team
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
gr33n7007h has joined #ruby
gr33n7007h has quit [Client Quit]
simoz has quit [Ping timeout: 268 seconds]
gr33n7007h has joined #ruby
jrhe has joined #ruby
gr33n7007h has quit [Max SendQ exceeded]
<dgarstang3>
What's the best way for ruby to execute and external program and read the output line by line?
mjs2600 has quit [Remote host closed the connection]
<platzhirsch>
that took a while. String formatting with % takes an array. "%s%s" % ("a","b") ... "%s%s" % ["a","b"]
emocakes has joined #ruby
<dgarstang3>
pvdisks.rb:4:in `<<': can't convert IO into String (TypeError)
zigomir has quit [Ping timeout: 268 seconds]
devdazed has quit [Quit: Bye]
tharindu has quit [Ping timeout: 240 seconds]
shawnjgoff has quit [Ping timeout: 246 seconds]
emocakes has quit [Client Quit]
Grantlyk has quit [Ping timeout: 245 seconds]
stringoO has quit [Quit: stringoO]
<Hanmac>
dgarstang3: the block parameter from popen is a IO not a line
gr33n7007h has joined #ruby
gr33n7007h has quit [Max SendQ exceeded]
lethjakm1 has joined #ruby
carlyle has joined #ruby
<Hanmac>
dgarstang3: i think you want this: out = IO.popen( "lsblk -r") { |io| io.read }
kaspergrubbe has quit [Remote host closed the connection]
<dgarstang3>
Hanmac: trying
<dgarstang3>
*sigh* I just don't get ruby. By far the most unintutive programming language in a 17 year career. The { and } .... do I need those if split over multiple lines?
<dgarstang3>
where did 'do' go?
jbw has joined #ruby
<platzhirsch>
dgarstang3: you don't need it, no. But it's a syntactical choice
lethjakman has quit [Ping timeout: 272 seconds]
cek has quit [Ping timeout: 260 seconds]
<platzhirsch>
you can write { } over multiple lines, too. It's just very uncommon to do so
<Hanmac>
dgarstang3: do ... end and {} are very similar ... i prefer {} because do ... end can make problem because the priority of both are different
<dgarstang3>
ok, so now io looks like a object.... how do I get it's value?
<dgarstang3>
got it
carlyle has quit [Ping timeout: 245 seconds]
<dgarstang3>
what about... in python I can do regex grouping. how about in ruby?
nobitanobi has quit [Quit: Leaving]
<dgarstang3>
screw it. i'll split the lines by whitespace.... just as soon as I figure out how