djbkd has quit [Remote host closed the connection]
<Radar>
h00d: Show us an example please.
<h00d>
"Dono da bola": 5,
<h00d>
"Isgalamido": 18,
<h00d>
"Zeh": 20
<Radar>
h00d: sounds like you want a hash.
bricker has quit [Quit: leaving]
grindmodeon has quit [Quit: Leaving.]
FernandoBasso has quit [Quit: leaving]
<h00d>
if "Dono da bola" killed Isgalamido then "Dono da bola": 6
_honning__ has quit [Ping timeout: 244 seconds]
<shevy>
come on h00d
djbkd has joined #ruby
DefV has quit [Ping timeout: 276 seconds]
<shevy>
there aren't so many data structures in ruby
<shevy>
string, array, hash. that's the unholy trinity
DavidDudson has joined #ruby
DefV has joined #ruby
argoneus has quit [Ping timeout: 264 seconds]
Rollabun_ has quit [Remote host closed the connection]
nateberkopec has joined #ruby
AlphaAtom has quit [Ping timeout: 246 seconds]
argoneus has joined #ruby
Rollabunna has joined #ruby
pika_pika has joined #ruby
DavidDudson has quit [Client Quit]
jottr has joined #ruby
<zenspider>
Coraline: hey. what do I need to check out to get equivalent flog scores? I tried canvas-lcm and it only looks like half
<h00d>
yes I am aware, but there is so much information with examples on the internet. The information that I find are very broad
snockerton has quit [Quit: Leaving.]
thomas has quit [Quit: leaving]
MyGreenP1 has quit [Ping timeout: 252 seconds]
bricker has joined #ruby
<zenspider>
h00d: then what are you asking?
thomas has joined #ruby
<shevy>
h00d you should collect useful information into local files, then you will be less dependent on crappy info from the www; in your example, use a hash: hash = Hash.new; now populate it with the keys, set these keys to 0 or whatever other value you have; if you dont know how to add to a hash, here is one example: http://stackoverflow.com/questions/9571768/how-to-add-new-item-to-hash
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davedev24_ has quit []
starless has joined #ruby
<zenspider>
hash = {} ... Hash.new w/o a value is pointless
speakingcode has joined #ruby
icebourg has quit []
DerisiveLogic has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rickmasta has joined #ruby
MyGreenP1 has joined #ruby
fabrice31 has joined #ruby
endash has joined #ruby
zubov has quit [Quit: Leaving]
GaryOak_ has quit [Remote host closed the connection]
mleung has quit [Quit: mleung]
<bricker>
zenspider: I think it's about intent, and to me Hash.new is more clear than {}
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
fabrice31 has quit [Ping timeout: 248 seconds]
<h00d>
ok, thanks
<h00d>
I will study more about.
<shevy>
\o/
<shevy>
he'll be a good ruby hacker in no time
DavidDudson has joined #ruby
juanpaucar has quit [Remote host closed the connection]
RubyIsFullOfRCE has joined #ruby
juanpaucar has joined #ruby
zubov has joined #ruby
krisquigley has joined #ruby
zubov has quit [Client Quit]
ianseyer has joined #ruby
zubov has joined #ruby
<h00d>
what?
DavidDudson has quit [Ping timeout: 248 seconds]
zubov has quit [Client Quit]
<h00d>
shevy: the link you gave me is exactly what needed
DavidDudson has joined #ruby
<h00d>
tks.
zubov has joined #ruby
<shevy>
well, ruby has the "there is more than one way to do things"
Vile` has quit [Remote host closed the connection]
speakingcode has quit [Ping timeout: 265 seconds]
krisquigley has quit [Ping timeout: 246 seconds]
<shevy>
so as a newcomer you have more than one thing to learn eventually
juanpaucar has quit [Ping timeout: 250 seconds]
MyGreenP1 has quit [Ping timeout: 248 seconds]
MXfive has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ismaelga has quit [Remote host closed the connection]
<h00d>
really, but there is always an easier way to do.
Vile` has joined #ruby
speakingcode has joined #ruby
<shevy>
very often
<shevy>
the less code you can get away with is often for the better, unless it would be unreadable
<h00d>
really
alvaro_o has quit [Quit: Ex-Chat]
Azure has joined #ruby
<shevy>
it would make your code more efficient and often easier to change as well lateron
<shevy>
you can think of methods as logical chunks
<shevy>
SELECT * FROM clients WHERE (clients.id = 10) LIMIT 1
<shevy>
h00d so you see, which one is easier to memorize there?
iceyec_ has joined #ruby
iceyec has quit [Read error: Connection reset by peer]
iceyec_ is now known as iceyec
djbkd has quit [Remote host closed the connection]
ChoiKyuSang_ has joined #ruby
<baweaver>
Admittedly I tend to cringe whenever I see something like ``val = {}`` because normally what follows should have been written in the form of map, reduce, or merge instead
djbkd has joined #ruby
mjuszczak has joined #ruby
MXfive has quit [Read error: Connection reset by peer]
zacts has quit [Remote host closed the connection]
wlanboy has quit [Ping timeout: 245 seconds]
<baweaver>
or just straight putting the values in the hash.
zacts has joined #ruby
andrew-l` has joined #ruby
<h00d>
active record
djbkd_ has quit [Read error: Connection reset by peer]
DEA7TH has quit [Ping timeout: 272 seconds]
zacts has quit [Read error: Connection reset by peer]
kblake has quit [Read error: Connection reset by peer]
MXfive has joined #ruby
sn0wb1rd has quit [Ping timeout: 245 seconds]
blenny has quit [Ping timeout: 245 seconds]
djbkd_ has joined #ruby
kblake has joined #ruby
<baweaver>
Though I kinda wish there was a cleaner way to maybe add a value to a hash without breaking flow. hash[:a] = a if a # bugs me a bit
<sevenseacat>
ive written that once or twice - usually when trying to avoid a convoluted inject
<sevenseacat>
the syntax for inject is ugly
kq_away_ has quit [Ping timeout: 245 seconds]
<h00d>
understand, quite interesting is another matter I want to study.
kq_away has joined #ruby
ReK2GnULinuX has joined #ruby
Guest45536 has quit [Ping timeout: 276 seconds]
oo_ has quit [Remote host closed the connection]
ChoiKyuSang has quit [Ping timeout: 245 seconds]
b1nd has quit [Ping timeout: 245 seconds]
<baweaver>
I normally write it as reduce, as that's essentially what you're doing most of the time
<baweaver>
reducing a collection into a single element given a function.
scottstamp has quit [Ping timeout: 245 seconds]
<postmodern>
those using brightbox's ruby-ng ubuntu packages
x1337807x has quit [Ping timeout: 255 seconds]
<baweaver>
or foldL, depends who's been using too much Haskell lately.
<postmodern>
how do you keep the /usr/bin/ruby symlinks pointing to ruby2.0?
bricker has quit [Ping timeout: 240 seconds]
DerisiveLogic has quit [Ping timeout: 245 seconds]
rek2wilds has quit [Remote host closed the connection]
scottstamp has joined #ruby
<baweaver>
. /usr/bin/env ruby
sn0wb1rd has joined #ruby
wlanboy has joined #ruby
<postmodern>
even after setting them with ruby-switch --set ruby2.0, an apt-get upgrade caused the ruby1.9.1 package to reset them
<sevenseacat>
update-alternatives ?
<shevy>
sevenseacat admit it - you dislike .inject because of the most ancient fear of cats not wanting to see a vet with a huge nasty syringe
<postmodern>
sevenseacat, not what I'm asking
blenny has joined #ruby
<sevenseacat>
oh sorry.
jenrzzz has quit [Ping timeout: 264 seconds]
<postmodern>
sevenseacat, how do I make it permanent
<shevy>
a permanent symlink?
<postmodern>
sevenseacat, ruby-switch is basically a shell script around update-alternatives
<sevenseacat>
ah okay
andrew-l has quit [Ping timeout: 245 seconds]
b1nd has joined #ruby
<postmodern>
shevy, yes, one that can survive an apt-get upgrade, where ruby1.9.1 gets upgraded and dpkg re-triggers an update-alternatives
oo_ has joined #ruby
DavidDudson has quit [Read error: Connection reset by peer]
mjuszczak has quit []
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
chintanparikh has quit [Ping timeout: 256 seconds]
RubyIsFullOfRCE has quit [Quit: leaving]
MXfive has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DavidDudson has joined #ruby
djbkd has quit [Remote host closed the connection]
<Coraline>
zenspider: I'm not sure of the makeup and distribution of the OSS version
tkuchiki has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby
ReK2 has joined #ruby
keen__ has quit [Read error: Connection reset by peer]
grindmodeon has joined #ruby
grindmodeon has quit [Max SendQ exceeded]
DavidDudson has quit [Client Quit]
grindmodeon has joined #ruby
Soda has joined #ruby
DavidDudson has joined #ruby
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
keen__ has joined #ruby
<shevy>
aha
mrmargol_ has joined #ruby
<shevy>
postmodern not sure but I assume that perhaps you can add custom hooks to those upgrades
oo_ has quit [Ping timeout: 248 seconds]
casadei has quit [Remote host closed the connection]
zacts has joined #ruby
Lingo has joined #ruby
<postmodern>
shevy, unfortunately i don't know enough about dpkg to do that
Guest54522 has joined #ruby
ebbflowgo has quit [Ping timeout: 244 seconds]
kblake has quit [Remote host closed the connection]
centrx has joined #ruby
<pietr0>
postmodern: i'd file a bug on debian
Wmaddox has joined #ruby
Lingo has quit [Quit: (null)]
delianides has joined #ruby
Megtastique has joined #ruby
davispuh is now known as [
MatthewsFace has joined #ruby
[ is now known as Guest13585
pietr0 has quit [Quit: pietr0]
ianseyer has quit [Ping timeout: 264 seconds]
ebbflowgo has joined #ruby
Guest54522 has quit [Quit: This computer has gone to sleep]
baweaver has quit [Remote host closed the connection]
dblessing has joined #ruby
jeramy_s has joined #ruby
existensil has quit [Ping timeout: 255 seconds]
Guest13585 is now known as davispuh
zachrab has joined #ruby
failshell has joined #ruby
robustus has quit [Ping timeout: 264 seconds]
Yzguy has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
robustus|Off has joined #ruby
robustus|Off is now known as robustus
jenrzzz has joined #ruby
Sawbones has joined #ruby
pika_pika has quit [Ping timeout: 245 seconds]
zachrab has quit [Ping timeout: 240 seconds]
amdbcg has joined #ruby
failshell has quit [Ping timeout: 245 seconds]
lessless has joined #ruby
icebourg has joined #ruby
pengin has quit [Remote host closed the connection]
Wmaddox has quit [Ping timeout: 246 seconds]
wallerdev has quit [Quit: wallerdev]
x77686d has quit [Quit: x77686d]
lidenskap has quit [Remote host closed the connection]
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pengin has joined #ruby
jottr has quit [Read error: Connection reset by peer]
Igorshp has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
starless has quit [Quit: Leaving]
pika_pika has joined #ruby
_honning__ has joined #ruby
oo_ has joined #ruby
charliesome has quit [Ping timeout: 256 seconds]
sohrab has joined #ruby
baweaver has quit [Remote host closed the connection]
iteratorP has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
teddyp1cker has joined #ruby
oo__ has joined #ruby
thumpba_ has quit [Ping timeout: 276 seconds]
casadei has joined #ruby
Akagi201 has joined #ruby
oo_ has quit [Ping timeout: 250 seconds]
grindmodeon has quit [Quit: Leaving.]
pika_pika has quit [Ping timeout: 245 seconds]
Sawbones has quit [Remote host closed the connection]
teddyp1cker has quit [Ping timeout: 246 seconds]
x1337807x has joined #ruby
pengin has quit [Remote host closed the connection]
Sawbones has joined #ruby
bruno- has joined #ruby
duncannz has joined #ruby
Megtastique has quit [Read error: Connection reset by peer]
bruno- has quit [Ping timeout: 264 seconds]
Megtastique has joined #ruby
DarthGandalf has quit [Ping timeout: 245 seconds]
CaffeineShot has quit [Quit: Leaving]
rhg135 has quit [Remote host closed the connection]
jeramy_s has joined #ruby
havenwood has joined #ruby
rodfersou has quit [Quit: leaving]
baweaver has joined #ruby
Renich has joined #ruby
ftj has joined #ruby
mrmargo__ has joined #ruby
mrmargol_ has quit [Read error: Connection reset by peer]
djbkd_ has quit [Remote host closed the connection]
djbkd has joined #ruby
Deele has quit [Ping timeout: 256 seconds]
apoplexy has quit [Quit: Check out the following topic specific channels: ##investments ~ ##accounting ~ ##internetmarketing :]]
RegulationD has joined #ruby
Wmaddox has joined #ruby
vivekananda has quit [Quit: Leaving]
DarthGandalf has joined #ruby
jottr_ has joined #ruby
thatslifeson_ has joined #ruby
x77686d has joined #ruby
iasoon has quit [Ping timeout: 245 seconds]
Wmaddox has quit [Client Quit]
x77686d has quit [Client Quit]
jottr has quit [Ping timeout: 245 seconds]
danzilio has quit [Quit: Baiii!]
baweaver has quit [Remote host closed the connection]
_djbkd has joined #ruby
atom3 has joined #ruby
sankaber has joined #ruby
djbkd has quit [Ping timeout: 255 seconds]
atom3_ has quit [Ping timeout: 276 seconds]
RegulationD has quit [Ping timeout: 248 seconds]
Conner_A has quit [Ping timeout: 245 seconds]
fedexo has joined #ruby
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
weaksauce has quit [Ping timeout: 245 seconds]
gsd_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ebbflowgo has quit [Quit: ebbflowgo]
<dorei>
Is active_support/inflector the easy way to go if I just want to pluralize strings but not in a naive way (eg. when adding a final 's' is not enough, like entity => entities)?
<sevenseacat>
its certainly the way to go in a rails app, not sure about outside rails
iotouch has joined #ruby
<dorei>
i'm using ruby off rails :) but I think inflector can be required anywhere
zubov has quit [Remote host closed the connection]
sevvie has quit [Ping timeout: 264 seconds]
weaksauce has joined #ruby
sevvie has joined #ruby
Sawbones has quit [Remote host closed the connection]
x77686d has joined #ruby
GeorgeThompson has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
QualityAddict has joined #ruby
kblake has joined #ruby
mrmargo__ has quit [Remote host closed the connection]
Sawbones has joined #ruby
lidenskap has joined #ruby
x77686d has quit [Ping timeout: 250 seconds]
pontiki has joined #ruby
<pontiki>
hallo o/
mary5030 has joined #ruby
kblake has quit [Ping timeout: 276 seconds]
chintanparikh has joined #ruby
<chintanparikh>
How would I use gets.chomp ignoring all data in ARGV?
<Radar>
chintanparikh: !code
<Radar>
chintanparikh: Please stop asking questions without code.
lidenskap has quit [Remote host closed the connection]
<chintanparikh>
I can't figure out why it's trying to open a file called 5678
ebot1 has joined #ruby
kblake has joined #ruby
<pontiki>
i don't know either. what's RTPSocket?
<chintanparikh>
pontiki: I'll add it to the gist. But it was working fine when I hard coded the values in instead of passing them in from the command line
<chintanparikh>
sevenseacat: Yup, but now the file only contains command = gets.chomp
<chintanparikh>
And I'm still getting the error, which makes no sense
<sevenseacat>
"Returns (and assigns to $_) the next line from the list of files in ARGV (or $*), or from standard input if no files are present on the command line."
lidenskap has joined #ruby
<sevenseacat>
so Kernel.gets *does* read from argv
zachrab has quit [Remote host closed the connection]
<chintanparikh>
Yup that's what I thought
<chintanparikh>
How would I stop that?
<pontiki>
well that is interesting
<pontiki>
use STDIN.gets instead, i guess
headius has left #ruby [#ruby]
<chintanparikh>
Sweet, that solved that error
<chintanparikh>
Now getting another
<chintanparikh>
client.rb:10:in `parse': undefined method `connect' for nil:NilClass (NoMethodError) from client.rb:30:in `block in <main>' from client.rb:27:in `loop' from client.rb:27:in `<main>'
<chintanparikh>
I'll add it to the gist
<pontiki>
thanks, sevenseacat, i did not know Kernel.gets did that
<sevenseacat>
neither did i
<chintanparikh>
I'm getting that error after I type in connect (so command = "connect")
mary5030 has quit [Remote host closed the connection]
reinaldob has quit [Ping timeout: 248 seconds]
<sevenseacat>
trying to work out how to get a link to the doc in dash
<pontiki>
what have you tried to solve that so far, chintanparikh
krisquigley has quit [Ping timeout: 245 seconds]
juanpaucar has quit [Ping timeout: 256 seconds]
<chintanparikh>
Nevermind, that was a stupid error
<sevenseacat>
pontiki: he posted it here :D
ringarin has quit [Ping timeout: 246 seconds]
MyGreenP1 has quit [Ping timeout: 265 seconds]
oo_ has joined #ruby
Feyn has joined #ruby
davispuh has quit [Remote host closed the connection]
oo__ has quit [Ping timeout: 264 seconds]
jcp has joined #ruby
<pontiki>
;)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
saturnflyer has quit []
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Akagi201 has quit [Remote host closed the connection]
<dorei>
it certainly conveys the feeling that something went wrong :D
<weaksauce>
that's pretty awesome
DavidDudson has quit [Ping timeout: 240 seconds]
lorn has joined #ruby
Guest63002 has quit [Ping timeout: 255 seconds]
<ebot1>
.quit
DanKnox has joined #ruby
ebot1 has quit [Quit: Leaving.]
gsd has joined #ruby
Akagi201 has quit [Remote host closed the connection]
grindmodeon has joined #ruby
orionstein has joined #ruby
cntrx has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
aytch has joined #ruby
MyGreenP1 has joined #ruby
Akagi201 has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
towski_ has quit [Remote host closed the connection]
swgillespie has joined #ruby
DuoSRX has quit [Quit: Connection closed for inactivity]
towski_ has joined #ruby
failshell has joined #ruby
jeramy_s has joined #ruby
Renich has quit [Quit: leaving]
endash has quit [Quit: endash]
ujihisa has joined #ruby
kblake has quit [Remote host closed the connection]
dfinninger has joined #ruby
zzing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Yzguy has quit [Quit: I'm sleeping, go away.]
Kovensky has joined #ruby
swgillespie has quit [Client Quit]
towski_ has quit [Ping timeout: 264 seconds]
failshell has quit [Ping timeout: 245 seconds]
xybre has joined #ruby
swgillespie has joined #ruby
swgillespie has quit [Client Quit]
Gnubie_ has joined #ruby
cntrx has quit [Quit: Shutting down, Please wait...]
sindork has joined #ruby
chintanparikh has quit [Ping timeout: 256 seconds]
jeramy_s has quit [Quit: Peace out!]
SirFunk has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Akagi201 has quit [Remote host closed the connection]
grindmodeon has quit [Quit: Leaving.]
philtr has joined #ruby
sweeper has joined #ruby
grindmodeon has joined #ruby
Akagi201 has joined #ruby
A205B064 has quit [Ping timeout: 276 seconds]
deric_skibotn has quit [Ping timeout: 252 seconds]
brixen has joined #ruby
lidenskap has quit [Remote host closed the connection]
freerobby has joined #ruby
lidenskap has joined #ruby
jeromelanteri has joined #ruby
jeromelanteri_ has joined #ruby
swgillespie has joined #ruby
swgillespie has quit [Client Quit]
mitchellhenke has joined #ruby
zzing has joined #ruby
oo_ has quit [Ping timeout: 248 seconds]
oo__ has joined #ruby
jeromelanteri has quit [Ping timeout: 256 seconds]
pwnz0r has joined #ruby
<vulix>
Something Im confused about as I learn more about Ruby - gems are not platform independent?
<sevenseacat>
not the ones with native extensions.
<sevenseacat>
the rest are.
ss__ has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
<vulix>
Ok so if I write a gem that is solely contains code that should run natively in the mri, im platform independent
<sevenseacat>
I think we have different definitions of the word 'native'
ramfjord has quit [Ping timeout: 252 seconds]
<eam>
not all pure ruby gems are platform independent
icebourg has quit []
h00d has quit [Read error: Connection reset by peer]
<vulix>
So I'm not sure if I have this right, let me know if it is - the problem with writing a rails app on windows and deploying on linux might be some of the gems, like the sqlite3 gem, have a windows-specific version and if I deploy on linux the app would be bundled with the win-specific version and it wouldnt go out and fetch the linux one?
hazelux has joined #ruby
bruno- has joined #ruby
lemur has joined #ruby
zachrab has joined #ruby
amdbcg has quit [Ping timeout: 245 seconds]
mary5030 has joined #ruby
<eam>
vulix: you would re-bundle or re-gem install on linux
<eam>
many developers do rails development on a different system/architecture than they deploy on
<sevenseacat>
they shouldnt IMO, but anyway
multi_io has quit [Ping timeout: 245 seconds]
<eam>
sevenseacat: eh why so judgey
<sevenseacat>
because it leads to tricky little problems
Akagi201 has quit [Remote host closed the connection]
<sevenseacat>
yes your code works beautifully on your OSX machine, with its case insensitive file system and other crap
<sevenseacat>
deploy to linux... *many explosions*
Akagi201 has joined #ruby
braincrash has joined #ruby
braincrash is now known as braincras
<eam>
sevenseacat: well I presume the ci/staging/integration and production environments will be the same architecture
<eam>
but who cares where the editor is run?
<sevenseacat>
sure they are, but now you're putting a lot more credence in the test suite than it probably deserves
teddyp1cker has joined #ruby
multi_io has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
hgl has quit [Max SendQ exceeded]
hgl has joined #ruby
zachrab has quit [Ping timeout: 252 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ss__ has joined #ruby
willharrison has joined #ruby
teddyp1cker has quit [Ping timeout: 255 seconds]
yfeldblum has quit [Remote host closed the connection]
nettoweb has joined #ruby
<sevenseacat>
i'm a little cynical when it comes to these things - I've seen devs do things like install beta versions of software to get the functionality they want on their machines, and then gasp in shock when the code they wrote against the beta version doesnt work anywhere else
freerobby has quit [Quit: Leaving.]
<eam>
well if it doesn't shake out in staging there's no reason to think it'll shake out on the dev laptop either
<c-c>
KISS
<eam>
but I don't know why I'm arguing this point since I do everything in linux
amdbcg has joined #ruby
freerobby has joined #ruby
<sevenseacat>
i'd prefer to do everything in linux, but now i have a company-mandated macbook
<eam>
not because I'm afraid of differences, more because OSX is just an absurdly poor environment
<eam>
sevenseacat: me too
MyGreenP1 has quit [Ping timeout: 256 seconds]
<eam>
but it runs plenty of VMs
aytch has quit [Ping timeout: 245 seconds]
RegulationD has joined #ruby
lidenskap has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
duncannz has joined #ruby
mistermocha has quit [Ping timeout: 255 seconds]
dorei has quit [Remote host closed the connection]
_honning__ has quit [Ping timeout: 265 seconds]
vim_shimm has joined #ruby
jenrzzz has joined #ruby
Megtastique has joined #ruby
seanmarcia has joined #ruby
arescorpio has quit [Excess Flood]
oo_ has joined #ruby
SirFunk has quit [Ping timeout: 245 seconds]
weemsledeux has joined #ruby
oo_ has quit [Read error: Connection reset by peer]
duncannz has quit [Quit: Leaving]
duncannz has joined #ruby
ramfjord has joined #ruby
oo__ has joined #ruby
Akagi201 has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
bMalum has joined #ruby
Akagi201 has quit [Remote host closed the connection]
d10n-work has joined #ruby
sevvie has quit [Ping timeout: 240 seconds]
bMalum has quit [Client Quit]
sevvie has joined #ruby
iotouch has quit [Quit: This computer has gone to sleep]
SirFunk has joined #ruby
freerobby has quit [Quit: Leaving.]
fabrice31 has joined #ruby
endash has joined #ruby
dfinninger has quit [Remote host closed the connection]
Megtastique has quit []
charliesome has joined #ruby
Alina-malina has quit [Ping timeout: 272 seconds]
jcp has quit [Quit: No Ping reply in 180 seconds.]
fabrice31 has quit [Ping timeout: 272 seconds]
jcp has joined #ruby
icebourg has joined #ruby
gf3 has joined #ruby
mary5030 has quit [Remote host closed the connection]
pontiki has quit [Ping timeout: 265 seconds]
brixen has quit [Ping timeout: 245 seconds]
aphprentice_ has joined #ruby
lessless has quit [Ping timeout: 272 seconds]
juanpaucar has joined #ruby
krisquigley has joined #ruby
lidenbrock has joined #ruby
icebourg has quit [Ping timeout: 246 seconds]
<tubuliferous>
I want to read a flat file into a string, then remove the header and all "\n" characters. What's a straightforward and fast way to do that?
Akagi201 has joined #ruby
<tubuliferous>
What I'm doing right now is neither straightforward nor fast...
<tubuliferous>
basically I'm reading line by line
WildBamboo-Josh has joined #ruby
lidenbrock has quit [Client Quit]
pwnz0r has quit [Remote host closed the connection]
Akagi201 has quit [Remote host closed the connection]
pwnz0r has joined #ruby
mistermocha has joined #ruby
pontiki has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Nilium>
So, game programming, graphics programming, phone apps, desktop apps, server-side crap that isn't just a fancy web server, etc.
<pipework>
Like, application isn't exactly a great word to use in this context.
<pipework>
Nilium: I'd argue the fanciness isn't all that great anyways.
<weaksauce>
existensil I wouldn't go so far to say "extremely well supported" but it's quite nice
<Nilium>
The fanciness is mostly boring from what I've seen since it's just different ways of displaying HTML and CSS.
casadei has quit [Remote host closed the connection]
<Nilium>
I am rapidly approaching the point where I feel like I need to learn Erlang.
<existensil>
compared to any other ruby GUI tools :-P
<weaksauce>
fair :D
<Nilium>
wxRuby is dead as a rock, so you can at least ignore that.
<pipework>
I don't mind browsers, or HTTP, if the problem doesn't beg to not be over HTTP. I mean, websockets are nice, but the browser sandboxed environment is one I don't have interest in working on more than occasionally. I'd not want to work on one constantly if I felt like it was either a pile of shit or becoming that.
<weaksauce>
Nilium that's probably the first time that sentence has been uttered about erlang
<pipework>
weaksauce: definitely not
tkuchiki has quit [Read error: Connection reset by peer]
tkuchiki_ has joined #ruby
<pipework>
Lots of times when you hear the phrase "embarassingly parallel", it's followed by utterances of "I should learn erlang" or "I know erlang, we should use that."
<Nilium>
I basically end up writing stuff that needs to be heavily-distributed but communicating somehow, and Erlang's kind of up there for those jobs
<weaksauce>
I kid pipework... but it's still fringe for most purposes like haskell or prolog
<pipework>
Yeah, so most things have parallelism and concurrency, but you either need to select or create a mechanism for distribution of work.
<existensil>
as someone who already knows go, you think it doesn't fill the same void really?
<pipework>
existensil: It doesn't.
<Nilium>
No. Go's good at single-process concurrency.
<existensil>
I know its concurrency is supposed to be awesome
<pipework>
I mean, it can with libraries and stuff to support all the features in erlang.
<pipework>
They have channels, we have actors.
<existensil>
i guess, yeah, I haven't heard anything about distributing workloads across many machines with go
<pipework>
With either we can make the other though.
<Nilium>
Communicating across processes is still a case of picking and choosing how you do it, be it messaging via ZeroMQ or using some sort of RPC or what have you
<pipework>
weaksauce: I mean, it's not a popular language, but it's more prevalent in closed source systems than you might assume.
anaeem1_ has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
sindork has quit [Ping timeout: 264 seconds]
<pipework>
I'd dare say a lot more than haskell is. Prolog probably is more prevalent as whale. I'm not personally sure on that one.
anaeem1 has joined #ruby
<pipework>
However, the next new language I learn will be ocaml.
<pipework>
Or rust.
gf3 has quit [Ping timeout: 246 seconds]
<Nilium>
Erlang's thing, for me, is that the VM and programs can be distributed and communicate across a cluster and it's just built for that.
<weaksauce>
the problems prolog solves it can solve well.
<existensil>
Nilium, pipework ... so, is IPC mechanisms built into erlang? are they integrated into it's concurrency patterns?
<Nilium>
Basically yes.
<pipework>
existensil: Yes.
<pipework>
Literally, a message pass.
<weaksauce>
but It's not a great programming language
<existensil>
jeez, maybe I should check out some erlang
<pipework>
weaksauce: What isn't?
<existensil>
ugh
<weaksauce>
prolog
<Nilium>
There's also Elixir, not sure if that's actually worth learning over Erlang.
<pipework>
weaksauce: I don't know that I could agree if I'm being intellectually honest.
<Nilium>
Same VM, so at least it's a single target.
<pipework>
Nilium: Actually, there's *also* Elixir. Not just instead.
zzing has joined #ruby
<weaksauce>
pipework with the full statement or just the last bit?
<pipework>
Because Elixir emits more efficient bytecode than erlang does.
<Nilium>
Interesting
<pipework>
weaksauce: That prolog isn't a great programming language.
<Nilium>
At any rate, I just see Go and Erlang and so on as being different approaches to different problems.
bim has joined #ruby
<weaksauce>
the full statement was the problems prolog solves it can solve well but It's not a great programming language
failshell has joined #ruby
<Nilium>
If I want a single binary that only needs to know about itself, Go's pretty great.
bim is now known as Guest41804
<pipework>
Yeah, you can make it entirely cross-platform and not even link any libraries dynamically, even the linux.so
<Nilium>
There's a lot to be said for easy cross-compiling
<pipework>
The tooling for that is great. IIRC, you can do the same with erlang with the exception of some dynamic library loading for, iirc, system call symbols.
<Nilium>
It tends to get brushed over, but being able to build a binary for Linux on my Mac and scp it over to where it needs to be is pretty swell.
<pipework>
But go is pretty cool. They ship with gofmt which is great.
<pipework>
I disagree with some of it, but at least there's a single source of truth on how to format go.
x1337807x has joined #ruby
<Nilium>
Yeah, it's not perfect, but consistency goes a long way.
<Nilium>
It's definitely not the language for all problems, anyway. Kind of worrying that some people try to make it that.
<pipework>
There's nothing I dislike about Go that's objective. There's just more that I like about erlang that I believe is objective.
<Nilium>
I can believe that.
gf3 has joined #ruby
<pipework>
Erlang is slow on a single-process perspective.
seanmarcia has quit [Excess Flood]
seanmarcia has joined #ruby
Guest41804 has quit [Ping timeout: 246 seconds]
<pipework>
But if you have parallel work, the real time you save by using erlang can crunch hours of single-threaded embarrassingly parallel work can be enormous.
vim_shimm has quit [Ping timeout: 256 seconds]
<pipework>
Especially if you've got more than one node.
<pipework>
It's really fun to marvel at the collective 'man hours' versus realtime.
<pipework>
Koolaids: Some people's clients show previews, nice rick roll attempt.
<Nilium>
I just don't click anything with multiple exclamation marks.
<Nilium>
I wonder if I could just set up a fleet of 32 Raspberry Pi 2s and if that'd handle Erlang well.
<pipework>
Nilium: You've probably missed out on boatloads of free penis enlargement offers.
<pipework>
Nilium: I don't know if erlang has support for arm.
kyrylo has joined #ruby
<Nilium>
It looks like it might, but I'm googling specifically for arm64, so it's a little iffy.
vim_shimm has joined #ruby
<Nilium>
Granted I could just try building it on my Pi 2.
tubuliferous_ has joined #ruby
renier has joined #ruby
last_staff has joined #ruby
dudedudeman has quit [Ping timeout: 256 seconds]
<Nilium>
The idea of getting a cluster of Pis going just seems neat to me since it'd be an interesting way to get a low-power cluster for various things.
<Nilium>
Not sure what those things would be yet, so that's the hard part.
NoNMaDDeN has joined #ruby
dudedudeman has joined #ruby
hmsimha has joined #ruby
greenbagels has joined #ruby
zorak8 has joined #ruby
<pipework>
Nilium: You could always implement your own BEAM
<pipework>
On arm64.
NoNMaDDeN has quit [Ping timeout: 272 seconds]
<pipework>
My jokes aren't funny.
yfeldblum has joined #ruby
last_staff has quit [Quit: last_staff]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
icebourg has joined #ruby
icebourg has quit [Max SendQ exceeded]
mgberlin has quit [Remote host closed the connection]
ianseyer has quit [Ping timeout: 256 seconds]
lidenskap has quit [Remote host closed the connection]
Alina-malina has joined #ruby
SpicyMagpie has joined #ruby
zachrab has joined #ruby
SpicyMagpie has quit [Read error: Connection reset by peer]
A205B064 has joined #ruby
fedexo has quit [Read error: Connection reset by peer]
tenseiten has quit [Read error: Connection reset by peer]
RegulationD has quit [Ping timeout: 250 seconds]
Lingo has quit [Client Quit]
<Radar>
And I've been doing Ruby for about 10 years of that 15... and I just tried to define a method called "send" but caught myself before I could do any real damage.
seitensei has joined #ruby
<sevenseacat>
hehe
ponga has joined #ruby
<pipework>
But you can do that as long as you don't define __send__ too.
wwwbukolaycom has joined #ruby
<pipework>
IIRC, the bare minimum is #object_id and #__send__ and a couple other __-ish methods
Spami has quit [Quit: This computer has gone to sleep]
<Koolaids>
yeah ruby seems nice
<Koolaids>
i dig it
<pipework>
Koolaids: The big thing that python doesn't seem to ever want to do is have powerful lambdas.
<pipework>
List comprehensions and other fun things with their weak lambdas seem to keep them happy enough.
Koolaids has quit [Remote host closed the connection]
<apeiros>
I guess you could qualify that as the basic minimum. I still wish for an external introspection class, though.
* wwwbukolaycom
hi
narcan has joined #ruby
werelivinginthef has joined #ruby
<pipework>
apeiros: I don't think that's even the minimum. I think you can drop everything but __send__ and __id__ if #object_id is no longer the necessary method for that.
<apeiros>
pipework: afaik ruby does not require any of those methods either
<apeiros>
it'll just be hard to do a lot of stuff since most code assumes them to be present
lidenskap has joined #ruby
<pipework>
apeiros: Yeah? I guess you'd just have to trade off the ability to send messages or play with objectspace, respectively.
<apeiros>
I actually wonder how irb/pry do an inspect on a basicobject
<apeiros>
given that it lacks #class
<apeiros>
and missing #instance_variables certainly doesn't make it easier either
sinkensabe has joined #ruby
<apeiros>
well, gotta commute, cya :)
<pipework>
:D
<pipework>
apeiros: Thanks for the extra info.
<pipework>
I haven't needed a cleanroom-style object in quite a long time.
teddyp1cker has quit [Remote host closed the connection]
werelivinginthef has quit [Ping timeout: 255 seconds]
greenbagels has quit [Read error: Connection reset by peer]
SpicyMagpie has joined #ruby
tagrudev has joined #ruby
Filete has joined #ruby
grindmodeon has joined #ruby
SOLDIERz has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<workmad3>
pagios: that's the line you think is at issue, I got that
<workmad3>
pagios: but that line isn't referenced in the stack trace of your error
<pagios>
o
<workmad3>
pagios: making me suspect that the error is somewhere completely different
elaptics_away is now known as elaptics
Zai00 has joined #ruby
antgel has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
krz has joined #ruby
dumdedum has joined #ruby
ParmesanCaesar has quit [Ping timeout: 264 seconds]
chridal has quit [Ping timeout: 265 seconds]
xcesariox has joined #ruby
<aawe>
Would it be possible to create a NilClass initializer?
djbkd has joined #ruby
<aawe>
or is NilClass just a behavoir class around a null pointer, without any capacity for storing instance variables?
gmas has quit [Ping timeout: 245 seconds]
bim has joined #ruby
weaksauce has quit [Read error: Connection reset by peer]
bim is now known as Guest96612
<workmad3>
aawe: you can monkey-patch NilClass with methods that include ivar usage
<aawe>
workmad3: I want to add "@_nil_caller = caller_locations(1,1)[0]" to the initializer to store where the nil value was created
kyrylo has quit [Read error: Connection reset by peer]
<workmad3>
aawe: but you can't sensibly add an initialize constructor to NilClass... 'nil' is created a single time during Ruby's startup, it isn't recreated every time you access 'nil'
vulix has quit [Ping timeout: 246 seconds]
<aawe>
that's a shame
<sevenseacat>
nil is a singleton, isnt it
<sevenseacat>
just like true and false
<workmad3>
sevenseacat: I'd call nil, true and false globals personally... and NilClass, TrueClass and FalseClass are singleton classes :)
<sevenseacat>
ah hah okay
<aawe>
it would be great to get some info where a nil was "created" anyway
<aawe>
instead of where it was attempted to be used as something else
lloyd is now known as Lloyd
yfeldblum has joined #ruby
<workmad3>
aawe: except it isn't created apart from when ruby starts
thatslifeson_ has joined #ruby
<aawe>
workmad3: that could be changed
Guest96612 has quit [Ping timeout: 244 seconds]
<workmad3>
aawe: not without a significant change to the ruby runtime, both in code and in semantics of nil
<aawe>
significant how? it's just a few if statements ;)
<aawe>
I see your point but I think it would be feasible
<aawe>
and it would be great to see where I got a nil instead of a null pointer exception
yfeldblu_ has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
<workmad3>
aawe: the runtime short-circuits a lot of stuff around 'nil' because it's always a single instance that it can check very quickly and easily
Conner__ has quit [Ping timeout: 245 seconds]
<workmad3>
aawe: so it would be significant because *all* of that optimization would need to be pulled out
bobbrez has joined #ruby
kyrylo has joined #ruby
ponga has quit [Remote host closed the connection]
ponga has joined #ruby
<workmad3>
aawe: and semantically, you'd be altering the idea that there's only a single 'empty reference' value, and replacing it with the idea that every 'nil' is somehow special and newly created... and what value would you then use if you *couldn't* create a new 'nil' instance? such as in OOM situations...
yfeldblum has quit [Ping timeout: 245 seconds]
mlev has quit [Read error: Connection reset by peer]
DavidDudson has joined #ruby
ahmetkapikiran has joined #ruby
sevvie has quit [Ping timeout: 246 seconds]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sevvie has joined #ruby
zachrab has joined #ruby
Violentr has quit [Ping timeout: 264 seconds]
Violentr has joined #ruby
ponga has quit [Ping timeout: 256 seconds]
ponga has joined #ruby
mengu has quit [Remote host closed the connection]
zachrab has quit [Ping timeout: 245 seconds]
icebourg has joined #ruby
elev has joined #ruby
<elev>
someone here on?
elev is now known as anonym
<anonym>
s
<apeiros>
no, yes, maybe
<apeiros>
just ask your question and you'll see ;-)
hazelux has joined #ruby
icebourg has quit [Ping timeout: 245 seconds]
blackmesa has joined #ruby
astrobunny has quit [Remote host closed the connection]
PierreRambaud has quit [Remote host closed the connection]
ahmetkapikiran_ has joined #ruby
SOLDIERz has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
ahmetkapikiran has quit [Ping timeout: 272 seconds]
ahmetkapikiran_ is now known as ahmetkapikiran
colorisco has joined #ruby
robbyoconnor has joined #ruby
anonym has quit [Ping timeout: 264 seconds]
marr has joined #ruby
hazelux has quit [Ping timeout: 264 seconds]
lidenskap has quit [Remote host closed the connection]
mlev has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
Pupeno has quit [Quit: Leaving...]
oo__ has quit [Remote host closed the connection]
erts has joined #ruby
iamninja_ has quit [Ping timeout: 276 seconds]
DavidDudson has joined #ruby
<aawe>
According to my client there are 898 users here
teddyp1cker has quit []
oo_ has joined #ruby
<Myrl-chan>
aawe: lol
Igorshp has joined #ruby
oo_ has quit [Remote host closed the connection]
ujjain has joined #ruby
astrobunny has joined #ruby
Pupeno has joined #ruby
kyrylo has quit [Quit: Konversation terminated!]
polarking has joined #ruby
<pagios>
x["topic_arn"] =~ /#{topic}/ means find if x[topic_arn] contains a topic string?
Cust0sL1men has joined #ruby
kyrylo has joined #ruby
tkuchiki_ has quit [Read error: Connection reset by peer]
ujjain has quit [Changing host]
ujjain has joined #ruby
tkuchiki has joined #ruby
<certainty>
ruboto: tell me a joke
kyrylo has quit [Client Quit]
<aawe>
certainty: this kills the bot
MXfive has joined #ruby
<aawe>
pagios: yes
fabrice31_ has quit [Remote host closed the connection]
duncannz has quit [Ping timeout: 240 seconds]
<aawe>
pagios: but x["topic_arn"].contains?(topic) would be better in this case
fabrice31 has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
nfk has joined #ruby
edwinvdgraaf has joined #ruby
RTG` has quit [Ping timeout: 272 seconds]
<aawe>
also x["topic_arn"] =~ /#{topic}/ is "failsy" if it begins with the topic ("monkeys" =~ /mon/ => 0)
<pagios>
awwaiid: if (x["endpoint"] == @subscriberARN && x["topic_arn"].contains?(topic)) then ... <-- the == is ok too ? or use .equal?
vulix has joined #ruby
tkuchiki has quit [Remote host closed the connection]
joonty has joined #ruby
colorisco has quit [Ping timeout: 245 seconds]
<aawe>
wait it should be .include?
<vulix>
anyone ever integrate ruby and apache solr?
oo_ has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
<pagios>
aawe: i want to compaure if the strings are equal and if topic var is contained in x["topic_arn"]
RTG` has joined #ruby
<pagios>
if (x["endpoint"].eql?(@subscriberARN) && x["topic_arn"].contains?(topic)) then
juanpaucar has joined #ruby
krisquigley has joined #ruby
<aawe>
pagios: it should be .include?
<pagios>
not there yet, it is not matched even though i am sure the strings are equal
mengu has quit [Remote host closed the connection]
<pagios>
.include instead of .contains you mean
tkuchiki has joined #ruby
<aawe>
yes
<aawe>
you rarely want to use .equals, use .eql or ==
codecop has quit [Remote host closed the connection]
edwinvdg_ has joined #ruby
<pagios>
if (x["endpoint"] == @subscriberARN && x["topic_arn"].include?(topic)) then
<pagios>
still it does not match
huddy has joined #ruby
joonty has quit [Read error: Connection reset by peer]
juanpaucar has quit [Ping timeout: 250 seconds]
colorisco has joined #ruby
quimrstorres has joined #ruby
krisquigley has quit [Ping timeout: 250 seconds]
psmolen has joined #ruby
edwinvdgraaf has quit [Ping timeout: 252 seconds]
quimrstorres has quit [Remote host closed the connection]
kyrylo has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
lordkryss has joined #ruby
iamninja_ has joined #ruby
quimrstorres has joined #ruby
nettoweb has joined #ruby
arup_r has joined #ruby
merqlove has joined #ruby
maasha has joined #ruby
<apeiros>
aawe, pagios: topic could contain regex special characters. so .include?(topic) is not necessarily the same.
iteratorP has quit [Remote host closed the connection]
leafybasil has quit [Remote host closed the connection]
lanemeyer has quit []
leafybasil has joined #ruby
wwwbukolaycom has joined #ruby
baash05 has quit [Quit: Leaving.]
icebourg has quit [Ping timeout: 264 seconds]
khebbie has joined #ruby
chridal has quit [Ping timeout: 265 seconds]
selu has quit [Read error: Connection reset by peer]
failshell has quit [Ping timeout: 245 seconds]
joonty has joined #ruby
ralku has joined #ruby
sigurding has quit [Quit: sigurding]
lidenskap has joined #ruby
maasha has quit [Ping timeout: 246 seconds]
chthon has quit [Ping timeout: 244 seconds]
fabrice31_ has quit [Remote host closed the connection]
iteratorP has joined #ruby
lanemeyer has joined #ruby
Myrl has joined #ruby
Myrl-chan has quit [Killed (kornbluth.freenode.net (Nickname regained by services))]
Myrl is now known as Myrl-chan
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DavidDudson has joined #ruby
lidenskap has quit [Ping timeout: 255 seconds]
chridal has joined #ruby
antgel has quit [Ping timeout: 252 seconds]
Guest92947 has joined #ruby
Guest92947 has quit [Excess Flood]
antgel has joined #ruby
Juanchito has joined #ruby
davedev24_ has joined #ruby
plutonic has joined #ruby
duncannz has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
fabrice31 has joined #ruby
bruno- has joined #ruby
mist__ is now known as mist
chthon has joined #ruby
tubuliferous_ has quit [Ping timeout: 276 seconds]
serivich has quit [Ping timeout: 272 seconds]
arup_r_ has joined #ruby
User458764 has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
arup_r has quit [Ping timeout: 245 seconds]
bruno- has quit [Ping timeout: 252 seconds]
arup_r_ has quit [Client Quit]
arup_r has joined #ruby
AlphaAtom has joined #ruby
PeopleLaugh has joined #ruby
<PeopleLaugh>
apeiros: can you get a chick and get laid? seriously?
iteratorP has quit [Remote host closed the connection]
<wasamasa>
...
<PeopleLaugh>
no he cant
<wasamasa>
PeopleLaugh: your nick looks like you need the affirmation for your crappy trolling
<PeopleLaugh>
whatever do you mean?
<wasamasa>
it is a lie
<PeopleLaugh>
one these days imma learn how to make an irc bot and program a vpn changer in
<PeopleLaugh>
then leave it on a left alone computer and run that shit all day on freenode
<wasamasa>
and chill the fuck out, just because you got banned for trolling with java doesn't mean you should keep pestering #ruby
<PeopleLaugh>
how do you know i got banned from java?
<wasamasa>
haven't you got anything better to do
<PeopleLaugh>
also its quite flattering that i'm so famous
<certainty>
x(
<PeopleLaugh>
literally every coding channel knows who i am
<PeopleLaugh>
and they cant keep me out
neanderslob has quit [Remote host closed the connection]
<PeopleLaugh>
##java can suck my dick
<PeopleLaugh>
yall know how it is
<PeopleLaugh>
where my niggas at
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<PeopleLaugh>
niggers and queers
<wasamasa>
yup, you haven't got anything better to do
<PeopleLaugh>
NO i dont
arup_r_ has joined #ruby
<apeiros>
!kick PeopleLaugh bye
<jhass>
!ban PeopleLaugh boooring
PeopleLaugh was kicked from #ruby by ruboto [bye]
<canton7>
hah
<canton7>
teamwork!
mengu has joined #ruby
<jhass>
join #node.js if you want more fun
arup_r has quit [Ping timeout: 272 seconds]
arup_r_ has quit [Client Quit]
pagios has quit [Remote host closed the connection]
decoponio has joined #ruby
wwwbukolaycom has quit []
ponga has quit [Remote host closed the connection]
ponga has joined #ruby
zachrab has joined #ruby
plutonic has quit [Quit: plutonic]
gfawcettpq has joined #ruby
ralku has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
ah, and ^5 jhass :D
ahmetkapikiran has joined #ruby
a5i has joined #ruby
chridal has quit [Ping timeout: 276 seconds]
mengu__ has joined #ruby
basiclaser has joined #ruby
ralku has joined #ruby
elfuego has quit [Quit: elfuego]
zachrab has quit [Ping timeout: 250 seconds]
bim has joined #ruby
mengu has quit [Ping timeout: 245 seconds]
DavidDudson has joined #ruby
bim is now known as Guest48650
ponga has quit [Ping timeout: 245 seconds]
hazelux has joined #ruby
iqbalkhan has quit [Remote host closed the connection]
ralku is now known as ralku[away]
jeromelanteri_ has quit [Ping timeout: 272 seconds]
kith has joined #ruby
iotouch has quit [Quit: This computer has gone to sleep]
hazelux has quit [Ping timeout: 256 seconds]
eighthbit has joined #ruby
tvw has joined #ruby
eighthbit has quit [Client Quit]
iteratorP has joined #ruby
serivich has joined #ruby
dahl has joined #ruby
Myrl-chan has quit [Ping timeout: 264 seconds]
Zai00 has quit [Quit: Zai00]
doodlehaus has joined #ruby
joonty has quit [Ping timeout: 248 seconds]
wwwbukolaycom has joined #ruby
icebourg has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
havox has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
mengu__ has quit [Ping timeout: 256 seconds]
AlphaAtom has joined #ruby
elfuego has joined #ruby
ralku[away] is now known as ralku
anaeem1 has quit [Read error: Connection reset by peer]
serivich has quit [Ping timeout: 244 seconds]
icebourg has quit [Ping timeout: 248 seconds]
User458764 has joined #ruby
<BLuEGoD>
what's the best way to deal with my_array['a']['b']['c']['d'] undefined method [] when somewhere in the middle something does not exist? like my_array['a']['b'] is nil. This actually comes from a Yaml file so unable to initialize non known values. I just want to return an empty string back, but don't want to check every single thing for nil?
ponga has joined #ruby
<rom1504>
you'll need to check
<rom1504>
no magic
<apeiros>
BLuEGoD: multiple options - a) reorganize your data so you use proper datastructures which remove this need, b) write a method with a signature like: deep_fetch(hash, *keys), c) check every single level manually
havox has quit [Ping timeout: 240 seconds]
<BLuEGoD>
if my_array['a'] && my_array['b'] && ...... my_array['z'] => sucks
<apeiros>
BLuEGoD: also array['a'] <-- is certainly not an array ;-)
jayeshsolanki has quit [Quit: bye!]
khebbie has quit [Ping timeout: 250 seconds]
<apeiros>
(arrays are indexed, they don't have string keys)
<BLuEGoD>
well a hash in this case
DEA7TH has joined #ruby
<BLuEGoD>
sorry for that
<apeiros>
np, luckily it was obvious enough this time
jeromelanteri_ has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
<BLuEGoD>
groovy has something like a['b']?['c']?['d'] which may look a bit weird but certainly better than implement a method for this. I'm aware of .try, but looks horrible.
AlphaAtom has joined #ruby
<rom1504>
who said anything about "if my_array['a'] && my_array['b'] && ...... my_array['z'] "
<rom1504>
there are better ways to check
elfuego has quit [Quit: elfuego]
iotouch has joined #ruby
krisquigley has joined #ruby
juanpaucar has joined #ruby
solars has quit [Ping timeout: 256 seconds]
iotouch has quit [Client Quit]
iasoon has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<certainty>
I agree array['a'] is certainly not an arry
<certainty>
now you have certainty
juanpaucar has quit [Ping timeout: 240 seconds]
rodfersou has joined #ruby
_honning__ has joined #ruby
krisquigley has quit [Ping timeout: 245 seconds]
oo_ has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 1.0.1]
elev has joined #ruby
<elev>
Can someone help me with variables?
<certainty>
elev: sure. here you have one
<certainty>
@
<certainty>
damn
<elev>
what is @?
<elev>
means=
<certainty>
it's a typo
<elev>
I started ruby today
<elev>
no idea where to start
pwattste has joined #ruby
elev has quit [Client Quit]
chthon has quit [Ping timeout: 244 seconds]
<certainty>
elev: what are you struggling with?
bruno- has joined #ruby
pontiki has joined #ruby
postmodern has quit [Quit: Leaving]
arturmartins has joined #ruby
bmn has quit [Quit: obai]
pontiki has quit [Remote host closed the connection]
mwlang has joined #ruby
bmn has joined #ruby
Guest94978 has quit [Changing host]
Guest94978 has joined #ruby
Guest94978 is now known as daynaskully
bmn has quit [Client Quit]
bruno- has quit [Ping timeout: 246 seconds]
RegulationD has joined #ruby
elfuego has joined #ruby
bmn has joined #ruby
moeabdol has quit [Ping timeout: 244 seconds]
SOLDIERz has joined #ruby
yfeldblu_ has quit [Ping timeout: 245 seconds]
oo_ has joined #ruby
Nimf has joined #ruby
RegulationD has quit [Ping timeout: 240 seconds]
elfuego has quit [Quit: elfuego]
moeabdol has joined #ruby
bMalum has joined #ruby
sigurding has joined #ruby
mg^ has quit [Read error: Connection reset by peer]
chthon has joined #ruby
dumdedum has quit [Quit: foo]
polysics has joined #ruby
solars has joined #ruby
xmad-afk is now known as xmaddness
iteratorP has quit [Read error: Connection reset by peer]
iteratorP has joined #ruby
mg^ has joined #ruby
zenspider has quit [Ping timeout: 252 seconds]
giuseppesolinas has joined #ruby
ldnunes has joined #ruby
yeticry has quit [Ping timeout: 240 seconds]
doobi-sham_ has joined #ruby
lanemeyer has quit [Ping timeout: 245 seconds]
zenspider has joined #ruby
crdpink has joined #ruby
serivich has joined #ruby
crdpink2 has quit [Ping timeout: 245 seconds]
yeticry has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
doobi-sham has quit [Ping timeout: 245 seconds]
doodlehaus has quit [Remote host closed the connection]
merqlove has quit [Quit: Connection closed for inactivity]
<elev>
I use sublime text and I am done with an easy code. Do I have to write end?
Nimf has quit [Read error: Connection reset by peer]
<mwlang>
given a Hash: h = {:a=>{:b=>{:c=>"hello"}}} is it possible to assign h[:a][:b] to a variable, say “v” such that I could do v[:c][:d] = “World” and get {:a=>{:b=>{:c=>"hello”, :d => “World”}}} for h?
mikecmpbll has quit [Ping timeout: 248 seconds]
<elev>
yes mwlang
<rom1504>
elev: yes write end, 9 times
<mwlang>
I’m trying to recursively build a hash from a tree of nodes
<elev>
I write end 9 times?
<rom1504>
yeah
<elev>
?
<elev>
why?
<rom1504>
because it's better than 8 !
<elev>
dude
<elev>
give me a answear fucker
<jhass>
elev: watch your language
<elev>
ydo I have to write end?
<elev>
sorry jhass
<elev>
but he is kidding with me
<rom1504>
elev: give me a question, I'll give you an answer
<elev>
jhass are you on this channel 24/7?
<elev>
rom1504 I write ruby in sublime etxt
<elev>
aftwr a code is done do I have to write end?
bruno- has joined #ruby
arturmartins has quit [Read error: Connection reset by peer]
<jhass>
rom1504: don't bother, its our troll
<elev>
dude
arturmartins has joined #ruby
<elev>
pls
<elev>
do I have to write end?
<elev>
or no?
<rom1504>
try it
<jhass>
yes, you have to
<elev>
ok thanks
<elev>
and after I write end, I can start another program?
<elev>
like write another code?
<jhass>
sure
<mwlang>
does my question make sense?
<jhass>
mwlang: yes and yes you can
Ove___ has quit [Ping timeout: 245 seconds]
juanpaucar has joined #ruby
juanpaucar has quit [Read error: Connection reset by peer]
Zamyatin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mwlang>
oh, wait, just tried it again and it worked. Must’ve fubarred it first time around.
juanpaucar has joined #ruby
ponga has quit [Ping timeout: 245 seconds]
* mwlang
*grumbles*
Zai00 has joined #ruby
<elev>
jhass?
<elev>
what happens when I write end
<elev>
?
ahmetkapikiran has joined #ruby
elev is now known as I
I is now known as IloveJhass
RegulationD has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
<IloveJhass>
+1
<IloveJhass>
:D
konsolebox has quit [Ping timeout: 246 seconds]
<IloveJhass>
mwlang
<jhass>
!kick IloveJhass you focus on me again, I get it
<IloveJhass>
jhass and mwlang are online here 24/7
IloveJhass was kicked from #ruby by ruboto [you focus on me again, I get it]
Ruby4newbie has joined #ruby
<Ruby4newbie>
hello guys
<kaspergrubbe>
hi
GeorgeThompson has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ruby4newbie>
can someone help me with an thing?
tus has joined #ruby
dfinninger has joined #ruby
<rom1504>
maybe
<Ruby4newbie>
When I start irssi my name is always Mathias123
<Ruby4newbie>
and I change it with / nick and new name
<rom1504>
/nick your_nick then /save
<jhass>
whoops
Ruby4newbie was kicked from #ruby by jhass [Ruby4newbie]
senayar has quit [Remote host closed the connection]
bhegel has quit [Quit: bhegel]
krisquigley has joined #ruby
User458764 has joined #ruby
jerius has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
tesuji has quit [Read error: Connection reset by peer]
fmcgeough has joined #ruby
ndrei has quit [Ping timeout: 276 seconds]
Igorshp has quit [Remote host closed the connection]
werelivinginthef has quit [Ping timeout: 245 seconds]
Igorshp_ has joined #ruby
icebourg has quit [Ping timeout: 240 seconds]
kstuart_ has joined #ruby
oo_ has quit [Remote host closed the connection]
brb3 has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pandaant has quit [Remote host closed the connection]
krisquigley has quit [Ping timeout: 276 seconds]
wwwbukolaycom has quit [Ping timeout: 250 seconds]
kstuart has quit [Ping timeout: 256 seconds]
ponga has joined #ruby
failshell has joined #ruby
vtunka has quit [Quit: Leaving]
delianides has joined #ruby
enebo has joined #ruby
Aswebb_ has joined #ruby
lidenskap has joined #ruby
kotk_ has quit [Quit: Leaving...]
ismaelga has joined #ruby
MXfive has joined #ruby
fryguy9 has joined #ruby
failshel_ has joined #ruby
failshell has quit [Read error: Connection reset by peer]
<certainty>
damn i missed the fun
quimrstorres has quit [Remote host closed the connection]
lidenskap has quit [Ping timeout: 256 seconds]
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
brb3 has quit [Read error: Connection reset by peer]
brb3 has joined #ruby
bMalum has joined #ruby
Guest42184 has quit [Read error: Connection reset by peer]
helpa has quit [Remote host closed the connection]
lavros has joined #ruby
ismael__ has joined #ruby
workmad3 has joined #ruby
tesuji has joined #ruby
Zai00 has joined #ruby
helpa has joined #ruby
krz has quit [Ping timeout: 244 seconds]
allcentury has joined #ruby
ismaelga has quit [Ping timeout: 272 seconds]
bhegel has joined #ruby
Industrial has joined #ruby
<Industrial>
Hi. Are there books on how to implement things and/or patterns on how to make things more DRY that is not linked to one platform or language?
RegulationD has quit [Remote host closed the connection]
<Industrial>
like besides assuming stuff is there ...
Trynemjoel has quit [Ping timeout: 272 seconds]
<Industrial>
I don't really know how to create things so that I might evade boilerplate code :)
<Industrial>
How to create systems that avoid you from writing boilerplat code. I guess :)
Trynemjoel has joined #ruby
<aawe>
Industrial: I recommend watching the Destroy All Software screencasts
Guest76015 has quit [Ping timeout: 245 seconds]
elfuego has joined #ruby
hanmac1 has joined #ruby
ta has quit [Remote host closed the connection]
|bb| has joined #ruby
endash has joined #ruby
<|bb|>
hello
fgo has joined #ruby
<|bb|>
what are the best books for a rails beginner?
<hanmac1>
|bb| #RubyOnRails
<|bb|>
k
cocotton has joined #ruby
|bb| has quit [Client Quit]
mrmargolis has joined #ruby
quimrstorres has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
bim has joined #ruby
bim is now known as Guest36004
zz_Outlastsheep is now known as Outlastsheep
Igorshp_ has quit [Remote host closed the connection]
Igorshp has joined #ruby
Feyn has quit [Quit: Leaving]
parduse has quit [Ping timeout: 264 seconds]
catcher has joined #ruby
<jhass>
Industrial: Design patterns in Ruby is also good. Don't worry about which language the book uses, you can easily transfer such stuff to all languages you know well enough
balazs_ has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
adude has joined #ruby
mlev has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
cocotton has quit [Quit: Leaving...]
parduse has joined #ruby
rbennacer has joined #ruby
kobain has joined #ruby
<hanmac1>
jhass: design patterns are nice, but some does use them just to have them which is wrong imo ... (and such patterns can be overused ... like Java with FactoryFactory classes ;P)
rbennacer has quit [Remote host closed the connection]
* certainty
uses patterns for conversations
<certainty>
rarely for code
freerobby has joined #ruby
ki0 has joined #ruby
horsecowdog has joined #ruby
horsecowdog has quit [Client Quit]
rbennacer has joined #ruby
ta has joined #ruby
<jhass>
I totally agree, but I sometimes recognize them in my code and that helps me do the last step in some cases
<jhass>
in any case I think learning them can help you think a bit more object oriented which helps in DRYing up your code usually
RegulationD has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
cocotton has joined #ruby
havox has quit [Ping timeout: 256 seconds]
edwinvdg_ has joined #ruby
JimmyNeutron has quit [Ping timeout: 256 seconds]
ponga has quit [Quit: Leaving...]
<ninjs>
So I'm working on a project where I grab a bunch of claim files and spit them out to an excel file, one claim per line. Before I write them to the spreadsheet, I need to sort them by one of the values(date_range). I'm wondering if I could solve this by making a class 'Claim'? I'm not sure
Aswebb_ has joined #ruby
AlphaAtom has quit [Ping timeout: 245 seconds]
riotjones has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
vtunka has joined #ruby
timanema has joined #ruby
vt102 has quit [Remote host closed the connection]
<mikecmpbll>
ninjs: probably a bit overkill. just sort whichever structure you're parsing the 'claim files' into.
JimmyNeutron has joined #ruby
<ninjs>
Haha. I was told yesterday that my code was a mess and that I should make it more 'rubylike'
hiyosi has joined #ruby
Beoran has quit [Ping timeout: 255 seconds]
<ninjs>
So I'm trying to first separate my giant method into a bunch of smaller ones, but the way I'm writing those files is looping through all of the files in a directory, and doing file.each that writes each grabbed value to a row that gets written to an excel file
vt102 has joined #ruby
zachrab has joined #ruby
Rollabunna has quit [Ping timeout: 250 seconds]
ujihisa has joined #ruby
ismaelga has joined #ruby
mitchellhenke has joined #ruby
polarking has quit [Quit: polarking]
roshanavand has quit [Remote host closed the connection]
polarking has joined #ruby
turtil-kun has quit [Ping timeout: 256 seconds]
dfinning_ has quit [Remote host closed the connection]
claw__ has joined #ruby
claw_ has quit [Ping timeout: 265 seconds]
zachrab has quit [Ping timeout: 256 seconds]
speakingcode has quit [Ping timeout: 244 seconds]
bruno- has joined #ruby
<shevy>
is there a question
Outlastsheep is now known as zz_Outlastsheep
ss has joined #ruby
ss is now known as Guest43741
freerobby has quit [Quit: Leaving.]
cocotton has quit [Remote host closed the connection]
ujihisa has quit [Ping timeout: 244 seconds]
Beoran has joined #ruby
<certainty>
interesting i have a case where my AR model doesn't typcast a column correctly. The column has type smallint(6). It's a mysql db. Saving an int to that column works fine. Howver loading the record again results in a string value for that column. Might be some gem messing with AR or the MySQL adapter
Aswebb_ has quit []
mary5030 has joined #ruby
failshel_ is now known as failshell
<certainty>
will construct a testcase later
<certainty>
damn i justed wanted to upgrade
freerobby has joined #ruby
<bMalum>
how can i set manually a cookie for get requests with ruby net::http
<dudedudeman>
in what context are you using AR, certainty?
<dudedudeman>
outside of rails?
AlphaAtom has quit [Read error: Connection reset by peer]
thinkswan has quit [Quit: ...]
AlphaAtom has joined #ruby
bim has joined #ruby
sinkensabe has quit [Remote host closed the connection]
bim is now known as Guest87098
<hanmac1>
imo i still find it funny that some big things like Symphony or CakePHP does not work correctly with Models that does have combined primary key ;P imo its a key feature of databases and it does makes a bad view if ORMs does not support that
jblancett has quit [Remote host closed the connection]
chridal has joined #ruby
xploshioon has joined #ruby
Morkel has quit [Quit: Morkel]
dmmoody has joined #ruby
s7ry93r has joined #ruby
aphprentice_ has quit [Remote host closed the connection]
<ytti>
StringScanner question
<ytti>
sc = StringScanner.new string
juanpaucar has quit [Remote host closed the connection]
AlphaAtom has quit [Ping timeout: 276 seconds]
<ytti>
sc.scan_until /something
<ytti>
data = sc.pre_match
sethette1 has left #ruby [#ruby]
<ytti>
sc.scan_until /somethin_else/
shellfu has joined #ruby
<ytti>
how do i get delta between last scan_until
<ytti>
and current scan_until
<ytti>
w/o the matched data?
<ytti>
i guess string manipulation is only option?
<ytti>
delta = sc.scan_until /something_else/
<ytti>
then remove sc.matched from delta?
tosbourn has joined #ruby
sigurding has quit [Quit: sigurding]
chridal1 has joined #ruby
chridal has quit [Ping timeout: 245 seconds]
<tosbourn>
Quick question: Before requiring 'date' in an IRB session, what is the Date class that you have access to?
eones has quit [Read error: Connection reset by peer]
<tosbourn>
I was trying to look it up but my google-fu is letting me down
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby has quit [Quit: Leaving.]
tus has quit [Ping timeout: 246 seconds]
andrew-l` is now known as andrew-l
zlude has quit [Read error: No route to host]
giuseppesolinas has quit [Quit: Leaving]
wallerdev has joined #ruby
freerobby has joined #ruby
<ninjs>
So I have a method now that crates each claim that is processed using the Claim class.. my thought was at the end of each iteration to write it to a row on the excel sheet based on it's id#. But I'm looking for a way to sort all of the claims, collectively, by date_range, before I write them. Any ideas? I'll post a gist.
<mikecmpbll>
ninjs: ok, it doesn't appear you're storing each claim in that loop
<mikecmpbll>
just printing it out
<ninjs>
I was thinking of replacing line 115 'claim.show' with something like newsheet1.row(claim.get_number)
<tosbourn>
gem -v gives me 2.2.2 jhass
<ninjs>
mikecmpbll: yeah I was just printing it for now to make sure everything was working
<mikecmpbll>
ninjs: if you create an array before you iterate over the files: claims = []
<mikecmpbll>
ninjs: then add each new claim to the array: claims << claim
<mikecmpbll>
then you can use ruby's sort and sort_by methods
<jhass>
tosbourn: then it comes from there, 2.4 removed it
<ninjs>
mikecmpbll: awesome! but how do I write that array out?
<tosbourn>
jhass: thanks :)
<mikecmpbll>
ninjs: to the spreadsheet?
<ninjs>
I guess, I mean how do I grab each claim out of the array once I put it in there haha
bigmac_ has quit [Ping timeout: 276 seconds]
<mikecmpbll>
ninjs: you can iterate over the array using .each for example
<mikecmpbll>
like you're doing with the files.
<ninjs>
Oh. awesome
juanpaucar has joined #ruby
evanjs has quit [Remote host closed the connection]
krisquigley has quit [Ping timeout: 250 seconds]
<ninjs>
My array looks crazy though.
zubov has joined #ruby
khebbie has joined #ruby
<mikecmpbll>
why?
<ninjs>
It's like #<Claim:0x007f96d7951a08 @payor="PAYER NAME", @patient="John Doe", @total="TOTALS.TT", @date_range="D./FR/OM-D./TO/OO", @sent_date="CR/EA/TE", @comments="Sent on CR/EA/TE", @loc="unknown", @units="22">]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mikecmpbll>
that's a claim object.
<matugm>
That's an object, not an array.
<mikecmpbll>
(with a closing array bracket at the end)
<mikecmpbll>
:)
<ninjs>
right I mean it's an array of object that look like that
<mikecmpbll>
yes, correect.
<matugm>
Yell, having an array of objects is fine :)
<ninjs>
that's right? so I do something like Claims.each do |claim|; print claim.patient; end; for example?
casadei has joined #ruby
paulcsmith has joined #ruby
<mikecmpbll>
you can do that, yes.
<matugm>
Well*
bigmac_ has joined #ruby
<mikecmpbll>
except not exactly that.
<mikecmpbll>
claims*
iceyec has quit [Quit: iceyec]
<ninjs>
oh just lowercase c at the beginning
<mikecmpbll>
ninjs: yep, if that's what you called the array.
MatthewsFace has quit [Remote host closed the connection]
evanjs_ has joined #ruby
<ninjs>
That's right. I'm getting invalid method 'patient' with that example
<mikecmpbll>
ninjs: because that method isn't defined on Claim.
jobewan has quit [Remote host closed the connection]
Matip has joined #ruby
bigmac__ has quit [Ping timeout: 245 seconds]
<ninjs>
Oh, they keep on being a claim object
<ninjs>
nice. I love ruby haha
<mikecmpbll>
you can use attr_reader :patient if you want that method.
kblake has joined #ruby
speakingcode has joined #ruby
solars has quit [Ping timeout: 245 seconds]
<Matip>
I have a class and in each of the n methods I'm adding "def foo \n begin \n ... \n rescue Bar => e \n puts e.message \n end"
<Matip>
can I do that on a class level so I don't have to do so on each method?
maasha has joined #ruby
delianides has quit [Remote host closed the connection]
stephenh has joined #ruby
<Matip>
something like class Example \n def on_exception(e) puts e.message end end" or something
jobewan has joined #ruby
<ninjs>
mikecmpbll: so to sort that array... claims.sort(date_range) ? or something like that
delianides has joined #ruby
Igorshp has quit [Remote host closed the connection]
havox has joined #ruby
<Matip>
I mean, define an exception handler for the whole class
<mikecmpbll>
ninjs: if you want to sort it in-place (replacing it with the sorted version), you can do claims.sort_by!{ |c| c.date_range }
rbennacer has quit [Remote host closed the connection]
<mikecmpbll>
ninjs: but, if it's a method you've not used before just look at the docs.
<mikecmpbll>
and it will tell you how to use it.
rbennacer has joined #ruby
<hanmac1>
Matip maybe use a Decorator for that
delianid_ has joined #ruby
<ninjs>
but c.date_range has to be a method in the Claim class
<stephenh>
hi, hopefully not too off topic.. is there a way to use bundler to install gems from git into the gem path ? the problem i'm having is gems from git are installed to $GEM_PATH/bundler/gems and not $GEM_PATH/gems; i'd like to make use of these gems without using 'bundle exec'
<ninjs>
mikecmpbll: ^
<mikecmpbll>
ninjs: yes, correct.
<Mon_Ouie>
You could write a method that generates your methods by using using define_method. You can also drop the `begin' and just have a single line that goes rescue Bar => e; foo(e) at the end of each method
delianides has quit [Read error: Connection reset by peer]
sevenseacat has quit [Quit: Me dun like you no more.]
<ninjs>
mikecmpbll: matugm: thanks for your help, I really appreciate it. :)
<hanmac1>
maasha: you might use || for line 4-6
fabrice31 has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
fabrice31 has joined #ruby
mbff has joined #ruby
<mbff>
Hello! I am having a bit a trouble with requiring files
senayar has joined #ruby
<mbff>
I have require './lib/strike_api'
SOLDIERz has quit [Ping timeout: 244 seconds]
<hanmac1>
imo rubocop is a whiny little spoiled child ... it tears at the simplest code
<shevy>
if you have a gem structure, or a gem, then require 'name' should be fine mbff
<mikecmpbll>
maasha: simply replace lines 4..8 with all your conditions or'd together
<hanmac1>
mbff: checkout require_relative
x77686d has joined #ruby
<shevy>
mbff otherwise try require_relative
ndrei has joined #ruby
<mikecmpbll>
you don't need any return statements
<mbff>
however the file that uses that require will only run from the root of my project
RegulationD has joined #ruby
<mbff>
how would i write the require statement so regardless of where I run "ruby test.rb" it works
centrx has joined #ruby
iceyec has joined #ruby
aganov has quit [Quit: Leaving]
Pumukel has quit [Ping timeout: 265 seconds]
<maasha>
hanmac1: agreed, but it makes my code better I think.
leafybas_ has quit [Remote host closed the connection]
xploshioon has quit [Quit: Leaving]
<mikecmpbll>
maasha: the worst thing about that code is the if true; return true; else return false; end antipattern
leafybasil has joined #ruby
Freet has joined #ruby
<mikecmpbll>
that's probably not what robocop is complaining about tho
dseitz has joined #ruby
<maasha>
mikecmpbll: antipattern?
fabrice31 has quit [Ping timeout: 272 seconds]
havox has quit [Ping timeout: 264 seconds]
riotjones has joined #ruby
<mikecmpbll>
maasha: ineffective code
<shevy>
mbff make it a gem, it's much simpler in the long run; or use an aliased directory, then you could use something like: require 'x/strike_api.rb' if x is the name of the symlink
<shevy>
but as said, if you have it a gem, require 'name_of_project' would work as-is; in test.rb, you can have this as the first line, and it'll work
<mikecmpbll>
maasha: you're making the same return true if <condition> mistake in there
Akagi201 has quit [Remote host closed the connection]
dmmoody has quit [Remote host closed the connection]
<Mon_Ouie>
maasha: Use Enumerable#any?
<mikecmpbll>
maasha: actually ignore me
<mikecmpbll>
but yeah that can still be simplified quite substantially.
freerobby has quit [Quit: Leaving.]
mipsln has joined #ruby
<maasha>
Mon_Ouie: ?
Igorshp has joined #ruby
nettoweb has joined #ruby
<Mon_Ouie>
What do you mean, '?'? Enumerable#any? is a method for checking if there is any element in a collection that satisfies some predicate, which is what you're doing here
<hanmac1>
maasha: about " return true if value.is_a?(String) && @exact.include?(value.to_sym), return true if !value.is_a?(String) && @exact.include?(value)" what other types than String / Symbol does you expect? Symbol does have to_sym too
dfinninger has joined #ruby
CloCkWeRX has quit [Remote host closed the connection]
<mikecmpbll>
^ yeah that too. i didn't even read the code tbh :D
<maasha>
hanmac1: expected types are String, Symbol, Integer and Float
<hanmac1>
maasha: normally "return true if @exact.include?(value.respond_to?(:to_sym) ? value.to_sym : value)" should do what you want
chridal1 has quit [Read error: Connection reset by peer]
Nimf has joined #ruby
Channel6 has joined #ruby
allcentury has joined #ruby
agarie has quit [Remote host closed the connection]
icebourg has joined #ruby
chridal1 has joined #ruby
GaryOak_ has joined #ruby
<maasha>
hanmac1: ...in 80 chars with a bit of indention and you-know-who whines?
ianseyer has joined #ruby
<hanmac1>
ah the 80 chars rule ... my old archenemy
<maasha>
but it is probably more clean, agreed
<maasha>
maasha: and fixes the complexity problem. Thanks.
<bricker>
> "a" ??!??! "b"
<bricker>
>> "a" ??!??! "b"
<ruboto>
bricker # => /tmp/execpad-bab35b50b24f/source-bab35b50b24f:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/314569)
<hanmac1>
maasha: you might write it in more lines like this with linebreaks "return true if @exact.include?( \n value.respond_to?(:to_sym) ? value.to_sym : value \n )" ... but sooner or later rubocop will whine that the method is to long again
<bricker>
aww
freerobby has joined #ruby
gmas has joined #ruby
Pupeno has quit [Remote host closed the connection]
<maasha>
I am assigning a new value to the backreference match - so it is used?
<mikecmpbll>
you're creating a new variable.
<centrx>
you're assigning the name match to a new object, not re-assigning the previous object
MyGreenP1 has joined #ruby
<mikecmpbll>
puts match.object_id; match = "X"; puts match.object_id
<mikecmpbll>
:d
x77686d has quit [Quit: x77686d]
ismaelga has quit [Remote host closed the connection]
agarie has quit [Remote host closed the connection]
iceyec has quit [Quit: iceyec]
spider-mario has joined #ruby
nszceta has joined #ruby
nszceta has quit [Max SendQ exceeded]
sgambino_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bim has joined #ruby
bim is now known as Guest38538
Soda has joined #ruby
mbff has quit [Ping timeout: 265 seconds]
<maasha>
So how do you gsub something using the backreference to determine the outcome?
<maasha>
apparently my way is messy
<mikecmpbll>
maasha: why?
nszceta has joined #ruby
Nimf has joined #ruby
<maasha>
rubocop says so.
psy_ has quit [Read error: Connection reset by peer]
<mikecmpbll>
that code isn't doing anything
nszceta has quit [Max SendQ exceeded]
<mikecmpbll>
if you've got some real code to show, then by all means show it
nszceta has joined #ruby
<mikecmpbll>
maasha: what i mean by not doing anything is the assignment of `match` isn't affecting that code, you could just as well replace line 6 with 'X'
<shellfu>
"Go ahead skin it! Skin that smoke wagon and see what happens!"
chridal1 has quit [Ping timeout: 245 seconds]
lavros has quit [Ping timeout: 250 seconds]
MXfive has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gagrio has quit [Ping timeout: 276 seconds]
ujihisa has joined #ruby
arup_r has joined #ruby
arturaz has quit [Ping timeout: 244 seconds]
fryguy9 has quit [Quit: Leaving.]
lavros has joined #ruby
Kricir has quit [Remote host closed the connection]
Guest43741 has joined #ruby
krz has joined #ruby
ki0 has quit [Remote host closed the connection]
chthon has quit [Read error: Connection reset by peer]
RegulationD has quit [Remote host closed the connection]
<ninjs>
shevy: Oh, I see what you mean, condense some of those if statements
DerisiveLogic has joined #ruby
<ninjs>
so that I don't repeat myself
ujihisa has quit [Ping timeout: 256 seconds]
<adaedra>
I was told to prefer the use of interpolation or String#% to adding strings, as it will not create temporary objects
dmmoody has joined #ruby
<shevy>
ninjs yeah
zachrab has joined #ruby
<shevy>
because you duplicate the same task
dorei has joined #ruby
<adaedra>
And I would do the "name split" by first_name, last_name = full_name.split(/, /).map(&:capitalize)
dorei has quit [Read error: Connection reset by peer]
<adaedra>
so you have it in one line and don't do the split operation twice
dorei has joined #ruby
MhdAli has quit [Quit: Leaving]
maletor has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
charliesome has joined #ruby
<adaedra>
oh ninjs
<adaedra>
is that a tab character in Claim#show ?
dorei has quit [Read error: Connection reset by peer]
<ninjs>
whoops that's a pasting error haha
maletor has quit [Client Quit]
sdothum has joined #ruby
<ninjs>
that Claim#show doesn't even need to be there I was just using it for testing haha
dorei has joined #ruby
jespada has joined #ruby
<adaedra>
And ARGV is supposed to be an array, so ARGV == 'help' seems wrong
jefus has quit [Quit: WeeChat 1.1.1]
dorei has quit [Read error: Connection reset by peer]
gr33n7007h has quit [Ping timeout: 246 seconds]
x77686d has joined #ruby
zachrab has quit [Ping timeout: 244 seconds]
nszceta has joined #ruby
maletor has joined #ruby
mbff has joined #ruby
<adaedra>
Your variable naming in file_move is very bad
<adaedra>
What's w, x, y, z
MatthewsFace has joined #ruby
Pupeno has joined #ruby
Pupeno has joined #ruby
<centrx>
always improvements
DerisiveLogic has quit [Ping timeout: 255 seconds]
dorei has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
Guest38538 has quit [Remote host closed the connection]
bradleyprice has joined #ruby
<adaedra>
aww, you can't comment lines on a gist, too bad
DerisiveLogic has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
<mikecmpbll>
ninjs: btw if you had a hash which contained the row numbers for the different type of data in the different formats, you could avoid all that if claim_ext == .. nonsense in every method
fryguy9 has quit [Quit: Leaving.]
<mikecmpbll>
and just do claim_array[column_for[claim_ext][:sent_date]) or something like that
MatthewsFace has quit [Ping timeout: 264 seconds]
bhegel has quit [Quit: bhegel]
<mikecmpbll>
i worded that like shit so you've probably got no idea what i mean, nvm
<ninjs>
adaedra: yeah that was an old quick script I wrote haha
dEPy has joined #ruby
Senjai has quit [Ping timeout: 240 seconds]
<dEPy>
If I rescue like this: rescue *[SomeError, AnotherError]
blackmesa has joined #ruby
<dEPy>
Can I do this? rescue *[SomeError, AnotherError] => e ?
iceyec has joined #ruby
failshell has quit [Remote host closed the connection]
ekaleido has joined #ruby
serivich has quit [Quit: Leaving]
MasterPiece has joined #ruby
<Mon_Ouie>
`*[X, Y]' is silly, you can just replace it with `X, Y'
<Mon_Ouie>
But yes, you can do that just fine
<dEPy>
oh, ok
<dEPy>
Tnx! :)
<bricker>
It could be useful if you're dynamically deciding which errors to rescue
<bricker>
shrug
allcentury has quit [Ping timeout: 265 seconds]
delianid_ has quit [Remote host closed the connection]
ramfjord has joined #ruby
delianides has joined #ruby
Cust0sL1men has quit [Ping timeout: 264 seconds]
endash has quit [Quit: endash]
<apeiros>
dEPy: that said, you could do something like: RelevantExceptions = [SomeError, AnotherError]; … begin; …; rescue *RelevantExceptions => e; … end
<apeiros>
now I ponder trying a method in the rescue clause - should work I'd say…
<ruboto>
eam # => I'm on fire (RuntimeError) ...check link for more (https://eval.in/314602)
<apeiros>
oh, actually
gauke has joined #ruby
<apeiros>
WHY ON EARTH DOES FILE.NEW ACCEPT RANDOM KEYWORD ARGS IT DOESN'T UNDERSTAND?!?
Zamerick_ has quit [Client Quit]
<apeiros>
(╯°□°)╯︵ ┻━┻
thumpba_ has joined #ruby
brb3 has quit [Quit: <.<]
MyGreenP1 has quit [Ping timeout: 256 seconds]
krisquigley has joined #ruby
bobby__ has joined #ruby
<apeiros>
sooo, it works indeed as I thought it would. you just have to use the right name for the keyword argument. and File.new doesn't effing care if you pass it nonsense.
gauke has quit [Client Quit]
CorpusCallosum has joined #ruby
mbff has quit [Quit: Leaving]
bobby__ has quit [Client Quit]
brb3 has joined #ruby
<dorei>
but how could File.new know what arguments make sense?
CorpusCallosum has quit [Max SendQ exceeded]
zacts has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<apeiros>
dorei: serious question?
<dorei>
doesnt that depend upon the underlying filesystem?
gauke has joined #ruby
<apeiros>
no
<apeiros>
the underlying file system has absolutely nothing to do with which keyword arguments File.new accepts
pengin has joined #ruby
thumpba has quit [Ping timeout: 245 seconds]
<dorei>
oh, i see what you mean
Guest43741 has joined #ruby
allcentury has joined #ruby
michaeldeol has joined #ruby
krisquigley has quit [Ping timeout: 250 seconds]
gauke has quit [Client Quit]
<apeiros>
and I wrote encoding_external: "utf-8" instead of external_encoding: "utf-8"
<eam>
File.new takes keyword arguments?
<apeiros>
well, technically it accepts a hash
<apeiros>
it has not yet been retrofitted to take kwargs
<apeiros>
and that's probably the reason for its behavior, as it doesn't check against unknown keys in the hash.
krz has quit [Quit: WeeChat 1.0.1]
momomomomo has joined #ruby
<eam>
ah for opt
rbennacer has quit [Remote host closed the connection]
djbkd has quit [Ping timeout: 250 seconds]
<wald0>
im trying to use "ruby-staccato" to track google-analytics events, but it simply not works (pry says that everything is OK)
spider-mario has quit [Remote host closed the connection]
<wald0>
is there anybody that uses it or that knows that it WORKS ?
fryguy9 has joined #ruby
chipotle has quit [Remote host closed the connection]
wldcordeiro has joined #ruby
mitchellhenke has quit [Quit: Computer has gone to sleep.]
roshanavand has joined #ruby
ndrei has joined #ruby
ismaelga has joined #ruby
iasoon has joined #ruby
DerisiveLogic has quit [Ping timeout: 276 seconds]
momomomomo_ has joined #ruby
wald0 has quit [Ping timeout: 246 seconds]
agarie has joined #ruby
ta has joined #ruby
NoNMaDDeN has quit [Remote host closed the connection]
momomomomo has quit [Ping timeout: 264 seconds]
momomomomo_ is now known as momomomomo
mikecmpbll has joined #ruby
mrmargolis has quit [Ping timeout: 250 seconds]
wald0 has joined #ruby
livathinos has quit []
jottr_ has joined #ruby
<wald0>
im trying to use "ruby-staccato" to track google-analytics events, but it simply not works (pry says that everything is OK)
<wald0>
is there anybody that uses it or that knows that it WORKS ?
mrmargolis has quit [Remote host closed the connection]
<centrx>
?ask
<ruboto>
Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<centrx>
helpa has been replaced by MR ruboto
<momomomomo>
centrx: that’s not the type of response I was looking for
agarie has quit [Ping timeout: 250 seconds]
Matip has quit [Ping timeout: 272 seconds]
<centrx>
uh oh
<momomomomo>
I was specifically looking for the getting answers guide
mrmargolis has joined #ruby
<centrx>
yeah
<centrx>
fu ruboto
<momomomomo>
:p
<apeiros>
:<
andikr has quit [Remote host closed the connection]
<momomomomo>
apeiros: is that your bot?
<apeiros>
I'd say "it's our bot"
<apeiros>
but yes
ta has quit [Ping timeout: 250 seconds]
<momomomomo>
make it not deviate from railsbot
<adaedra>
Our bot ♪ In the middle of our chan ♪
scripore has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
momomomomo: it eventually will. I don't intend to import all of helpa's factoids. there's quite a lot of stuff in it I'd prefer not to have.
<momomomomo>
did Radar deprecate helpa?
<centrx>
radar has been locked in a room until he agrees with the bot coup
<centrx>
I think the room is called ##political-prisoner
<apeiros>
but I'll see with Radar how far we can sync
bim has joined #ruby
<momomomomo>
wack, I like helpa
<momomomomo>
why the change?
bim is now known as Guest75590
<dudedudeman>
how to ask smart questions is a good read
<momomomomo>
dudedudeman: agreed!
Matip has joined #ruby
<apeiros>
momomomomo: because ruboto will be connected with the channel website. and that's far easier when the bot runs on the same server.
<momomomomo>
loooool didn’t realize there was a channel website
<apeiros>
topic :)
<apeiros>
it's new. we're working on getting our tooling up.
<momomomomo>
but also, that’s a pretty weak excuse :p
<centrx>
and no longer links to mod-ruby from 185
<centrx>
1985
<apeiros>
momomomomo: you're free to provide the work to make it work with helpa.
<apeiros>
momomomomo: until then I suggest you stop judging what's how strong or weak a reason.
<centrx>
maybe the bots should fight to decide
riotjones has joined #ruby
<momomomomo>
apeiros: what level of integration are you looking for?
<wald0>
momomomomo: centrx: i dont understand... i asked the question, there's nothing in my statistics using staccato, checking if anybody here can confirm that works
<momomomomo>
i.e. what’s the scope of the connectivity?
<apeiros>
momomomomo: join #ruby-community to discuss that
mistermocha has joined #ruby
gr33n7007h has joined #ruby
banister has joined #ruby
<centrx>
wald0, I think the answer is "no one here really knows staccato, but we may be able to answer a more specific, practical question"
banister has quit [Max SendQ exceeded]
agarie has joined #ruby
* dudedudeman
wants to see a bot fight
chinmay_dd has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<wald0>
centrx: but i dont see anything more specifical... pry reports that everything is fine, but there's no track at all in my google-analytics, so... idk
<centrx>
wald0, check the log files? puts/p out some of your variables in your code to see what's happening?
FrankD has quit [Read error: Connection reset by peer]
cocotton has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 256 seconds]
<dudedudeman>
some .inspect might be helpful, too
n80 has joined #ruby
<centrx>
yeah p calls inspect
RegulationD has joined #ruby
<dudedudeman>
does it?
fabrice31 has joined #ruby
<dudedudeman>
consider me enlightened
<wald0>
the staccato command simply sends a call to google analytics, so i dont know to where see any logs
mistermocha has quit [Remote host closed the connection]
hazelux has quit [Remote host closed the connection]
GenghisKen has joined #ruby
havenwood has quit [Ping timeout: 245 seconds]
Axy has quit [Read error: Connection reset by peer]
rbennacer has joined #ruby
Soda has quit [Remote host closed the connection]
rgb-one has joined #ruby
<user121212>
Hi!, I wrote a crawler in ruby and I want to run in in a server for a few days, and log the stdout in a log file. what will be the best way to do that?
fryguy9 has joined #ruby
zz_Outlastsheep is now known as Outlastsheep
agarie_ has quit [Remote host closed the connection]
leafybasil has quit [Ping timeout: 272 seconds]
gfawcettpq has quit [Ping timeout: 256 seconds]
djbkd has joined #ruby
leafybas_ has quit [Ping timeout: 245 seconds]
tfitts has quit []
shadoi has joined #ruby
<dorei>
user121212: you could use the shell to redirect the stdout to a file
lukequaint has quit [Read error: Connection reset by peer]
lukequaint has joined #ruby
vt102 has joined #ruby
delianides has joined #ruby
aluno1 has joined #ruby
dmmoody has joined #ruby
Notte has joined #ruby
aluno1 is now known as h00d
rodfersou has joined #ruby
<Doue>
okay thanks I see how to
<Doue>
thanks I will try this way
<jhass>
Doue: two notes if you don't mind: prefer "string #{interpolation}" over "string" + concatenation and I'm not sure why you call super in initialize, since you don't subclass anything special
Mia has quit [Read error: Connection reset by peer]
rbennacer has quit [Remote host closed the connection]
<Doue>
in your examples, can I do initize("one value") ?
ramfjord has joined #ruby
<Doue>
and not only two ?
<Doue>
yes I don;t need super actually
<jhass>
mh? My example only passed only one parameter
rodferso1 has quit [Ping timeout: 272 seconds]
hazelux has joined #ruby
delianides has quit [Remote host closed the connection]
<apeiros>
hm, interesting. seems File.read(path, external_encoding: x) will convert from x to Encoding.default_internal, except if x is binary.
<Doue>
you got a and b
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
arturmartins has quit [Quit: Leaving...]
tosbourn has joined #ruby
<jhass>
Doue: in the definition yeah, note that I only pass b in Foo.new
<h00d>
hi guys
djbkd has quit [Remote host closed the connection]
Pumukel has quit [Remote host closed the connection]
fryguy9 has quit [Quit: Leaving.]
rbennacer has joined #ruby
hazelux has quit [Ping timeout: 256 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ki0 has joined #ruby
djbkd has joined #ruby
mistermocha has joined #ruby
mipsln has quit [Read error: Connection reset by peer]
<jhass>
cosmicfires: not in any range that's relevant to worry about anyway
<apeiros>
that is, for equivalent case/when vs. if/else. with a complex case expression, the equivalent for if/elsif would require you to assign the result to a variable first.
rbennacer has joined #ruby
tearan has joined #ruby
<jhass>
cosmicfires: use what's more efficient to write in your case, not what's more efficient to run
<jhass>
benchmark and optimize only if you suspect an actual bottleneck
jottr has joined #ruby
<cosmicfires>
thanks
<cosmicfires>
I was curious
cocotton has quit [Remote host closed the connection]
Notte has quit []
<Doue>
ninjs: I should probably do something like this: def initialize(params = {}) ?
centrx has quit [Remote host closed the connection]
<jhass>
Doue: why no "string #{interpolation}"? :)
centrx has joined #ruby
<jhass>
Doue: no it's fine, prefer the keyword args if you can use them
<jhass>
though I'd spend that definition a few more newlines
<jhass>
another style note: we prefer snake_case for variable names
<cosmicfires>
I did a quick benchmark if/else vs case/when if/else used 30% less cpu time so not worth worrying about
dseitz has quit [Quit: later]
Mia has quit [Read error: Connection reset by peer]
<Doue>
jhass: okay I change to interpolation ! so you don't think I should use the has ?
<Doue>
hash
<jhass>
Doue: no, don't use the hash
cocotton has joined #ruby
cocotton has quit [Remote host closed the connection]
<ninjs>
and no... I didn't spend almost 20 minutes doing that...
Guest92531 has quit [Remote host closed the connection]
polarking has left #ruby [#ruby]
lukequaint has quit [Quit: Bye!]
<ninjs>
apeiros: what's wrong with your eyes? haha
<juyhj>
eyes = identity matrix
<vulix>
How smoothly does build on OSX deploy on Linux go? Or is it really recommended to dev in Linux as well
jottr_ has joined #ruby
<King_Dead>
ok I got rails to work now
RegulationD has joined #ruby
<ninjs>
vulix: I haven't had many problems building on OSX and deploying on linux
<jhass>
vulix: I think it's a pretty standard path, so tools should be ironed out for that. Developers with shiny MBPs and Linux on the server is quite common, especially in the Ruby community
<ninjs>
Really depends on what kind of underlying stuff you're doing
paulcsmith has joined #ruby
<vulix>
Ty guys
<vulix>
I was worried it was like the Windows situation :P
jottr has quit [Ping timeout: 256 seconds]
<ninjs>
I couldn't imagine trying to write Ruby on windows.. haha
stonecol1devin is now known as stonecolddevin
<ninjs>
just having to set up environments for my coworkers to run some scripts of mine has been a headache
<vulix>
yeah im surprised python has got cross-platform working so well
<vulix>
I think its because theyve been on 2.7 forever and not everyones jumped to 3 yet
<ninjs>
Eh, lots of science tools are on windows to start with, so python has to cater to that crowd
tgunr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
delianides has joined #ruby
tgunr has joined #ruby
<vulix>
I'm wanting to port some topic modeling tools I use to Ruby from Java
<vulix>
SciRuby though...I cant tell if its dead or ongoing
wallerdev has quit [Quit: wallerdev]
<juyhj>
python is a big guy in science and machine learning
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
solars has quit [Ping timeout: 256 seconds]
<vulix>
I know, it's just not enjoyable to use for me. I already use Java and R for that type of work anyway
user121212 has joined #ruby
failshell has quit [Read error: Connection reset by peer]
failshel_ has joined #ruby
<vulix>
There seems to be a small group of people interested in Ruby for scientific applications...not many though
codecop has quit [Remote host closed the connection]
<dudedudeman>
oh my god
<apeiros>
I googled
<juyhj>
a little button just at the left of status, there is option, hide join and quit, done
<apeiros>
and actually I googled for freenode's webchat
* dudedudeman
bows down
motto has joined #ruby
<apeiros>
and STILL found the solution for pidgin
<apeiros>
;-p
<dudedudeman>
clearly i suck at the google
zorak8 has joined #ruby
<apeiros>
next time, just search for a different thing than what you use :D
<juyhj>
next book the art of googling
<dudedudeman>
speaking of books, my copy of the pick axe book is going to be delivered today!
<jhass>
dudedudeman: pidgin also has a smart filter plugin somewhere
marr has joined #ruby
<juyhj>
I learned a lot with pickage but I learned online, didn't buy anything
m8 has quit [Ping timeout: 248 seconds]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dudedudeman>
i think i got it set up....
<juyhj>
one small advantage of using webchat.freenode is that you can browse other things at the same time very easily
<dudedudeman>
true
<jhass>
dudedudeman: get the pidgin plugin pack and enable IRC helper or whatever it was called
mr_snowf1ake has joined #ruby
<juyhj>
dudedeman, you shouldn't repeat yourself, ruby is dry
<dudedudeman>
the way i run this is i have chat, terminal and email client open on my left monitor, and all other windows full screened on my main monitor
<toretore>
you mean like switching between windows?
mtakkman has joined #ruby
<jhass>
toretore: tabs! that's totally different!
Guest51219 has quit [Ping timeout: 264 seconds]
tosbourn has joined #ruby
Guest51219 has joined #ruby
<toretore>
i find switching windows much easier than switching tabs
<dudedudeman>
toretore: same here. i don't haver to change the position with my hand to do so
<toretore>
and how do you switch between channels inside the tab?
<juyhj>
in webchat channels are like tabs, but not real tab, don't know the hotkey to switch tabs
goleldar has joined #ruby
doodlehaus has quit [Remote host closed the connection]
<jhass>
Alt+tab, Alt+^, Ctrl+tab all pretty much the same
rajeshchawla has joined #ruby
rajeshchawla has quit [Client Quit]
pdoherty has joined #ruby
seal has joined #ruby
chridal1 has quit [Ping timeout: 252 seconds]
delianides has quit [Read error: Connection reset by peer]
<dudedudeman>
yeah, Ctrl+tab switches windows for me in pdigin
<juyhj>
jhass in the firefox webchat control+tab is to switch to another tab in the navigator but all channel of webchat are in one unique tab
tosbourn has quit [Ping timeout: 272 seconds]
psy_ has joined #ruby
Rapier- has quit [Quit: (null)]
<juyhj>
by the way, a question of javascript, how can one discover what key are bound to any event, that is how you discover keys associated with events
zorak8 has quit [Remote host closed the connection]
<jhass>
my point is that switching between tabs (Ctrl+tab) and switching between windows (alt+tab, alt+^) doesn't make much of a difference to me, so it doesn't influence my decision whether to prefer a web based tool or a native application
m8 has joined #ruby
DEA7TH has quit [Ping timeout: 248 seconds]
aw3jir809a has quit [Ping timeout: 255 seconds]
<jhass>
there's #javascript or ##javascript, I don't remember (probably the later)
<juyhj>
ok, jhass I discovered that you don't have all the answers ))
oetjenj has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<vulix>
havenn I read through that GIL blog post, ty
<jhass>
or maybe I stay on topic ;)
gauke has quit [Read error: Connection reset by peer]
MatthewsFace has joined #ruby
<juyhj>
#javascript is full of people.
m8tt8 has joined #ruby
motto has quit [Ping timeout: 250 seconds]
<juyhj>
I find handy watir with ruby, but I remember waiting for a new version to catch up with new versions of firefox
turtil-kun has joined #ruby
wallerdev has quit [Quit: wallerdev]
doodlehaus has joined #ruby
werelivinginthef has quit [Remote host closed the connection]
bim has joined #ruby
Igorshp has joined #ruby
bim is now known as Guest28443
Hijiri has quit [Quit: WeeChat 1.0.1]
kadoppe has quit [Ping timeout: 255 seconds]
fabrice31 has joined #ruby
<mr_snowf1ake>
so i have an alias in zsh... alias ls="ls -Gp". so when i do "type ls" it says it's an alias to ls -Gp. When I do ruby -e 'puts `type ls`' it outputs that ls is /bin/ls. is there a way to get ruby to read in these aliases? is there some equivalent to a .bashrc or .bash_profile for ruby possibly? :P
<juyhj>
askend in javascript about discovering hot keys, it seems there is not an easy way
rodfersou has quit [Ping timeout: 244 seconds]
m8 has quit [Ping timeout: 250 seconds]
rodfersou has joined #ruby
vim_shimm has joined #ruby
kadoppe has joined #ruby
<jhass>
mr_snowf1ake: you could /bin/bash -c it, but it's meh
<jhass>
just not worth it, use Dir[]/Dir.entries to list files in Ruby
zorak8 has joined #ruby
riskish has joined #ruby
chridal1 has joined #ruby
Filete has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gauke has joined #ruby
zorak8 has quit [Read error: Connection reset by peer]
Igorshp has quit [Remote host closed the connection]
<mr_snowf1ake>
jhass: my alias is in ~/.bashrc and i tried running ruby -e 'puts `/bin/bash -c "type ls"`' and it still didn't come up with the right output. hmm...
fabrice31 has quit [Ping timeout: 252 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mr_snowf1ake>
i also tried making it into a login shell with the --login option
wottam has joined #ruby
<jhass>
what's your true goal?
pengin has joined #ruby
motto has joined #ruby
pdoherty has quit [Quit: Leaving]
fryguy9 has joined #ruby
kyrylo has quit [Ping timeout: 255 seconds]
<havenn>
mr_snowf1ake: ruby -e 'puts `bash -ci "type ls"`' #=> ls is aliased to `echo omgwtfbbq!'
<mr_snowf1ake>
jhass: i have a git commit hook written in ruby. i have cmake aliased for a system specific library configuration. i want the hook to respect that
gauke has quit [Client Quit]
<mr_snowf1ake>
havenn: ooh cool, thanks!
a5i has quit [Quit: Connection closed for inactivity]
vim_shimm has quit [Ping timeout: 276 seconds]
<juyhj>
-ci interactive
doodlehaus has quit [Remote host closed the connection]
<mr_snowf1ake>
ahh, alright
<jhass>
I wonder if there isn't some environment variable convention for cmake, like there's CC and stuff
m8tt8 has quit [Ping timeout: 250 seconds]
<mr_snowf1ake>
i don't know... i tried looking for that, but couldn't find anything.
<mr_snowf1ake>
but jhass, i would agree that that is the right way to solve this..
<mr_snowf1ake>
i'll try #cmake as well
jgoyon has quit []
teddyp1cker has quit [Remote host closed the connection]
cocotton has quit [Remote host closed the connection]
m8tt8 has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
teddyp1cker has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lolmaus has quit [Quit: Konversation terminated!]
ldnunes has quit [Read error: Connection reset by peer]
hutch78 has joined #ruby
roshanavand has quit [Remote host closed the connection]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
maletor has quit [Read error: Connection reset by peer]
paulcsmith has joined #ruby
speakingcode has quit [Ping timeout: 245 seconds]
fryguy9 has quit [Quit: Leaving.]
MasterPiece has joined #ruby
hazelux has quit [Ping timeout: 250 seconds]
kirun has quit [Quit: Client exiting]
goleldar has quit [Remote host closed the connection]
willharrison has joined #ruby
failshell has quit [Remote host closed the connection]
paulcsmith has quit [Ping timeout: 245 seconds]
scripore has joined #ruby
kristofferR has joined #ruby
juyhj has left #ruby [#ruby]
ta has quit [Remote host closed the connection]
mengu has joined #ruby
mary5030 has quit [Remote host closed the connection]
<user121212>
newbee here, I'm learning the CSV library, I want to add some string into a csv inside a block, But it only adds the first row, can you help me to find the reason?
<jhass>
user121212: you're overwriting the file in each iteration
<wasamasa>
jhass: any news from our bad troll?
scripore has joined #ruby
<jhass>
not so far
allcentury has quit [Ping timeout: 252 seconds]
<user121212>
@jhass yes, should I open the csv from outside the block?
csmb has joined #ruby
<jhass>
user121212: yeah, basically swap the blocks around
m8tt8 has quit [Ping timeout: 240 seconds]
<user121212>
@jhass okay, thank you
kromm has joined #ruby
kromm has left #ruby [#ruby]
<hutch78>
Hello friends, I have been trying to debug an issue I am receiving.. I am trying to schedule cron tasks using the whenever gem. I am receiving an error in cron_error_log.log which reads “bin/rails:7: undefined method `require_relative' for main:Object (NoMethodError)”. - anyone have exprience with this ? it works PERFECT locally
zorak8 has joined #ruby
freerobby has quit [Quit: Leaving.]
<jhass>
hutch78: sounds like your server has an ancient ruby version (1.8)
<hutch78>
which ruby shows 2.1.5
mtakkman has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<jhass>
well, not inside the cron task I bet
<hutch78>
ahh
nettoweb has joined #ruby
greenbagels has joined #ruby
zorak8 has quit [Remote host closed the connection]
jxpx777_ has joined #ruby
jxpx777_ has quit [Client Quit]
moeabdol has quit [Ping timeout: 256 seconds]
JoshGlzBrk has joined #ruby
iasoon has quit [Ping timeout: 272 seconds]
JoshGlzBrk has quit [Client Quit]
turtil-kun has quit [Quit: WeeChat 1.1.1]
icebourg has quit []
zorak8 has joined #ruby
ghr has joined #ruby
evanjs has quit [Remote host closed the connection]
michaeldeol has joined #ruby
jxpx777 has quit [Ping timeout: 246 seconds]
<jhass>
?crosspost hutch78
<ruboto>
hutch78, Please do not crosspost without at least telling so. Experience shows that people don't bother to inform the other channels of provided solutions, therefore it is considered rude.
<Senjai>
jhass: Do we not use helpa anymore? j/c
<jhass>
Senjai: yeah
<Senjai>
!tips
<Senjai>
jhass: Yeah we do, or yeah we dont :P
<jhass>
ruboto is our new overlord
<jhass>
if you want any fact added, just note so ;)
<adaedra>
helpa is dead, long live ruboto
edwinvdgraaf has joined #ruby
<mr_snowf1ake>
is the source for ruboto available somewhere public? :)
freerobby has joined #ruby
freerobby1 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
TerjeLarsen has quit [Ping timeout: 250 seconds]
<dorei>
is there a way to rewrite/rethink this: @file = arg.is_a?(StringIO) ? arg : File.new(arg, 'r') ?
user121212 has quit [Quit: Page closed]
<adaedra>
Are you sure you will only have StringIO or String as input ?
<adaedra>
Can’t you have other kinds of IO, like a File or a Socket?
<jhass>
mr_snowf1ake: no
<Senjai>
Why wouldnt it be public >.>
<Senjai>
?test
<ruboto>
I don't know anything about test
<jhass>
Senjai: because we can ban and kick with it
edwinvdgraaf has quit [Ping timeout: 250 seconds]
icarus has joined #ruby
fmcgeough has left #ruby [#ruby]
<dorei>
adaedra: maybe a File
<jhass>
dorei: respond_to? to_io is a nice way to duck type on IO, afaik
<Senjai>
jhass: /cs access not good enough anymore ? :P
fmcgeough has joined #ruby
<jhass>
Senjai: programmers are lazy ;)
doodlehaus has joined #ruby
<Senjai>
jhass: Theres a plugin for that, on almost every irc client ever xD
<jhass>
Senjai: timed bans and stuff like that ;)
<adaedra>
Senjai: bot kickban can be automated and more precise than ChanServ or /mode
Skero has joined #ruby
<Senjai>
Ah
sohrab has quit [Ping timeout: 252 seconds]
<mwlang>
today is a good day. Everything I tried just worked and I had no lame questions slip out to y’all.
<mwlang>
:-)
<jhass>
automatic mask choosing by nick & auth status and so on
<adaedra>
dorei: then as jhass said, replacing your test by a duck-typing one (test for a #read method, for example) or find a common ancestor to all classes (maybe IO) would be better
<apeiros>
Senjai: cs does not support kick, and cs akick without mask goes for authname
<jhass>
not that it already does that, but it gives us the possibility
<apeiros>
Senjai: and the plan for the bot is to go by nick and automatically ban nick + ip, with the ip only for a limited time
<adaedra>
but otherwise it’s compact enough, dorei
<nemish>
if i wanted to rescue that script if /usr/bin/aws (pip awscli) wasn't installed or if aws returned error because of creds missing... how would I go about doing that
ClosedGL has joined #ruby
<nemish>
dudedudeman, yeah sorry already had it there for another channel
speaking1ode has quit [Ping timeout: 248 seconds]
<dudedudeman>
nemish: ha, i ain't mad
sgambino has quit [Client Quit]
Spami has joined #ruby
ki0 has quit [Remote host closed the connection]
<nemish>
i'm far from a ruby guy this was as good as I got... just have no idea how to rescue it :(
rgb-one has quit [Read error: Connection reset by peer]
Spami has quit [Client Quit]
speakingcode has joined #ruby
davedev2_ has joined #ruby
ghr has quit [Ping timeout: 264 seconds]
Pumukel has quit [Remote host closed the connection]
davedev24_ has quit [Ping timeout: 264 seconds]
rbennacer has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
havox has joined #ruby
RegulationD has joined #ruby
paulcsmith has joined #ruby
sevvie has joined #ruby
balazs_ has quit [Ping timeout: 256 seconds]
jottr_ has quit [Ping timeout: 240 seconds]
<bricker>
nemish: what does the command do if either of those cases are true?
Rickmasta has joined #ruby
Spami has joined #ruby
zorak8 has quit [Ping timeout: 250 seconds]
<nemish>
returns 1
narcan has joined #ruby
<bricker>
nemish: great, just check that condition and do something
<bricker>
if exit_status > 1 ...
<nemish>
rescue?
<bricker>
er
<bricker>
> 0 would be better
djbkd has joined #ruby
<bricker>
nemish: you don't need to rescue if it just returns 1.
user121212 has joined #ruby
<bricker>
Well
<nemish>
but its exit status of tags = Facter::Util::REsolution.exec
<bricker>
right, it sounds like it's just the bash exit status
<bricker>
If it works, does it return 0?
<nemish>
has to return a 0 (hence the rescue i'm guessing)
<nemish>
yes
<bricker>
yes
<bricker>
so just check the exit status
<bricker>
and do something if the exit status is non-zero
<nemish>
how do you check the exit_status on tags = ?
decoponio has quit [Quit: Leaving...]
juanpaucar has joined #ruby
theRoUS has joined #ruby
<bricker>
nemish: tags will be set to 1 or 0
theRoUS has quit [Changing host]
theRoUS has joined #ruby
mistermocha has joined #ruby
<nemish>
so basically line 9-23 would only get run if exit of tags exec is 0... else rescue just so the ruby script returns 0 exit code
thomcom has joined #ruby
<thomcom>
whoa
<thomcom>
I just got LocalJumpError: unexpected return
speakingcode has quit [Ping timeout: 256 seconds]
<thomcom>
Is early termination illegal in ruby?
<bricker>
thomcom: it's illegal from main
odin22 has quit [Read error: Connection reset by peer]
<bricker>
and from non-methods
<bricker>
class bodies and stuff
<thomcom>
my early termination is from deep in activerecord objects
mjuszczak has joined #ruby
<thomcom>
Maybe the error is something I'm not expecting then :D
<thomcom>
In a statesman transition callback actually.
<bricker>
thomcom: It's unlikely that the Rails team released a version with a LocalJumpError
ndrei has quit [Ping timeout: 256 seconds]
jottr_ has joined #ruby
<thomcom>
yup
<bricker>
. . .
<bricker>
*high fice*
<bricker>
high face*
<bricker>
high five*
<bishop>
nailed it :P
FernandoBasso has joined #ruby
<bricker>
:P
<thomcom>
statesman callback is somehow from main? From main of a thread?
<adaedra>
*high fist*
<adaedra>
ooops
riotjones has joined #ruby
mr_snowf1ake has quit [Remote host closed the connection]
mr_snowf1ake has joined #ruby
<thomcom>
ugh well now I get to cordone off half a method into an else hehe
ndrei has joined #ruby
juanpaucar has quit [Ping timeout: 265 seconds]
<dudedudeman>
Wooo! got my pickaxe book
<dudedudeman>
it's a lot thicker than i expected.....
<ninjs>
wow.. that's so dumb haha the excel libraries available for python are so much cooler than the ones for ruby
<bishop>
Could someone explain the concept whole "taint" thing for objects?
d10n-work has quit [Quit: Connection closed for inactivity]
mr_snowf1ake has quit [Remote host closed the connection]
icebourg has joined #ruby
hiyosi has joined #ruby
ss has joined #ruby
GenghisKen has quit [Ping timeout: 250 seconds]
ss is now known as Guest9823
mjuszczak has quit [Ping timeout: 276 seconds]
<bricker>
bishop: they're flags for your objects to tell the program whether the object can be trusted or not
<bishop>
What determines a trusted object
<bishop>
Like sanitization?
<bricker>
bishop: Ruby does in some places, and you can also set the flags yourself
<xxneolithicxx>
i think its used a lot by cgi/web stuff although i havent used it much myself
<nemish>
bricker, modules/ec2tags/lib/facter/ec2tags.rb:8:in `<main>': undefined local variable or method `exit_status' for main:Object (NameError)
<bricker>
bishop: so for example, the strings in ENV are automatically set to "tainted"
riotjones has quit [Ping timeout: 248 seconds]
<bricker>
nemish: it's not literally copy-and-paste "exit_status"
mjuszczak has joined #ruby
<thomcom>
Does every object have a taint flag already, or is this something you need to create yourself?
<bricker>
I'm saying your method returns an exit status, and you're setting that value to the "tags" variable
krisquigley has joined #ruby
<bricker>
thomcom: taint, untaint, trust, untrust (and related check methods) are defined on Object
lidenskap has quit [Remote host closed the connection]
<nemish>
bricker, no my variable returns array from the output of the command
Kricir has quit [Remote host closed the connection]
Nimf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nemish>
so when the exec can't find the application it fails
<bricker>
nemish: fails in what way
jerius has quit [Quit: /quit]
<nemish>
bricker, /usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in `initialize': no implicit conversion of nil into String (TypeError)
rbennacer has joined #ruby
<bricker>
nemish: sorry, there's not much I can do with that.
<nemish>
so if tags is nil
<nemish>
exit 0 rather than continuing
scripore has quit [Quit: This computer has gone to sleep]
lidenskap has joined #ruby
fryguy9 has quit [Quit: Leaving.]
<bricker>
nemish: I still don't know what you neab by "it fails"
Marabo has joined #ruby
<bricker>
mean* by
<nemish>
would !(tags.nil)? work?
colorados has quit [Ping timeout: 256 seconds]
<bricker>
nemish: `!tags.nil?` will check if tags is nil
<Marabo>
How big is Ruby compared to Python?
<xxneolithicxx>
thomcom: a common example is any data from a web app, like ENV should be considered dangerous until sanitized and explicitly marked not so. and you can make dangerous functions check the taintness of objects to decide whether to handle the data differently based on a security context level
<nemish>
if tags is not nil
<bricker>
Marabo: in LOC?
mojo619 has quit [Quit: mojo619]
<Marabo>
bricker, LOC?
<xxneolithicxx>
LOC =lines of code
Filete has joined #ruby
<thomcom>
Hehe
<thomcom>
On WINDOWS???
<Marabo>
No, semantics and libraries etc.
<thomcom>
Binary size?
krisquigley has quit [Ping timeout: 240 seconds]
narcan has quit [Ping timeout: 244 seconds]
<Marabo>
stdlib and such
<thomcom>
Hehe popularity wise?
<thomcom>
I think ruby has a MUCH bigger set of tools than python.
<thomcom>
5x
<thomcom>
Python has much much more do-it-yourself.
<bishop>
Marabo: I would say that one area where I use Python over ruby is most things math related. Python had a much larger selection of mathematical tools.
<bricker>
Marabo: calculating now...
<Marabo>
Sure, I think too. I asked the question, "How long does it take to learn Python well for a C++ programmer" in #Python and they went like, 5 years etc. So it seems pretty big language-wise.
<thomcom>
Want a python web server? There's no rails! You create your own authentication, data access layer, etc etc.
mjuszczak has quit [Ping timeout: 250 seconds]
<bishop>
Ruby is cool for web stuff, but I can't really imagine doing anything at scale with ruby long term.
<thomcom>
numpy is pretty useful bishop
<thomcom>
Seems like all that ruby is really for is web stuff at this point.
<bricker>
oh he doesn't care about source LOC
<bricker>
:(
CloCkWeRX has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
<Marabo>
I mainly want a language for web lol.
user121212 has quit [Ping timeout: 246 seconds]
<thomcom>
Ruby or Javascript :)
<bricker>
well, the answer is: mri = 1,778,753 LOC, cpython = 1,802,209
<bishop>
Oh yeah! No doubt, thomcom. I just am saying that Python generally has more math related libraries in my day to day programming
<Marabo>
But I want to know what I dig into. Like, I didn't know Python was huge.
nemish is now known as nemish_afk
oetjenj has joined #ruby
<adaedra>
who has a huge python?
<Marabo>
lol
<bricker>
Python and Ruby are basically the same. Marabo as a cpp dev you will be more at home using Python.
<thomcom>
bishop R is my favorite math language, but I have used numpy a few times when my data was already available in python
ndrei has joined #ruby
<thomcom>
Ruby is less strict than python
mjuszczak has joined #ruby
<Marabo>
bricker, Really?
<thomcom>
So if you as a C++ programmer want strictness, but versatile, go with python.
<Marabo>
I don't know but for some reason I want to go with Ruby.
<thomcom>
If you want to get as DYNAMICAL as you can, go with Ruby. :)
<ninjs>
thomcom: There is django.. it's pretty close to Rails. Also saying that Ruby has a bigger set of tools is probably false
<ninjs>
ruby has more web tools, but python has more general tools
<bishop>
Marabo, learning any language isn't something that you need to take a lot of time to consider. Virtually any programming language will give you the insight and confidence to switch later on if you don't like.
shellfu is now known as shellfu_afk
<bishop>
Given that you are looking at web-dev stuff ruby is a good place to start
<Marabo>
bishop, Yea that's what I also think.
<bishop>
Check out sinatra, it's small light-weight and you can have a working site in a weekend :)
<thomcom>
ninjs hard to argue with that. I've written a fair amount of python and it feels a lot more like the wild west to me.
<thomcom>
bishop Marabo agreed totally - it really doesn't matter much
<thomcom>
Marabo make a list of stuff you like about Ruby and become a Rubyist. Simple. :) Same thing business execs do when deciding on a tech.
<ninjs>
thomcom: I think it's all just what you are used to. Python's syntax can feel very wild west, but there's only one way to do things (python way) vs. Ruby's many ways to do things
<Marabo>
I really want to learn the language and feel comfortable with it. I mean the flow is so important. Like in C, you have header files, using the cpp files to include them, know how it works. That's what I'm mainly looking for in a language.
<bishop>
thomcom lol
<Marabo>
in C++*
<ninjs>
Marabo: both Ruby and Python have those elements
<bishop>
yep
<ninjs>
either through requiring gems in ruby, or importing libraries in python
<thomcom>
Yeah python syntax is NOT wild west, it is very strict and that is a nice thing about it. What I mean is, after doing research looking for toolsets for a variety of web and numerical tasks, Python came up short way more often than Ruby does in my experience ninjs
<Marabo>
Is Ruby as big or bigger than Python? Semantics and such. Much to learn?
<thomcom>
I miss header files Marabo
<thomcom>
You will not find them anywhere else.
<Marabo>
thomcom, They are awesome.
<thomcom>
Marabo maybe you should stay a C++ programmer
<ninjs>
thomcom: web tasks definitely. Other tasks.. I think it really just depends. I just said maybe 10 minutes ago how the libraries for working with excel files are drastically better than the ones available for ruby.
rbennacer has quit [Remote host closed the connection]
<jhass>
Marabo: I'd say syntax is less, there's some redundancy in some semantics you can safely ignore for quite a while though
tosbourn has joined #ruby
<Marabo>
thomcom, How so?
<thomcom>
When I was a C++ programer I really believed in code beauty. Now that I know ten languages and work with varied groups I know that all code is shit.
<ninjs>
thomcom: I'm not sure I meant that syntax is wild west, but you don't often have the simple methods that good ruby code exhibits.
<thomcom>
So, keep the innocence and make beautiful code. Nothing brings me more pleasure still than a well organized header file. :D :D
<jhass>
Marabo: a surprising amount of stuff is just method calls or syntax sugar for them
<bricker>
thomcom: all code is shit, just write it, collect paycheck, move on.
amstv has quit [Ping timeout: 246 seconds]
<bishop>
Marabo, Don't sweat syntax.
<Marabo>
jhass, Yea did read that :p
<thomcom>
bricker ikr
<Marabo>
Will any background in C++ help learning Ruby?
mary5030 has joined #ruby
<bricker>
Marabo: yes
<bricker>
But, also Python
<thomcom>
Oh strict indentation is also AWESOME
tosbourn has quit [Remote host closed the connection]
<jhass>
Marabo: blocks is probably the hardest part to grasp, after that it's easy
freerobby1 has quit [Quit: Leaving.]
<bishop>
object oriented yo
GenghisKen has joined #ruby
<Marabo>
I don't like Django, really. And as I said, I want a web language.
<Marabo>
So I much rather use Rails.
<thomcom>
You'll have no trouble with Ruby Marabo. There will be weird syntaxes that take you a long time to accept, but the core principles are always the same from language to language (except functional) hehehe
<bishop>
Learn you a Haskell for great good
Guest9823 has quit [Ping timeout: 250 seconds]
<Marabo>
thomcom, Yea that's true. But the #Python guys scared the sht out of me telling me it would take 5 years to decade to become good at Python.
<thomcom>
know haskell bishop?
<Marabo>
I was like, it took me 3 years for C++..
<thomcom>
Yeah I think they probably just meant it will take you 5 years to reproduce PEP 8 exactly and perfectly without fail.
<jhass>
Marabo: well, that's because "good" is arbitrary
<Marabo>
jhass, True,
<jhass>
so you were up to the interpretation of it of whoever was around
colorados has joined #ruby
mengu has quit [Remote host closed the connection]
<Senjai>
Marabo: Deciding to be a good programmer is hard. Especially if you work for or around terrible people
<Senjai>
That decision means leaving that position.
<Marabo>
What I mean by good is to really be able to do what you want and understand one of the best ways of doing it.
<Senjai>
A lot of people just stick it out for the paycheck and have no intetion on getting better, just getting the job done
<Marabo>
Senjai, Currently I'm doing it for myself.
<bishop>
That's nonsense. Find something you like. Make some things you like. Don't sweat the gurus, then you will become one. It's all just experience
<Senjai>
Marabo: If you're not already in the industry, you're set!
<jhass>
a common saying is that to truely master a language you need to work for 10 years with it, but I'd say you're usually productive with it already in less than 6 months, less even depending on your prior skillset
<Marabo>
Senjai, Got 5 years until I get into the industry :p
<Senjai>
Marabo: Nonsense, took me 5 months of self teaching, I'm sure you could do the same
<thomcom>
Honestly who wants to be a true language master
<thomcom>
10 years is 1.5 epochs in computer time
iasoon has joined #ruby
<thomcom>
30 years is literally 5 pivotal changes in technology
<thomcom>
or more
<Senjai>
Marabo: The hardest thing to understand about code, is that its just code. No matter what language, it all works the same. Things call other things.
mary5030 has quit [Ping timeout: 250 seconds]
fryguy9 has joined #ruby
lukec has quit [Quit: lukec]
<thomcom>
the more you know the better, because the better equipped you will be to completely abandon what you were doing and do something different
<Marabo>
Of course, mastering something will take a life time. But as I said before, what I mean by being good is to really do what you want. "Oh I want to create a web application x that does y".
<Senjai>
Marabo: Like league of legends? Do something cool with its api
<Senjai>
Like games? make a tetris clone
<Senjai>
Like networking? Make an IRC client
<thomcom>
indeed Marabo
<thomcom>
Make Stuff
<Senjai>
and so on and so forth
<Marabo>
Senjai, I have made a NES emulator in C++.
<Senjai>
Marabo: That's impressive
<thomcom>
Only by making stuff in your spare time will you truly become a master. :D
<Senjai>
Marabo: open source?
<thomcom>
I have 4 kids so I don't do much in my spare time anymore :D
<thomcom>
Except play Pillars of Eternity
<Marabo>
Senjai, Nop. It was for Uni project.
<Senjai>
thomcom: That'd slow ya down
<Marabo>
Senjai, Too overkill.
<Senjai>
Marabo: lol what? Uni project? :P
<Marabo>
But I needed the grade badly.
<Marabo>
Yes.
<Marabo>
University.
<Senjai>
I get it
freerobby has joined #ruby
<Senjai>
That just sounds like a very long project for uni
<Senjai>
Like horribly involved
michaeldeol has joined #ruby
<Senjai>
Marabo: You should open source it
<Marabo>
Senjai, Not really, but took some time.
<Marabo>
Senjai, How so?
havox has joined #ruby
<thomcom>
Pretty awesome Marabo
<thomcom>
Emulators are deep technology to build
<thomcom>
You should open source it because it is good resume materual.
<thomcom>
If I interviewed you and knew you wrote an emulator I would want to hire you probably.
<eam>
which is why it's a good idea to open source stuff -- published material is your resume
<thomcom>
more important than any piece of paper
elfuego has quit [Quit: elfuego]
<Marabo>
I don't see it as a big deal tho but yea sure maybe I will open source it.
postmodern has joined #ruby
x1337807x has quit [Ping timeout: 272 seconds]
<Senjai>
thomcom: Eh, wouldn't go that far. You can accomplish anything and still write terrible terrible code
<Senjai>
Marabo: You should
Renich has joined #ruby
<Senjai>
Open source EVERYTHING
djbkd has quit [Remote host closed the connection]
<postmodern>
say you follow semver, and you have a method that returns a Hash{String => String}, but you want to include additional data in that Hash, how do you maintain backwards compatibility? Make a String-like class?
<xxneolithicxx>
can you add an optional param to the method :compat = false and if compatibility return the new hash otherwise the old one and remove the compat setting with the transition to next major version
nettoweb has joined #ruby
<xxneolithicxx>
reverse what i said, :compat = true
hazelux_ has quit [Remote host closed the connection]
tearan_ has joined #ruby
failshell has joined #ruby
<postmodern>
jhass, er the data will be added to the value, not the key
<jhass>
I was more seeking an example you can't fake metaprogramatically (I think I made that up right now :D)
dfinninger has quit [Remote host closed the connection]
jgrevich has joined #ruby
<jhass>
I like xxneolithicxx idea, let the caller explicitly enable the new behavior until next major
mjuszczak has quit []
<eam>
>> special="a string"; special.instance_eval { def extra(x=nil); @x=x if x;@x; end }; special.extra "data"; [special, special.class, special.extra]