<darix>
LesZedCB: as apeiros demonstrated string.freeze only works for literals
<darix>
not for strings you create on the fly
<LesZedCB>
gets.freeze works
<apeiros_>
LesZedCB: it works. but it doesn't deduplicate.
Averna has joined #ruby-lang
<apeiros_>
gets.freeze.object_id will not be == to another frozen string.
gix has quit [Quit: Client exiting]
<apeiros_>
even if their value is the same
<LesZedCB>
ah, yup
<apeiros_>
they could make it that way, effectively replacing gc'able symbols with frozen strings. and yes, it might be viable. but I don't have numbers.
<LesZedCB>
I'd be interested in testing that
<apeiros_>
it would not be backwards compatible, mind you. currently strings and symbols are not eql?, and therefore not considered the same keys in hashes, or the same values in sets, etc.
<darix>
rails has a special class for this iirc?
<apeiros_>
yes
<apeiros_>
HWIA
<apeiros_>
(HashWithIndifferentAccess)
<LesZedCB>
haha nice
<apeiros_>
worst thing they created IMO.
<LesZedCB>
is it slow?
modred11 has joined #ruby-lang
<LesZedCB>
I guess it would be, seeing as that fits with Rails' theme
martinbmadsen has quit [Ping timeout: 255 seconds]
nedp has joined #ruby-lang
smoitra has joined #ruby-lang
stardiviner has joined #ruby-lang
riotjones has joined #ruby-lang
chadwtaylor has joined #ruby-lang
marr has joined #ruby-lang
revath has quit [Ping timeout: 244 seconds]
chadwtaylor has quit [Ping timeout: 252 seconds]
erowlin has joined #ruby-lang
<erowlin>
Hello ! I’m looking for a method to escape some string on the controller side of Rails, to allow the string to be passed as an SQL Statement
<erowlin>
Input : “abc’def”. Output : “abc\’def”
<erowlin>
Should I write a regexp rule ?
<apeiros_>
erowlin: rails is #rubyonrails
<erowlin>
OH shhh..
<erowlin>
Thx sorry
<apeiros_>
also, don't interpolate strings into sql
<apeiros_>
use bind variables
ghostpl_ has joined #ruby-lang
<Eising>
+1 on that
<Eising>
recipe for disaster
auzty has joined #ruby-lang
ghostpl_ has quit [Ping timeout: 252 seconds]
Integralist has quit [Quit: leaving]
riffraff has joined #ruby-lang
stef204 has joined #ruby-lang
erowlin has quit [Quit: erowlin]
cornerma1 has joined #ruby-lang
hhatch has quit [Read error: Connection reset by peer]
hhatch has joined #ruby-lang
cornerman has quit [Ping timeout: 272 seconds]
cornerma1 is now known as cornerman
toretore has joined #ruby-lang
Musashi007 has joined #ruby-lang
erowlin has joined #ruby-lang
martinbmadsen has joined #ruby-lang
<maloik_>
oh my, youtube disco was shut down :o
<maloik_>
didn't you use that a lot yorickpeterse ?
maloik_ is now known as maloik
erowlin has quit [Client Quit]
arBmind has joined #ruby-lang
goodcodeguy has joined #ruby-lang
goodcodeguy has quit [Ping timeout: 252 seconds]
gwendall has joined #ruby-lang
<yorickpeterse>
morning
<yorickpeterse>
maloik: no
erowlin has joined #ruby-lang
revath has joined #ruby-lang
SuMo_D has joined #ruby-lang
gwendall has quit []
SuMo_D has quit [Ping timeout: 265 seconds]
Musashi007 has quit [Quit: Musashi007]
arBmind has quit [Quit: Leaving.]
charliesome has quit [Quit: zzz]
charliesome has joined #ruby-lang
ghostpl_ has joined #ruby-lang
intinig has quit [Remote host closed the connection]
ghostpl_ has quit [Ping timeout: 264 seconds]
jsaak has quit [Ping timeout: 246 seconds]
amystephen has joined #ruby-lang
workmad3 has joined #ruby-lang
hendranata_ has quit [Ping timeout: 264 seconds]
wdiechmann has joined #ruby-lang
LMity has joined #ruby-lang
arBmind has joined #ruby-lang
jsaak has joined #ruby-lang
<wdiechmann>
trying to do some dev with someone on windows - he’s ruby 2.2.1 and I’m mac 10.10.2 (with ruby 2.1.3 tops) - how do we get on mutual ground?
<wdiechmann>
we could both be ruby 2.1.5 - but then my bundle install can not find any thread_safe.0.3.5 ?!?!
LMity2 has joined #ruby-lang
LMity has quit [Ping timeout: 244 seconds]
NoNMaDDeN has joined #ruby-lang
erowlin has quit [Ping timeout: 252 seconds]
intinig has joined #ruby-lang
erowlin has joined #ruby-lang
LMity has joined #ruby-lang
auzty has quit [Quit: Leaving]
NoNMaDDeN has quit [Ping timeout: 246 seconds]
skade has joined #ruby-lang
LMity2 has quit [Ping timeout: 272 seconds]
bruno- has joined #ruby-lang
chadwtaylor has joined #ruby-lang
x44x45x41x4E has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 256 seconds]
chadwtaylor has quit [Ping timeout: 272 seconds]
LMity has quit [Ping timeout: 264 seconds]
j4cknewt has joined #ruby-lang
arBmind1 has joined #ruby-lang
jds has joined #ruby-lang
arBmind has quit [Ping timeout: 245 seconds]
erowlin has quit [Quit: erowlin]
j4cknewt has quit [Remote host closed the connection]
<darix>
wdiechmann: that small difference shouldnt matter all that much
nedp has quit [Remote host closed the connection]
ghostpl_ has joined #ruby-lang
ghostpl_ has quit [Remote host closed the connection]
ghostpl_ has joined #ruby-lang
<darix>
wdiechmann: stay in the channel
<darix>
and if you have a gemfile with thread_safe.0.3.5 as gem name
<darix>
that is wrong
havenwood has quit [Remote host closed the connection]
<wdiechmann>
sorry - will stay here :$
<wdiechmann>
no - don’t have any thread_safe menitioned in my gemfile
<apeiros_>
wdiechmann: what do you use to install ruby?
<wdiechmann>
chruby - came from rbenv - but swiitched to use auto - I have 5-6 different versions of ruby in production :(
<wdiechmann>
but if rbenv will let me find a common ground with M$ - then so be it :)
<apeiros_>
wdiechmann: then just install 2.2.1
erowlin has joined #ruby-lang
rbowlby has joined #ruby-lang
<wdiechmann>
@apeiros - how did that escape me? Sorry to have waisted your bandwidth guys :$
<wdiechmann>
and thx for stepping up @darix and @apeiros!
rbowlby has quit [Ping timeout: 244 seconds]
smoitra has quit [Read error: Connection timed out]
smoitra has joined #ruby-lang
pepperbreath1 has quit [Quit: Leaving.]
haraoka__ has quit [Ping timeout: 245 seconds]
pepperbreath has joined #ruby-lang
fusillicode has joined #ruby-lang
j4cknewt has joined #ruby-lang
fusillicode1 has quit [Ping timeout: 246 seconds]
j4cknewt has quit [Remote host closed the connection]
iamninja has quit [Read error: Connection reset by peer]
fusillicode has quit [Ping timeout: 252 seconds]
j4cknewt has joined #ruby-lang
fusillicode has joined #ruby-lang
fusillicode has quit [Client Quit]
j4cknewt has quit [Remote host closed the connection]
fusillicode has joined #ruby-lang
j4cknewt has joined #ruby-lang
ttilley has joined #ruby-lang
ttilley has quit [Changing host]
ttilley has joined #ruby-lang
smoitra has quit [Read error: Connection timed out]
ghostpl_ has quit [Remote host closed the connection]
j4cknewt has quit [Remote host closed the connection]
fusillicode1 has quit [Ping timeout: 240 seconds]
j4cknewt has joined #ruby-lang
Integralist has joined #ruby-lang
levifig has quit [Max SendQ exceeded]
levifig has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
chinmay_dd has joined #ruby-lang
symm- has joined #ruby-lang
fusillicode has joined #ruby-lang
smoitra has quit [Read error: Connection timed out]
smoitra has joined #ruby-lang
ghostpl_ has joined #ruby-lang
chinmay_dd has quit [Quit: Leaving]
j4cknewt has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
certainty has quit [Ping timeout: 276 seconds]
certainty has joined #ruby-lang
chadwtaylor has joined #ruby-lang
stamina has joined #ruby-lang
morfeen has joined #ruby-lang
smoitra has quit [Read error: Connection timed out]
<morfeen>
how are name collisions avoided in Ruby classes when multiple modules are imported? Apologize if it is a noob question
chadwtaylor has quit [Ping timeout: 244 seconds]
<yorickpeterse>
They are not, they append to each other
<yorickpeterse>
or overwrite what already existed
<morfeen>
yorickpeterse: So ideally when you write a module, how do you minimize this issue?
<morfeen>
or is it not possible?
<workmad3>
morfeen: good naming practices, mostly... give your methods names that are decently descriptive rather than short and overly general
<workmad3>
morfeen: that way, it's rare to hit a conflict because most people aren't going to import two modules into a single class that do the same thing (i.e. we assume that people are sensible)
<morfeen>
workmad3: apart from that, does Ruby not provide any constructs to mitigate this problem?
<morfeen>
can the concept of namespaces be used alongside modules?
<yorickpeterse>
Ruby has no actual namespaces
<workmad3>
morfeen: tbh, most of the time it's not a problem, and it's also a very useful feature to allow because it provides the ability to decorate methods and wrap them up with new functionality
<yorickpeterse>
You can nest things in modules/classes, which more or less acts as a namespace
<morfeen>
I see.
ghostpl_ has quit [Read error: Connection reset by peer]
<workmad3>
morfeen: in cases where there's a higher chance of conflict, and the conflict could be bad, I've seen gems use a naming convention along the lines of '_<gem_name>_<method_name>', refer to those methods in their own internals and alias their API to just <method_name>
<morfeen>
right
<workmad3>
morfeen: but it's pretty rare (I've mostly seen it in rails plugins where the gem was exposing something like a .search method, and it's not that unheard of to have multiple search mechanisms in a single webapp)
<workmad3>
morfeen: with good, descriptive naming practices though, it's a pretty uncommon problem
sgambino has joined #ruby-lang
ixil has joined #ruby-lang
Integralist has quit [Quit: leaving]
<workmad3>
morfeen: any particular reason you're concerned about it? just general curiosity, or got burned by it, or...?
<morfeen>
Well, I'm new to Ruby and I see the possibility of it causing difficult to trace bugs.
<morfeen>
in a big codebase, ie
<morfeen>
But I don't know how often it happens in practice. so.
ghostpl_ has joined #ruby-lang
<workmad3>
morfeen: my experience is that name collisions are much more likely to be deliberate, with the aim of providing decorator methods that call 'super' in their implementation (which calls the shadowed method), and next most likely is that someone is using an overly generic name (especially when they mix a module into something like an ActiveRecord::Base derived class that has a *huge* interface)... someth
<workmad3>
ing like 'search' or 'save'
<toretore>
morfeen: the only times i've encountered it is when someone did something stupid they shouldn't have
<workmad3>
morfeen: that sort of collision is normally pretty easy to detect because it causes you major difficulties straight away
<toretore>
morfeen: namely, "monkey patching"
<toretore>
monkey patching bein the inverse of what i deem proper use of mixins: mixing other modules into ones that you control
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
and not mixing your own modules into others that you don't control, re workmad3's AR::B example above
<workmad3>
toretore: well, my example was that you have a class you *do* control, e.g. class MyStuff < ActiveRecord::Base, but you mix in something that shadows or messes around with something from AR::B
<workmad3>
toretore: unless you consider your own subclasses of library/framework provided base classes to be stuff you don't control ;)
<toretore>
ok, that's kosher
<morfeen>
toretore: I've worked in a company where monkey patching was more of the norm. the codebase was 9-10 years old, people came and left. Such products/companies could burn themselves.
iamninja has joined #ruby-lang
iamninja has quit [Client Quit]
<toretore>
monkey patching is bullshit, plain and simple
iamninja has joined #ruby-lang
<morfeen>
But for small teams who iterate fast, it should not be an issue.
<toretore>
when i hear "iterate fast" i think of it as a euphemism for "don't give a shit and just make it work"
<toretore>
sometimes i think we need to iterate slower
<workmad3>
toretore: monkey patching can be a very useful exploratory technique, so I wouldn't want to get rid of it completely
<workmad3>
toretore: e.g. figuring out what part of a library has a bug, so you figure out a monkey-patch in IRB that you then use to fork the library, apply the patch and create a PR (and use your fork while waiting for the PR to be accepted)
<workmad3>
but yeah, I'd be happy to impose a 'no monkey-patching on production code' restriction
skade has joined #ruby-lang
<morfeen>
workmad3: in most of the "enterprisey" companies, with large codebases, developers have no choice. There is usually no single person who knows how it all fits together
<toretore>
sure, i'm talking about code that's supposed to be "done"
erowlin has joined #ruby-lang
<toretore>
morfeen: it takes discipline, that's why it's so rare
<workmad3>
morfeen: I've yet to come across a situation where monkey-patching was the only way to achieve something... it might be the slightly quicker way to achieve something, but at the expense of future comprehensibility and stability of your code
<toretore>
in large codebases you get broken windows, and after a while people just stop caring
<morfeen>
workmad3: it usually happens with legacy code bases.
<toretore>
so you have to be disciplined to make sure you don't break any windows in the first place
<morfeen>
I've had the misfortune of working with one of them.
<toretore>
or keep your window breaking very isolated
<toretore>
and then there's external factors like "this absolutely has to be done by friday", which is very rarely the case
x44x45x41x4E has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j4cknewt has joined #ruby-lang
yalue has joined #ruby-lang
morfeen has quit [Remote host closed the connection]
j4cknewt has quit [Remote host closed the connection]
<havenwood>
Guest35511: Documentation is a nice way to contribute, and you can learn a lot reading the documentation trying to find some that is lacking to fill in.
<Guest35511>
so should i begin with building up the source?
<havenwood>
Guest35511: Sure, build from source and get rolling.
<Guest35511>
yeah i have already been through them and i would like to know more about multiple thrading and fine grained locking project
<havenwood>
Guest35511: Are you an experienced C hacker?
NoNMaDDeN has quit [Ping timeout: 246 seconds]
<Guest35511>
no but i am experienced with multi-threading and coding.
<havenwood>
Guest35511: Doing anything with MRI's GVL is going to require quite a bit of study of its C internals. It's quite a huge task. But if you want a challenge, that's sure a hard one!
ttilley has quit [Quit: Leaving...]
<Guest35511>
that's not the problem but problem is where to start?
<womble>
"My favourite was some time ago, and involved a female customer thanking "Mr. Daemon" for his effort trying to deliver her mail, and offering him a "good time" if he ever visited Sydney." -- Matt McLeod
j4cknewt has quit [Remote host closed the connection]
symm- has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
<wallerdev>
lol
<jhass>
wallerdev: what training camp did you visit to understand that question? :P
<SylarRub_>
wallerdev: works! Thanks!
<wallerdev>
lol
<wallerdev>
i am amazing
<jhass>
indeed
ur5us has joined #ruby-lang
<SylarRub_>
wallerdev: f-ing amazing!
<wallerdev>
anyone here work at amazon
<womble>
They're all f-ing amazoning
ur5us has quit [Remote host closed the connection]
j4cknewt has joined #ruby-lang
skyrocker has quit [Read error: Connection reset by peer]
<darix>
womble: that quote up there from twitter or so?
<womble>
darix: Usenet, c. 2003
<darix>
ok
skyrocker has joined #ruby-lang
mberk has joined #ruby-lang
relix has quit [Read error: Connection reset by peer]
relix has joined #ruby-lang
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SuMo_D has joined #ruby-lang
j5s7 has joined #ruby-lang
SuMo_D has quit [Ping timeout: 256 seconds]
j5s7 has quit [Client Quit]
<zenspider>
wallerdev: what's up? I don't work at amazon (anymore) but have several contacts who do
<wallerdev>
theyve been trying to recruit me for awhile and sent me soemthing about an "expedited interview event" where they either make an offer or dont and you interview with multiple teams
lnr has joined #ruby-lang
lnr has left #ruby-lang [#ruby-lang]
<wallerdev>
didnt know if anyone had any experience with that
<wallerdev>
haha
<wallerdev>
sounds like theyre probably trying to hire a lot of people at once
<zenspider>
speed dating?
<wallerdev>
lol basically
<wallerdev>
you do one interview
<wallerdev>
per team
<wallerdev>
and they make an offer or dont at the end of it
Leif___ has quit []
BlackMustard has joined #ruby-lang
<zenspider>
normally you do N people from 1 team. if they think you're good but not a fit for that team, they schlep you off to another hiring manager and you repeat
<zenspider>
this sounds better
<wallerdev>
yeah thats what im used to
<wallerdev>
dont think i want to leave SF though
<wallerdev>
could be the future of interviewing though!
sulky has joined #ruby-lang
mberk has quit [Remote host closed the connection]
shtirlic has quit [Ping timeout: 252 seconds]
dbussink has quit [Ping timeout: 252 seconds]
Guest9519 has quit [Ping timeout: 252 seconds]
dbussink has joined #ruby-lang
<zenspider>
wallerdev: amazon will NOT be leading the future of interviewing
<zenspider>
no more than google ever will
shtirlic has joined #ruby-lang
<wallerdev>
haha
<wallerdev>
you never know
Olipro has joined #ruby-lang
<wallerdev>
maybe they'll invent the amazon fire interviewer HD
fujimura has joined #ruby-lang
BlackMustard has quit [Excess Flood]
yfeldblum has quit [Remote host closed the connection]
fujimura has quit [Ping timeout: 244 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BlackMustard has joined #ruby-lang
yfeldblum has joined #ruby-lang
j4cknewt has quit [Read error: Connection reset by peer]
j4cknewt_ has joined #ruby-lang
joaomdmoura has quit [Remote host closed the connection]