<Casty>
hey guys i'm learning ruby/rails. i'm making a calculator to train and made a method that can parse a string like "5 + 6 * 2" and compute it. i made a simple javascript front but can't figure out how to pass the value of the text box to my method. is this hard to do?
cmisenas has joined #ruby
rcvalle has quit [Quit: rcvalle]
<jhass>
?rails
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
jaycee has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Casty>
ah ok thanks
<RickHull>
Casty: your text box is a form input. when you hit submit, it sends a POST request to the webserver (rails)
x1337807x has quit [Ping timeout: 264 seconds]
<RickHull>
rails will then, based on routing rules and such, call the correct method to handle it
<Ox0dea>
jhass: Bit heavy for a calculator, no?
<RickHull>
calculator is an exercise to learn rails, here
<Ox0dea>
I derped pretty hard there.
<Casty>
oh well actually i'm not posting the form. but i guess that makes sense. until i would the value is still just client side. thanks
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<ruby-lang087>
want to take a list of IPs/hostnames in a file and use net::ssh to execute a command
<ruby-lang087>
aoutput the result
<ruby-lang087>
and output the result**
<RickHull>
net/ssh is pretty tricky
djbkd has quit [Client Quit]
_seanc_ has quit [Quit: _seanc_]
baweaver has joined #ruby
<ruby-lang087>
lol why the hell do you hate pastebin?
<cosmicfires>
I can redirect the output with >
<ruby-lang087>
weird
<RickHull>
ruby-lang087: quote: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<ruby-lang087>
Alrighty, will keep in mind :)
wookiehangover has joined #ruby
<RickHull>
if you want people to read what you write, it helps to read what they write ;)
aaeron has quit [Quit: Leaving.]
<RickHull>
cosmicfires: ok, so take something you know works, like `ls`
<RickHull>
and try using it with tee
<shevy>
ruby-lang087 the more convenient you make it for other people to read it, the more likely it will be that they (a) can help and (b) will want to help
<cosmicfires>
that works
jenrzzz has quit [Ping timeout: 240 seconds]
<shevy>
that code looks like dynamic constant assignment, are you sure it works?
<RickHull>
cosmicfires: ok, so show your example where your program redirects STDOUT to a file
<RickHull>
i.e. just the cmdline session
<RickHull>
e.g. my_script.rb > /tmp/output; cat output
<ruby-lang087>
I am trying to cut my programming teeth on ruby
<ruby-lang087>
so what I am doing might be really bad
<cosmicfires>
ls | tee net.status.log
<ruby-lang087>
I know not what I do
<cosmicfires>
that works
<shevy>
yeah
<ruby-lang087>
but trying to know
<RickHull>
cosmicfires: use gist.github.com
<shevy>
your code does not seem to make any sense to me
<shevy>
you essentially try to do two things here:
<cosmicfires>
you want the whole program?
<shevy>
- handle ARGV input given to your script
<shevy>
- send data based on ARGV into a Net::SSH.start() call
<shevy>
right?
<RickHull>
cosmicfires: just your CLI sessions
<shevy>
oh wait
<ruby-lang087>
yes, namely the line item contents of a file
<shevy>
you actually try to read in a file
<ruby-lang087>
say, hosts.txt
<RickHull>
where you demonstrate that file redirection works
<shevy>
ruby-lang087 ok, first suggestion: put this into a method
allcentury has quit [Ping timeout: 256 seconds]
<shevy>
in the method, default to 'hosts.txt'
<shevy>
thus if you omit ARGV, it will use that name
jenrzzz has joined #ruby
<shevy>
inside that method, process the data until you can send it into Net::SSH.start()
ramfjord has quit [Ping timeout: 256 seconds]
umgrosscol has joined #ruby
houhoulis has joined #ruby
<RickHull>
ruby-lang087: use lowercase for variables you want to assign to
<RickHull>
uppercase denotes a constant, which is not what you want here
<RickHull>
e.g. host, user rather than HOST, USER
<RickHull>
i would then do something like: host = i.chomp; puts host
<RickHull>
note that puts automatically adds a newline, whereas print does not. you almost certainly want puts
hotpancakes has quit [Remote host closed the connection]
<RickHull>
stick that in xml.erb file
<RickHull>
then call erb --value=bar xml.erb
<RickHull>
NOPE
djbkd has joined #ruby
<RickHull>
technically it would be <%= value %> or w/e
<RickHull>
i mean, wouldn't that be the most basic use case?
pontiki has joined #ruby
<RickHull>
that is, if i didn't give a shit about ruby and only cared about templating
serivich has quit [Ping timeout: 255 seconds]
<rgb-one>
RickHull: Ah. I actually do have an understanding of yield after using it in the main layout.haml file to retrieve content from index.haml. I suppose yield partials as well.
<RickHull>
the problem is, erb assumes you have an entire ruby ecosystem generating template values, and it will hook into that
francois_ has quit [Ping timeout: 256 seconds]
n3vtelen has quit [Ping timeout: 244 seconds]
<RickHull>
rgb-one: cool, still got a question?
<rgb-one>
Yea I will clarify in a bit.
<pontiki>
hi o/
RegulationD has quit [Ping timeout: 264 seconds]
<RickHull>
pontiki: is that like contiki pon da floor?
mary5030 has quit [Remote host closed the connection]
<pontiki>
no
<RickHull>
:(
torpig has joined #ruby
<shevy>
it's more like pocahontas RickHull
<RickHull>
oh no, i'm ineligible for contiki in 2 weeks
<ruby-lang087>
all great stuff, you guys have been most helpful
<shevy>
there used to be ponbiki here as well
<RickHull>
more like poke-a-hotness amirite?
<shevy>
poke anything anyway
<ruby-lang087>
I've always liked tabs for indentation for some reason
* RickHull
poke
<ruby-lang087>
but I guess they are overkill
<RickHull>
ruby-lang087: nothing wrong with the TAB key
<RickHull>
but don't put TAB chars in source control
<RickHull>
make your editor convert TAB key to 2 spaces
jhooker has quit [Ping timeout: 252 seconds]
<RickHull>
or do auto-indent to 2 spaces
micmus has quit [Ping timeout: 252 seconds]
<shevy>
ruby-lang087 I used to be a tabster as well
<shevy>
until I started to align comments
<shevy>
then it no longer worked
<shevy>
then I wondered why I was using tabs anyway
CalvinnHobbes has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
<RickHull>
ruby-lang087: what editor are you using?
dalafa has joined #ruby
<pontiki>
why not just let the editor do it, as RickHull says
<RickHull>
well, when you're just getting started with a new lang, it's hard to know which editor to use or how to do the right thing for you language
<pontiki>
it is?
<RickHull>
yes, and beyond that, it's hard to know how much the editor *can* do for your lang
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki>
i don't switch editors for new languages...
<pontiki>
i didn't know people did that, even
<RickHull>
i'm guessing if you went from C# to ruby
<RickHull>
you might switch editors
<pontiki>
it's be the other way if i did, but i'd probably still use emacs
<RickHull>
emacs is the One True Editor
<shevy>
it's also a good OS
<RickHull>
but still, ruby-lang087 is new to ruby
<shevy>
he uses notepad
<RickHull>
and we don't know his background
<RickHull>
(or her)
<shevy>
((or it))
<RickHull>
notebad > visual studio, so that's a start
yoongkang has joined #ruby
<pontiki>
plain old windows notepad?
<pontiki>
not notepad++
<pontiki>
?
<rgb-one>
With the `= yield` statement I have come across so far, the content of external files is loaded. For example, The content of an index.haml file is yielded from a `layout.haml` file to produce resulting html file with both of the content integrated when compiled. In the context shown above (= yield_content :head), what exactly does yield_content do?
<RickHull>
i'd rather teach a newbie starting from notepad than VS
<pontiki>
i admit i've never developed on windows
lampd1 has joined #ruby
<lampd1>
hey all; so, I'm drawing a blank... how would one cast the current browser window width/height from a sinatra frontend into the ruby app running it?
<shevy>
rgb-one you must look up the API docu for that method
<pontiki>
so i don't know what VS would be like. my sense is it's like xcode and eclipse, though
<shevy>
it is a custom method after all
<RickHull>
pontiki: close enough
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<RickHull>
rgb-one: yeah, consult the docs. there are many forms
<RickHull>
but almost always there will be API/reference docs
<RickHull>
that cover classes and methods
_seanc_ has joined #ruby
daveg_ has joined #ruby
jamesaxl has quit [Remote host closed the connection]
bogdanteleaga has quit [Ping timeout: 256 seconds]
<lampd1>
oh doi; just ajax that junk in there
* lampd1
is a doofus
<lampd1>
been a long day; and i spent most of it writing C#
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<RickHull>
lampd1: using what editor?
<lampd1>
monodevelop
<RickHull>
use it for ruby too?
aspiers has quit [Ping timeout: 255 seconds]
<lampd1>
nah
<lampd1>
vim
<lampd1>
and cant stand mono without vim
<RickHull>
cool, just checking :)
<lampd1>
mod
<lampd1>
e*
<lampd1>
jeez
x1337807x has joined #ruby
<lampd1>
i'd use VS but i'm writing C# on a mac :P
cmisenas has quit [Quit: cmisenas]
<RickHull>
lolz
micmus has joined #ruby
<RickHull>
is this because of the new .NET open source push?
hotpancakes has joined #ruby
<lampd1>
unity3d :)
bogdanteleaga has joined #ruby
<lampd1>
i aint doin web in C# that's cray talk
<lampd1>
:D
ScriptGeek has joined #ruby
<lampd1>
working on a sidekiq/sinatra/rmagic image processor to embed in a unity game haha
<ScriptGeek>
how to check if a character is equal to the ESC key character?
<rgb-one>
:) Thanks, the docs were helpful.
<ScriptGeek>
if character == '\e'
daveg_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruby-lang087>
RickHull: Would you shame me too greatly if I said textwrangler? ;p
<ScriptGeek>
is that supposed to work?
<pontiki>
textwrangler is a damn fine editor on the mac
jcaho has quit [Read error: Connection reset by peer]
pereba has quit [Quit: A clean quit, because my messages are already in your mind.]
jcaho has joined #ruby
<ruby-lang087>
I'm new to programming in general, I mean I've done some bash one-liners and I can do markup like crazy and I've done some pretty mundane stuff that took form inputs and made consistent ebay listings and whatnot
<ruby-lang087>
but with ruby I am trying to actually learn to program
<ScriptGeek>
ruby is pretty cool
someword has joined #ruby
<lampd1>
ruby-lang087: play with some async job processing
<lampd1>
it's fun to do functional stuff w/ it
<lampd1>
:)
braincra- has quit [Quit: bye bye]
<lampd1>
i.e. sidekiq/resque
Forgetful_Lion has joined #ruby
<lampd1>
then add some shit on top of that
<lampd1>
*bam*
<lampd1>
you got a cool async functional processing setup
<lampd1>
and probably a good place to start in terms of ruby web
<lampd1>
can make a website, get familiar with ruby; and then look @ rails and decide if you want to invest time in it or not
<pontiki>
i did my resume site in middleman
<pontiki>
quite nice working with it, really
<lampd1>
yeah; i like it
<lampd1>
esp tying it into APIs
<lampd1>
to make lightweight webapps
bruno- has quit [Ping timeout: 256 seconds]
<lampd1>
having a backend on a webapp = technical debt
<lampd1>
:P
<pontiki>
anything you create accrues technical debt
<lampd1>
yeah; but storage of data is the most concerning
<lampd1>
and offloading that piece is nice
<lampd1>
at least imo
<lampd1>
but then you have to worry about the API going *poof* :P
<ScriptGeek>
al2o3-cr: awesome, thanks for the tip!
<lampd1>
since it aint under your control
yeticry has quit [Ping timeout: 276 seconds]
<RickHull>
eh, just use gh-pages for resume, etc
<al2o3-cr>
ScriptGeek: :)
<Obfuscate>
lampd1: The main problem with a static site frontend that loads all its content with javascript/ajax is that your SEO now sucks.
<pontiki>
unless your app needs no persistence, you're always going to need a backend somewhere, even if it's local storage
baweaver has quit [Ping timeout: 246 seconds]
<lampd1>
API == backend
<lampd1>
like a web API
<RickHull>
Obfuscate: i am confuse. a static site should be more SEO friendly than dynamic site
<lampd1>
contentful; etc
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RickHull>
what static site "loads all its content with javascript" ?
<pontiki>
i don't understand your previous statement then, lampd1
<lampd1>
I'm not talking a single page app Obfuscate ; static sites simply mean js/html/css
<lampd1>
which one
<lampd1>
there were many
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki>
[22:19:14] <lampd1>having a backend on a webapp = technical debt
Casty has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pontiki>
that one
<lampd1>
like... say you want to build a site that plays music
<pontiki>
that seems quite meaningless
<lampd1>
instead of uploading songs to your server; figuring out how to be able to curate them and manage your page; you could offload the curation and storage process to soundcloud
<lampd1>
*for free*
<lampd1>
with high availability; and quick load times
<Obfuscate>
RickHull: Consider it in the context of what middleman does: the goal is to serve purely static html/js/css on the frontend, and rely on js to fetch your dynamic content from somewhere else.
<pontiki>
how does that alleviate technical debt?
<lampd1>
and then simple interface with a JS/HTML API
<RickHull>
Obfuscate: ah, i think i'm lacking that context
<lampd1>
because you're using javascript and css....
<lampd1>
and html
<lampd1>
and not an additional language; nor having to worry nearly as much about _Security_
<pontiki>
your contention is there's no technical debt in developing in those technologies?
axsuul has joined #ruby
<lampd1>
no; I'm saying there's less
<lampd1>
less technical debt by owning less of the technologies behind what you're building
<lampd1>
it's like 1/2 SaaS
<lampd1>
:P
ramfjord has joined #ruby
<RickHull>
pontiki: generally, most people talk about technical debt in terms of, i'll do this quickly now and pay it back later
<lampd1>
I call it AaaS
<RickHull>
not in terms of, if i build it now, i have to support it later
<pontiki>
that's what causes technical debt to increase, RickHull
gix has quit [Ping timeout: 264 seconds]
<RickHull>
pontiki: your perspective seems to be, whatever you build, you have to support. and that's technical debt
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lampd1>
what would you call it RickHull ?
<pontiki>
so you are just agreeing with me?
<RickHull>
but my perspective says, things built properly incur no technical debt
CloCkWeRX has joined #ruby
<RickHull>
technical debt is only when you've taken the quick'n'dirty route
<RickHull>
gimme the money now, i'll pay it back later
<lampd1>
pretty much nothing is built 100% properly tho
<pontiki>
RickHull: then you throw that away when you needs change, you understand more, you learn more?
CloCkWeRX has left #ruby [#ruby]
caseypatrickdris has quit [Ping timeout: 256 seconds]
<lampd1>
and using someone elses curation/data storage/db patterns can have its uses
<RickHull>
i would say that as you build stuff, your technical load increases
<lampd1>
esp. if it's already proven to host a prominent webservice
<RickHull>
but that's not necessarily technical debt
<RickHull>
debit is only "easy money"
<RickHull>
*debt
<pontiki>
i think that's rather naive
<Obfuscate>
RickHull: You're leaning against web technologies; there's no such thing as "properly".
<RickHull>
where you sacrifice the long-term in favor of the short-term
umgrosscol has joined #ruby
<RickHull>
Obfuscate: you're misreading me. i am saying you only incur "debt" when you consciously choose the quick'n'dirty route
yoongkang has quit [Remote host closed the connection]
<RickHull>
choosing fast X over proper Y
<lampd1>
I'm simply advocating the centralization/specialization of data storage by type
<pontiki>
you seem to be claiming you'll always have perfect knowledge and perfect technologies to implement what you want
<Obfuscate>
RickHull: I'm saying you incur debt the second you touch javascript.
<RickHull>
Obfuscate: i don't disagree ;)
<lampd1>
like; why reinvent the song storage/library wheel when someone lets you use their wheel that's been time proven
balazs has joined #ruby
<pontiki>
you're also sounding like a one-trick pony, lampd1
<lampd1>
haha
<RickHull>
pontiki: not assuming perfect info. just that incurring debit is a conscious *choice*
<lampd1>
pontiki: if that's what you think then your vision isn't what you think it is
<pontiki>
if that's all then yes
<RickHull>
whatever you build, it will be a load. it's only a debt if you chose the quick'n'dirty route explicitly
<lampd1>
so you're saying Obfuscate that more languages/more complication in a stack = less technical debt?
<lampd1>
and that you can use ruby to build a perfectly capable webapp and _never_ touch JS?
<shevy>
just use PHP already
<RickHull>
if you didn't have an alternative, if this is the only route ("web technologies"), it's hard to say you incurred a debt
<pontiki>
lampd1: so you say that someone else will always have the back end for the application you're building, and every app you make is going to use someone else's data store? who's limited?
<lampd1>
pontiki: i qualified that early on
<lampd1>
having to worry about your storage going *poff*
<lampd1>
s/*poff*/*poof*/
yoongkang has joined #ruby
<Obfuscate>
lampd1: No. I'm not sure how you arrived there from my statements.
<RickHull>
or the API, or the service provider
<pontiki>
or not existing at all?
gix has joined #ruby
<lampd1>
read the tos; think about your project; think about the API/services' promininence
<pontiki>
sure, of course, if someone provides an api for you to use, use it
<lampd1>
decide if it's worth it to build your own or use it
<pontiki>
but that's not saying much of anything
<lampd1>
heh
<RickHull>
well who's saying much of anything anyway?
Spami has quit [Quit: This computer has gone to sleep]
<pontiki>
but it seems worth saying anyway?
<RickHull>
i'm saying: 1. building X does not imply that X necessarily incurs technical debt. there is a support load, but not necessarily debt
justintv90 has joined #ruby
<RickHull>
if you build X, X will have a support load. i think we can all agree. the question is whether load === debt
<lampd1>
i'm saying that you can build X with less support load; and have someone else to point a finger at if you do so; by simply generating static sites with middleman using JS APIs to build fairly content rich sites
<pontiki>
and i'm saying without perfect knowledge, perfect understanding, all the time in the world, you will practically have to make tradeoffs
<lampd1>
and that ruby is more fun to do functional programming ;)
<lampd1>
i'm not saying it's better
<lampd1>
i'm saying it's _way_ easier
<RickHull>
i just want to say that i like how we're all saying stuff xD
<pontiki>
lampd1: that's something i very much agree with
<pontiki>
it's just not a world i work in and get paid for
<pontiki>
shall we switch positions and talk from each other's point of view?
<RickHull>
pontiki: engineering is certainly a world without certainty other than the certainty of making tradeoffs :)
<RickHull>
pontiki: i'll take that turing test :)
<pontiki>
more like a Greek test
<lampd1>
pontiki: do you do rails dev?
commondream has quit [Remote host closed the connection]
<pontiki>
i do
<lampd1>
you have any suggestions for free rails courses?
<pontiki>
and angular and plain ruby, perl
<lampd1>
I've only really done rails for zombies
<lampd1>
and only once
<pontiki>
hartl's is free online
<pontiki>
i haven't seen rails for zombies, but i've heard it's good
<shevy>
are you a zombie
* RickHull
zombie
* shevy
readies shotgun
<pontiki>
no, i've got my circket bat, right here, tho
* RickHull
looks down the barrel
<pontiki>
cricket*
<pontiki>
i don't know if i like angular, tho
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki>
but it might just be this project
<lampd1>
ng-something
<lampd1>
ng-somethingelse
* lampd1
has never used angular
<lampd1>
but if you ask me about prototypejs I got that shit
<lampd1>
;)
<pontiki>
i'm several months in, and i'm still not getting the hang of things
<pontiki>
i wrote a fair bit of backbone and knockout, i totally get that shit
<pontiki>
and i really really really want to work in react
umgrosscol has quit [Remote host closed the connection]
<lampd1>
i'm messing with some phantomjs stuff atm
<lampd1>
8)
<lampd1>
kind of a funky stack for processing images of websites
<lampd1>
pontiki: do you know much about bundler?
<lampd1>
i.e. is there a simple way to run your whole app stack off of locally cached gems
<pontiki>
not much of the internals at all
<pontiki>
i just use it
commondream has joined #ruby
phat4life has joined #ruby
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<lampd1>
or locally _stored_
<pontiki>
sure
<lampd1>
--standalone ?
<pontiki>
well maybe i should ask what you really mean by that
<pontiki>
you want bundler to install the gems locally rather than in the $GEM_PATH ?
<lampd1>
yeah
<lampd1>
like within the project dir
<pontiki>
--path
arescorpio has quit [Read error: Connection reset by peer]
<zotherstupidguy>
?fubar
<ruboto>
I don't know anything about fubar
<pontiki>
typically people use --path=vendor/bundle
<lampd1>
word; thx dude :)
<pontiki>
something i do for production deploys, sometimes
<pontiki>
forex, my middleman resume site is like that
<lampd1>
yeah; i'm just thinking this stack has some kind of crazy dependencies
stalcott has joined #ruby
<lampd1>
one of its dependencies even uses clive
<lampd1>
and checks a cli dependency
<lampd1>
or two
<lampd1>
lol
<lampd1>
trying to think of the best way to lock it all down
<pontiki>
it's really best to do both --path and --standalone if you want to really isolate an app from the rest of the libraries; avoid collisions
<stalcott>
is it possible to do anonymous recursion in Ruby? to invoke the caller without having named it and passed it in? as demonstrated in Perl and Javascript here: https://en.wikipedia.org/wiki/Anonymous_recursion
gix has quit [Ping timeout: 264 seconds]
<pontiki>
the --deployment flag does a bunch of those things
<hanmac>
phat4life: "by object" ... means you can do def add(obj); obj << data; end; but you cant def add(obj); obj += data; end; in the first one obj itself is changed, in the second one a new obj is created
<phat4life>
so using def (a = []) is bad in a reursive function then, assuming i am modifying a in every recursive call
bronson has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<Ox0dea>
phat4life: Stateful recursion is pretty unpleasant, but it's sometimes what you want.
<noethics>
does ruby have TcO
<noethics>
TCO
<Ox0dea>
Sort of.
<phat4life>
Ox0dea: im used to recursion in C, where you can just pass a pointer
<phat4life>
er, c++
<Ox0dea>
Recursion is the same everywhere.
<noethics>
nah lol
<noethics>
TCO in c++ is really good
<noethics>
recursion is essentially free if done properly
<phat4life>
rigtht, but is every resuricve call creating a new object
<noethics>
yes, plus depending on TCO you might end up with a huge stack
<noethics>
recursion is generally bad in high level languages
<noethics>
but idk how ruby does TCO
<Ox0dea>
It's a compile-time feature, but you can finagle the RubyVM module into using it regardless.
senayar has joined #ruby
rgb-one has quit [Remote host closed the connection]
<Ox0dea>
It has to be applied to individual InstructionSequence containers, though.
<noethics>
yeahhh i would avoid recursion
<phat4life>
that makes me sad
<Ox0dea>
Are you using Ruby to do Big Data?
<noethics>
phat4life, very few languages do good TCO
<noethics>
like, almost none
<Ox0dea>
How deep a stack do you really need?
<noethics>
except C/C++
<phat4life>
no i am just review algorihims, and i don't feel like writing c++ right now
_phwelo has quit [Quit: ZNC]
<Ox0dea>
You typically want to use recursion to walk trees irrespective of the language you're using.
<noethics>
ye but you can still optimize that
bentanweihao has quit [Remote host closed the connection]
<noethics>
ie. run a loop and recurse the branches
<noethics>
instead of the whole tree
<Ox0dea>
What?
<Ox0dea>
How do you tell the loop when to stop?
<noethics>
depends on the implementation
DLSteve has joined #ruby
<Ox0dea>
Depends on whether or not you understand recursion. ^_^
<noethics>
not really
<noethics>
what lo
<phat4life>
its much easier to do tree traveral just puerly recursively
<phat4life>
from a programming standpoint
<noethics>
easier yeh
swgillespie has joined #ruby
<Ox0dea>
Natural, even.
<noethics>
but if the tree is huge or you have a lot of control flowy stuff in your tree
<noethics>
it's inefficient
<Ox0dea>
Using explicit iteration to walk a tree involves maintaining your own stack, so what's the point?
<phat4life>
how would that make a difference
<phat4life>
every recusive solution can be converted directly to iterative
<Ox0dea>
And vice versa.
senayar has quit [Ping timeout: 265 seconds]
<phat4life>
i don't see how it would be different other that from the difference because iteration/recursive stack
<noethics>
the difference is you renew the stack every iteration
<phat4life>
with renew meaning what exactly?
<noethics>
you can do it with recursion too by unwrapping the stack
<noethics>
but you have to know what youre doing
<noethics>
ie. when you exit the stack just disappears
<noethics>
you dont have to worry about the stack
<Ox0dea>
...
<noethics>
what Ox0dea
zotherstupidguy has quit [Ping timeout: 265 seconds]
<Ox0dea>
You have to maintain all the state that a recursive approach would.
<noethics>
no you dont
AbinoamJr has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0/20150511103303]]
<Ox0dea>
Not all at once, if that's the point you're meaning to make.
_phwelo has joined #ruby
<noethics>
any state you need is some high level abstracted data
bruno- has joined #ruby
<noethics>
you dont have all of the state associated with stack frames
<noethics>
and yes, not all at once
<noethics>
because the stack unwraps itself
<noethics>
when you exit
zotherstupidguy has joined #ruby
zotherstupidguy has quit [Changing host]
zotherstupidguy has joined #ruby
<Ox0dea>
But that's essentially what the recursion would do anyway.
<noethics>
yeah if you do it properly as i said
<noethics>
but it's completely avoided using iterative approach
<phat4life>
noethics: are you talking about tail recursion?
<noethics>
yes
<phat4life>
ok you could have just said that lol
<noethics>
tail recursion is bad
<noethics>
what do you think i meant by TcO
CalvinnHobbes has joined #ruby
<phat4life>
i thought tail recursion was good
<Ox0dea>
noethics: Tail recursion is the good kind.
<Ox0dea>
It's essentially mathematically equivalent to iteration.
Mia has joined #ruby
<Ox0dea>
Except with the added bonus of letting the computer decide when to stop rather than supplying some sort of explicit stopping condition.
<noethics>
with TCO yes
<Ox0dea>
That was worded poorly, but I suspect you took my meaning.
<noethics>
i understand
<noethics>
but TCO is ecessary
<noethics>
anyway i gotta go do work D:
Guest123 has joined #ruby
<noethics>
glhf
<Ox0dea>
I'm adding named Unicode literals to Ruby...
<Ox0dea>
Hyphens, BEGIN/END, IO, and TRUE are ruining my night.
mdz_ has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
Guest123 has quit [Client Quit]
lysw123 has joined #ruby
Behi has joined #ruby
agent_white has joined #ruby
<agent_white>
Evenin' folks
agent_white has quit [Read error: Connection reset by peer]
agent_white has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dgarstang has quit [Quit: WeeChat 0.4.3]
yfeldblum has quit [Ping timeout: 265 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yoongkang has quit [Remote host closed the connection]
xxneolithicxx has quit [Ping timeout: 255 seconds]
CalvinnHobbes has quit [Remote host closed the connection]
CalvinnHobbes has joined #ruby
_seanc_ has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
balazs has quit [Remote host closed the connection]
Lucky__ has joined #ruby
yoongkang has joined #ruby
ferr has joined #ruby
<ScriptGeek>
hmm
<ScriptGeek>
Random.rand(0..10)
robbyoconnor has joined #ruby
bentanweihao has joined #ruby
<Ox0dea>
ScriptGeek: What about it?
<ScriptGeek>
if I wanted to write my own class to do SomeClass.yadda(0..10) what would the syntax look like?
bentanweihao has quit [Remote host closed the connection]
<shevy>
I seem to have collected a lot of weird ruby code from other people
<shevy>
begin; while not(@done) do
<ScriptGeek>
weird indeed
failshell has joined #ruby
<lampd1>
oh yeah, not a coroutine like an ienumerable
<ScriptGeek>
lampd1: are you using Unity with C#?
<lampd1>
yeah
<ScriptGeek>
nice
jeramy_s has quit [Quit: Peace out!]
<ScriptGeek>
I'm working with Unity on another project
RobertBirnie has joined #ruby
<lampd1>
coolio :) unity is fun stuff
<ScriptGeek>
yeah, I love it
<ScriptGeek>
it's more fun than ruby :p
<lampd1>
haha; ruby is super fun once a few key pieces click
ramfjord has quit [Ping timeout: 246 seconds]
<lampd1>
just takes a little getting used to thinking the "ruby way"
<ScriptGeek>
it's alright... I wanted to make a "small" project as part of the Team Treehouse course requirements, but this ruby project is taking much longer than I thought it would
<lampd1>
what's the project goal?
krisquigley has quit [Ping timeout: 256 seconds]
<ScriptGeek>
It's just a Dope Wars clone, running in the text console
<ScriptGeek>
I got the menu system working correctly today
JamesDH has joined #ruby
ItSANgo has quit [Quit: Leaving...]
<lampd1>
huh; cool - dont rly know what dope wars is - is it like a turn based text rpg?
<ScriptGeek>
sooner or later I'll dive back in and create a better solution
senayar has joined #ruby
failshell has quit [Ping timeout: 244 seconds]
<ScriptGeek>
yeah, it's sorta like that... here, lemme find a link
MatthewsFace has quit [Remote host closed the connection]
nikhgupta` has quit [Remote host closed the connection]
nikhgupta` has joined #ruby
A205B064 has quit [Ping timeout: 255 seconds]
hotpancakes has joined #ruby
wildroman2 has joined #ruby
hakunin has quit [Remote host closed the connection]
<shevy>
ack
<shevy>
you use method_missing
<Ox0dea>
shevy: Only in a module intended to be extended from, so the damage is localized.
ta has joined #ruby
alex88 has quit [Remote host closed the connection]
riotjones has joined #ruby
<Ox0dea>
How often do you get to use a gem to help write its gemspec description?
nikhgupta` has quit [Ping timeout: 265 seconds]
<shevy>
don't think I ever needed that
axsuul has quit [Ping timeout: 240 seconds]
<shevy>
writing gemspecs is very boring
hotpancakes has quit [Ping timeout: 252 seconds]
Alina-malina has quit [Ping timeout: 255 seconds]
<shevy>
it would be nice if rubygems could sort of automatically pick a gemspec up from a key class or something like that
mister_solo has quit [Ping timeout: 252 seconds]
<jhass>
write a generator
ruurd has quit [Quit: Zzzzz z zz ...]
MMoris has joined #ruby
bosma has quit [Quit: Leaving]
ta has quit [Ping timeout: 252 seconds]
zotherstupidguy has quit [Ping timeout: 276 seconds]
zotherstupidguy has joined #ruby
ylla has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
francois_ has joined #ruby
ylla has joined #ruby
<shevy>
I hope you could write one for me jhass :)
<jhass>
nah, I'm fine with bundler's
tskogberg has joined #ruby
sinkensabe has quit [Remote host closed the connection]
francois_ has quit [Ping timeout: 276 seconds]
FernandoBasso has joined #ruby
Miphix has joined #ruby
attlasbot has quit [Quit: Leaving]
<Ox0dea>
Named threads just dropped in trunk. What's the utility?
k3asd` has quit [Ping timeout: 244 seconds]
<Ox0dea>
I mean, isn't it kind of redundant?
senayar has joined #ruby
whoami_ has joined #ruby
<jhass>
huh? "dropped" as in removed?
<jhass>
and why redundant?
m8 has joined #ruby
ylla has quit [Ping timeout: 265 seconds]
sinkensabe has joined #ruby
senayar has quit [Ping timeout: 250 seconds]
aapole has joined #ruby
CloCkWeRX has quit [Ping timeout: 265 seconds]
<jhass>
oh weird, I thought we had them already
<Ox0dea>
Well, they already have to be stored in some kind of variable, and thus they already have "names".
<Ox0dea>
Why not named arrays and hashes too?
<Ox0dea>
On a related note, why Class#name?
alex88 has joined #ruby
Cork has quit [Ping timeout: 264 seconds]
<shevy>
because it gives you the name?
govg has joined #ruby
<jhass>
Ox0dea: I'd expect thread names to be about phtread_setname_np
govg has quit [Client Quit]
<jhass>
so that's incredibly useful
UnnamedUser has joined #ruby
kraljev11 has quit [Ping timeout: 256 seconds]
sinkensabe has quit [Remote host closed the connection]
<apeiros>
for debugging, I suppose?
jgt4 has quit [Quit: WeeChat 1.1.1]
wildroman2 has quit [Ping timeout: 265 seconds]
<Ox0dea>
At the C level?
pandaant has joined #ruby
sdothum has joined #ruby
<Ox0dea>
When would you not be able to determine which thread you were dealing with from Ruby land?
nohminn has joined #ruby
stalcott has quit []
Marsupermammal has joined #ruby
wildroman2 has joined #ruby
<jhass>
one ruby thread maps one pthread
rubie has joined #ruby
<jhass>
apeiros: or simply knowing which of my threads died by looking at htop
<jhass>
or think autoscaling stuff, simply seeing how many of what kind of thread are running
<apeiros>
jhass: right, so: debugging ;-)
<apeiros>
oh, wait… are there tools to measure cpu time per pthread?
riotjones has quit [Ping timeout: 250 seconds]
<jhass>
mmh, wouldn't be surprised but I never checked
flak has joined #ruby
UnnamedUser has quit [Ping timeout: 265 seconds]
CloCkWeRX has joined #ruby
alex88 has quit []
rubie has quit [Ping timeout: 265 seconds]
mc_fail has joined #ruby
RegulationD has joined #ruby
rippa has quit [Ping timeout: 255 seconds]
ta has joined #ruby
huddy has quit [Quit: Connection closed for inactivity]
otherj has joined #ruby
RegulationD has quit [Ping timeout: 246 seconds]
wildroman3 has joined #ruby
wildroman2 has quit [Read error: Connection reset by peer]
tonytr has joined #ruby
<tonytr>
Newbie query: for the following code "array1.length do i" how do i modify it so that the do loop iterates only the array "length-1". when i put "array1.(length-1) do i" i get an error
<shevy>
is that really a loop?
<jhass>
tonytr: (array.size-1).times do |i|
ziprar is now known as zipace
edwinvdgraaf has quit [Remote host closed the connection]
<tonytr>
hi - is it possible without using the size method?
edwinvdgraaf has joined #ruby
<jhass>
size and length are the same
<tonytr>
so (array1.length-1).times do |i| - should work?
<jhass>
yes
platzhirsch has joined #ruby
<tonytr>
thanks
platzhirsch has quit [Client Quit]
DEA7TH has joined #ruby
OrbitalKitten has joined #ruby
valeri_ufo has joined #ruby
edwinvdg_ has joined #ruby
<Ox0dea>
tonytr: I feel compelled to ask: how come you don't need the last element?
edwinvdg_ has quit [Remote host closed the connection]
edwinvdgraaf has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
<Ox0dea>
There are any number of good reasons, of course.
senayar has joined #ruby
<tonytr>
Ox0dea, just specific to the program I'm writing - the last element isn't relevant. Interesting that "array1.length do |i|" would work but if you you need a different number you have to use ".times"
x44x45x41x4E has quit [Remote host closed the connection]
ninja_python has joined #ruby
<Ox0dea>
tonytr: You'll have to define "work" there.
<Ox0dea>
Every method accepts an implicit block, but Enumerable#length doesn't do anything with it.
otherj has quit [Quit: .]
<Ox0dea>
You could use Enumerable#count if you absolutely must avoid calling #times, but I can't imagine why that'd be the case.
startupality has joined #ruby
pontiki has joined #ruby
aapole has quit [Ping timeout: 265 seconds]
nhhagen has joined #ruby
serivich has joined #ruby
otherj has joined #ruby
Rollabunna has quit [Remote host closed the connection]
qwertme has joined #ruby
startupality has quit [Quit: startupality]
roshanavand has joined #ruby
wookiehangover has joined #ruby
thelastinuit has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<livcd>
any sass guy around ? i'd like to ask if i can change the selector type with mixins ? eg .selector { @include mixin; } can compile to .selector::before { color: blue; }
centrx has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
edwinvdg_ has joined #ruby
<jhass>
livcd: hey livcd, welcome to the Ruby programming language channel where you can ask all your Ruby questions
kraljev11 has joined #ruby
<livcd>
jhass: :3
<jhass>
livcd: in other words /msg alis help
<livcd>
who is alis ?
nhhagen has quit [Remote host closed the connection]
ht__ has joined #ruby
FernandoBasso has quit [Ping timeout: 245 seconds]
edwinvdgraaf has quit [Ping timeout: 276 seconds]
startupality has joined #ruby
FernandoBasso has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
<tonytr>
im wondering is "1.upto(array1.length-1) do |i|" the same as (array1.length-1).times do |i|? It seems they should be but I get different results for both
Miphix has quit [Quit: Leaving]
<jhass>
tonytr: no times is 0-indexed
<jhass>
so it's the same as 0.upto(array.length-2) do |i|
<tonytr>
ah i see...
nhhagen_ has joined #ruby
chinmay__ is now known as chinmay_dd
dgutierrez1287 has joined #ruby
<tonytr>
so going back to that original code, how can I change it so that it starts from 0. I don't wish to use the upto method. Using length and times is ok
<tonytr>
starts from 1*
<jhass>
what's wrong with upto?
ule has joined #ruby
<jhass>
I'd argue its the most idiomatic version in fact
<tonytr>
I'm trying to solve a problem in a book. Upto hasn't been covered yet
<ule>
hi there
<jhass>
so what?
<centrx>
times is okay
<jhass>
tonytr: that book won't cover all Ruby has to offer in the standard library anyway
<ule>
Is there any way to check if a website is using ruby?
AussieDownUnder has quit [Quit: I hath quit]
nhhagen_ has quit [Remote host closed the connection]
wildroman3 has quit [Ping timeout: 265 seconds]
CyborgCygnus has joined #ruby
<tonytr>
ok jhass
<otherj>
builtwith is decent at detecting rails, but otherwise you may be out of luck
<jhass>
tonytr: that said, you'll also see (1..(array.size-1).each do |i| and (1...array.size).each do |i| often too, but throw away that useless arbitrary restriction you thought of and use upto, everything else is just severely damaging your mindset
<dreinull75>
anybody here responsible for slim2html?
CyborgCygnus has quit [Remote host closed the connection]
pepperbreath1 has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
<otherj>
hot as balls here today :-/
jenrzzz has quit [Ping timeout: 276 seconds]
nhhagen has joined #ruby
ule has left #ruby [#ruby]
<tonytr>
I could do that jhass but technically failed at solving the problem. I guess I could use "(array.length-2).times do |i|" and just add 1 to i at the beginning of the loop?
OrbitalKitten has joined #ruby
<jhass>
technically yes
<jhass>
is that a nice way, nope
adac has joined #ruby
pepperbreath has quit [Ping timeout: 264 seconds]
duncannz has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
bronson has joined #ruby
mutuma has joined #ruby
chinmay_dd has quit [Remote host closed the connection]
nhhagen has quit [Remote host closed the connection]
sameerynho has joined #ruby
krisquigley has joined #ruby
nhhagen has joined #ruby
jenrzzz has joined #ruby
nhhagen has quit [Remote host closed the connection]
lessless has quit [Ping timeout: 244 seconds]
_blizzy_ has joined #ruby
Rickmasta has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
bronson has quit [Ping timeout: 265 seconds]
mutuma has quit [Ping timeout: 265 seconds]
nohminn has quit [Remote host closed the connection]
mutuma has joined #ruby
krisquigley has quit [Ping timeout: 252 seconds]
gix has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
woodruffw has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
troulouliou_dev has joined #ruby
lxsameer_ has joined #ruby
gix has joined #ruby
hedgecore has quit [Ping timeout: 252 seconds]
hotpancakes has joined #ruby
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krisquigley has quit [Remote host closed the connection]
unshadow has quit [Ping timeout: 252 seconds]
krisquigley has joined #ruby
sinkensabe has joined #ruby
symbol has quit [Ping timeout: 252 seconds]
bentanweihao has quit []
centrx has quit [Ping timeout: 265 seconds]
ferr has joined #ruby
mdz_ has quit [Ping timeout: 245 seconds]
symbol has joined #ruby
krisquigley has quit [Ping timeout: 252 seconds]
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rollabunna has joined #ruby
symbol has quit [Ping timeout: 245 seconds]
havenwood has joined #ruby
pen has quit []
bruno- has joined #ruby
nhhagen has quit [Remote host closed the connection]
jcaho has quit [Read error: Connection reset by peer]
dgutierrez1287 has quit [Remote host closed the connection]
jcaho has joined #ruby
symm- has quit [Read error: Connection reset by peer]
nhhagen has joined #ruby
symm- has joined #ruby
<cina>
I have a method that creates a large array does something with it, and then exits and returns 0. After calling that method ram usage goes up about 150MB! I'm doing this on a server, so the ram usage is going up indefinitely! I have to restart the server every hour... I'm running ruby-2.1.5
CustosLimen has quit [Max SendQ exceeded]
<cina>
>> def test; a = (1..10_000_000).to_a; 0; end
nhhagen has quit [Remote host closed the connection]
CustosLimen has joined #ruby
adude has joined #ruby
adude has quit [Client Quit]
<cina>
compare the ram usage before and after calling that method
adude has joined #ruby
adude has quit [Client Quit]
nhhagen has joined #ruby
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
<apeiros>
sounds like you're retaining a reference to the array somewhere
sinkensabe has quit [Remote host closed the connection]
<apeiros>
else the memory will be reused by ruby (but not given back to the OS - the OS may swap it out, though)
A124 has quit [Remote host closed the connection]
nohminn has quit [Remote host closed the connection]
A124 has joined #ruby
mdw has joined #ruby
akkad has quit [Excess Flood]
<cina>
thank you, interesting...
nhhagen has quit [Remote host closed the connection]
yaw has joined #ruby
<apeiros>
cina: feel free to gist your code for inspection
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
akkad has joined #ruby
aspiers has quit [Ping timeout: 252 seconds]
davedev24_ has quit [Remote host closed the connection]
rdark has quit [Quit: leaving]
<cina>
it's a large multi-file worker, I first thought it might have something to do ruby 2.1, I'm not retaining a reference to the array, but it could also be an issue with the gem I am using (Sidekiq), I will check that as well
<cina>
apeiros: I can't share the code sorry about that
<cina>
the code belongs to the company I work for :(
xcesariox has joined #ruby
x0f has quit [Ping timeout: 272 seconds]
<cina>
sorry about that
<apeiros>
cina: no need to be sorry. you're the one missing free code inspection ;-)
rubie has joined #ruby
<apeiros>
I'd clear that with my company if I were you. most companies don't care about source code which is not in the domain of their core competences.
AbinoamJr has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ropeney has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
xcesariox has quit [Client Quit]
dgutierrez1287 has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
wildroman3 has joined #ruby
banister has joined #ruby
x0f has joined #ruby
senayar has quit [Ping timeout: 265 seconds]
wildroman2 has quit [Ping timeout: 240 seconds]
nohminn has joined #ruby
pandaant has quit [Remote host closed the connection]
AbinoamJr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Narzew has joined #ruby
hotpancakes has joined #ruby
symm- has quit [Ping timeout: 276 seconds]
nohminn has quit [Remote host closed the connection]
banister has joined #ruby
jpfuentes2 has joined #ruby
MasterPiece has quit [Ping timeout: 252 seconds]
Yzguy has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
terminal_fee has joined #ruby
<terminal_fee>
Any purpose FREE storagewith PHP5 + MySQL, Script Testing, Personal, and more! at https://www.criosphinx.net/free/
<terminal_fee>
Any purpose FREE storagewith PHP5 + MySQL, Script Testing, Personal, and more! at https://www.criosphinx.net/free/
lolmaus has quit [Read error: Connection reset by peer]
<terminal_fee>
Any purpose FREE storagewith PHP5 + MySQL, Script Testing, Personal, and more! at https://www.criosphinx.net/free/
<woodennails>
Just gotten a new job and its likely that im going to be coding using either Ruby w/ sinatra/rails or Javascript using EmberJS so just wanted to say hey :)
arup_r has joined #ruby
allomov_ has joined #ruby
hotpancakes has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<Ox0dea>
rob_: Do you perceive any shortcomings in that approach?
armyriad has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
benlovell has quit [Ping timeout: 245 seconds]
yoongkang has joined #ruby
<BlueProtoman>
Ox0dea: Do you know anything about Jekyll or Liquid, per chance?
LicHacker_ has joined #ruby
pikos has quit [Quit: ...]
mdz_ has quit [Remote host closed the connection]
scripore has joined #ruby
LicHacker_ has quit [Client Quit]
bruno- has quit [Ping timeout: 252 seconds]
LicHacker__ has joined #ruby
j4cknewt has joined #ruby
<jhass>
rob_: well, the perfect time would be to use a monotonic clock via Process.clock_gettime
LicHacker__ has quit [Remote host closed the connection]
mdz_ has joined #ruby
<jhass>
*perfect way
axsuul has quit [Ping timeout: 252 seconds]
Narzew has quit [Ping timeout: 276 seconds]
<jhass>
not that it's likely that your benchmark crosses a leap second
<Ox0dea>
jhass: Still, there's the potential for http_request to get a shell on BlueProtoman's box and monkey-patch Process before the request completes.
<Ox0dea>
Haven't figured out how to thaw Symbols yet.
devdazed has quit [Quit: Computer has gone to sleep.]
yqt has joined #ruby
dagda1__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
commondream has quit [Ping timeout: 244 seconds]
mary5030 has quit [Remote host closed the connection]
<shevy>
I guess once frozen
<shevy>
things will remain in the eternal ice
<shevy>
why is there .object_id and .__id__ ?
<seanstickle>
That sounds like a Lovecraftian turn of phrase
<Ox0dea>
shevy: Why is there #send and #__send__?
dgutierrez1287 has joined #ruby
LJT has joined #ruby
Scroff has joined #ruby
Scroff has quit [Remote host closed the connection]
Scroff has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
<jhass>
why's there #size and #length?
Scroff has quit [Remote host closed the connection]
<Ox0dea>
Because programmer happiness.
<BlueProtoman>
Is there a way I can define implicit conversions on built-in types? (I.e. I want to convert strings to ints in the usual way, except if the conversion is not valid I want to just return nil)
joaomdmoura has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scripore has quit [Quit: This computer has gone to sleep]
joaomdmoura has joined #ruby
Xeth has joined #ruby
dgutierrez1287 has quit [Ping timeout: 240 seconds]
<jhass>
BlueProtoman: what do you mean? got some examples?
<Ox0dea>
`cat *.c | grep -c define_alias` is only 18 in trunk. Doesn't that seem low?
<BlueProtoman>
jhass: Let me explain my use case, that might clear it up. You know Jekyll?
Xeth has left #ruby [#ruby]
joaomdmoura has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
not really, only invested into middleman so far
<seanstickle>
I know Jekyll
<seanstickle>
Though, jhass, middleman is more interesting
<BlueProtoman>
jhass: Actually, that doesn't even matter. I just want to use format, except instead of throwing TypeErrors on invalid types (e.g. "f" to a %d) or ArgumentErrors for too few arguments, I just want to return some default values
<jhass>
well, invested, played around and made my very basic site with it
<jhass>
BlueProtoman: write a simple wrapper that does that?
ReK2 has joined #ruby
<BlueProtoman>
jhass: That does what, exactly? (Bear in mind, I know literally no Ruby.)
<jhass>
.scan out the % and map them to argument || default
swgillespie has joined #ruby
nohminn has quit [Remote host closed the connection]
<BlueProtoman>
jhass: And what does that do, exactly?
<jhass>
well, you gotta invest at least somewhat into your Ruby skills if you want to do that
<jhass>
else I'd recommend you to change your stuff not to require it
<jhass>
which would be better anyhow
<BlueProtoman>
jhass: All I need is literally a single Liquid tag, if you're familiar with that. I'm primarily doing a site in Jekyll
<seanstickle>
For $20, I’ll sell you that tag
krisquigley has quit [Ping timeout: 276 seconds]
<jhass>
^ good offer
<BlueProtoman>
seanstickle: I already wrote it! Now I'm just trying to polish it
<Ox0dea>
BlueProtoman: I'd take that deal, mate.
benlovell has joined #ruby
<BlueProtoman>
Thank you, but no.
<seanstickle>
Fair ‘nuff
* seanstickle
puts Big Book o’ Tags back on the shelf
<Ox0dea>
seanstickle: To be fair, you didn't actually name your price.
AlphaAtom has joined #ruby
I has joined #ruby
<Ox0dea>
English is weird.
I has quit [Client Quit]
<BlueProtoman>
Actually, he did
<Ox0dea>
No, he said, essentially, that if you gave him twenty bucks, he'd sell the tag to you, but not how much you'd have to pay for the tag.
<BlueProtoman>
I suppose taken literally, yes, but...arrrrgh
<seanstickle>
Fortunately, my customers typically speak idiomatic English
<seanstickle>
Not English as interpreted by a Lojban speaker
<seanstickle>
;)
<Ox0dea>
"For x, I'll y" isn't all that idiomatic, really.
baweaver has quit [Remote host closed the connection]
<Ox0dea>
"I'll x for y" is substantially more common.
<seanstickle>
A Google search turns up a lot of matches for my format as well
<seanstickle>
From a corpus search basis, I’d say mine works fine
<Ox0dea>
I didn't say it didn't.
aapole has joined #ruby
<seanstickle>
Common use is pretty much the working definition of idiom
<Ox0dea>
But commoner is more idiomaticer.
<seanstickle>
Ha :D
meph has joined #ruby
<Ox0dea>
^_^
bruno- has joined #ruby
failshell has joined #ruby
AlphaAtom has quit [Ping timeout: 252 seconds]
I has joined #ruby
I is now known as Guest18432
Guest18432 has quit [Client Quit]
joaomdmoura has joined #ruby
devdazed has joined #ruby
dopie has joined #ruby
aspiers has joined #ruby
simplyianm has quit [Remote host closed the connection]
vdamewood has joined #ruby
simplyianm has joined #ruby
phutchins has joined #ruby
simplyia_ has joined #ruby
failshell has quit [Ping timeout: 265 seconds]
simplyianm has quit [Read error: Connection reset by peer]
bruno- has quit [Ping timeout: 252 seconds]
dagda1 has joined #ruby
Scroff has joined #ruby
acke has joined #ruby
gkra has quit [Remote host closed the connection]
simplyianm has joined #ruby
Guest6 is now known as Casty
BlueProtoman has quit [Quit: Leaving]
casadei has joined #ruby
chussenot has joined #ruby
simplyia_ has quit [Ping timeout: 255 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
<nickjj>
i have a fun OT saturday question for you guys
<nickjj>
my friend has a mac (yosemite 10.10.4) and he swears that title html attributes do not show up for him on any browser
<seanstickle>
nickjj: I have answers about operator calculus
<nickjj>
i do not have a mac to test it myself, am i getting trolled?
simplyianm has quit [Ping timeout: 272 seconds]
akkad has quit [Remote host closed the connection]
<nickjj>
a popular site that uses title= is xkcd.com (hover over any comic image) , can someone with that mac ver test it?
<jhass>
I think there's an os x channel
j4cknewt has joined #ruby
gkra has joined #ruby
<jhass>
#MacOSX
<seanstickle>
nickjj: I assure you, the title attr works on Macs finfe
<nickjj>
k, i'll try there. thanks
joaomdmoura has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nickjj>
seanstickle, he tried multiple browsers which is what boggles my mind
<seanstickle>
I used to do tech support professionall
<seanstickle>
What people say they do is not necessarily what they actually did
<seanstickle>
Nor are their interpretations regularly accurate
<seanstickle>
Many is the time I walk into a room and the problem magically disappeared
startupality has joined #ruby
<seanstickle>
Because they become conscious of what they’re doing, and stop doing it wrong by accident
<nickjj>
hah yeah
gkra_ has joined #ruby
EllisTAA has joined #ruby
gkra has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
allcentury has quit [Ping timeout: 246 seconds]
j4cknewt has quit [Ping timeout: 256 seconds]
devdazed has quit [Quit: Computer has gone to sleep.]
dopie has quit [Quit: This computer has gone to sleep]
aspiers has quit [Ping timeout: 250 seconds]
diegoviola has joined #ruby
akkad has joined #ruby
gkra_ has quit [Ping timeout: 256 seconds]
seanstickle has quit [Quit: seanstickle]
arooni-mobile has joined #ruby
dagda1 has quit [Read error: No route to host]
dagda1 has joined #ruby
hectortrope has quit [Quit: WeeChat 0.4.2]
<Ox0dea>
What'd be a good channel for discussing Unicode's copyright agreement?
gkra has joined #ruby
gkra has quit [Remote host closed the connection]
<jhass>
there's 11 people in #unicode
<Ox0dea>
That doesn't bode well.
<jhass>
4 in #cldr
<jhass>
and that seems to be about it
mdz_ has quit [Remote host closed the connection]
<Ox0dea>
#ruby it is!
simplyianm has joined #ruby
mdz_ has joined #ruby
kraljev11 has quit [Ping timeout: 252 seconds]
simplyianm has quit [Remote host closed the connection]
simplyianm has joined #ruby
<bhaak>
what problems do you have with the unicode's terms of use?
nertzy has quit [Quit: This computer has gone to sleep]
DLSteve has joined #ruby
Outlastsheep is now known as zz_Outlastsheep
<Ox0dea>
I wonder whether or not they apply in the case of grabbing and parsing their name list.
DLSteve has quit [Read error: Connection reset by peer]
zotherstupidguy has quit [Quit: WeeChat 1.2]
DLSteve has joined #ruby
<Ox0dea>
The document never exists in full on disk, and even after parsing it's been transformed and exists only in RAM.
startupality has quit [Quit: startupality]
allomov has joined #ruby
<Ox0dea>
"(a) this copyright and permission notice appear with all copies of the Data Files or Software"
<Ox0dea>
In my case, what copy?
matugm has quit [Ping timeout: 276 seconds]
balazs has joined #ruby
allcentury has joined #ruby
sarkyniin has quit [Remote host closed the connection]
futilegames has joined #ruby
<jhass>
do you think anybody will enforce anything about that anywhere?
<bhaak>
if you put the names list in your code repository, you should somewhere point out that its under the unicode license agreement
balazs has quit [Remote host closed the connection]
futilegames has quit [Client Quit]
rkazak has joined #ruby
startupality has joined #ruby
<bhaak>
if it's just a webservice, it should suffice to say somewhere "this software is (among other stuff) using unicode data files blabla link to http://www.unicode.org/copyright.html"
chinmay_dd has quit [Remote host closed the connection]
startupality has quit [Client Quit]
mary5030 has joined #ruby
eggoez has quit [Ping timeout: 265 seconds]
rubie has quit [Remote host closed the connection]
EllisTAA has quit [Read error: Connection reset by peer]
allomov has quit [Remote host closed the connection]
dopie has joined #ruby
jphenow has joined #ruby
mary5030 has quit [Ping timeout: 256 seconds]
LicHacker has quit [Ping timeout: 276 seconds]
eggoez has joined #ruby
vdamewood has quit [Ping timeout: 250 seconds]
<Ox0dea>
bhaak: The list will not exist in the repository proper, but the data will essentially be present on a user's machine, just not in a form the license appears to cover.
<jhass>
diegoviola: 17.06.2012 ... also #ruby-offtopic ;)
<Ox0dea>
Is it possible to determine that we're being required?
<diegoviola>
jhass: ok
<Ox0dea>
$LOADED_FEATURES doesn't pick us up until the whole file has been evaluated.
jphenow has quit [Quit: Be back later ...]
<jhass>
well, being required opposed to... ?
<Ox0dea>
Huh?
bruno- has joined #ruby
<jhass>
what do you want to differentiate against? ruby foo.rb ?
<Ox0dea>
This is gonna sound nuts, but...
<Ox0dea>
Ideally, I'd like to remove foo.rb from $LOADED_FEATURES from within foo.rb...
Channel6 has quit [Quit: Leaving]
<Ox0dea>
That doesn't seem to be possible, so what are the alternatives?
<jhass>
do I want to know?
<Ox0dea>
I'd imagine not.
Scroff has quit [Remote host closed the connection]
scripore has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
FernandoBasso has joined #ruby
allomov has joined #ruby
bruno- has quit [Ping timeout: 276 seconds]
<Ox0dea>
vm->loading_table used to be a global. :/
hotpancakes has joined #ruby
jenrzzz has joined #ruby
yardenbar has quit [Quit: Leaving]
NeverDie has joined #ruby
<jhass>
are you writing "Ruby under a electron-scan microscope" or something?
atm0sphere has quit [Ping timeout: 246 seconds]
dopie has quit [Quit: This computer has gone to sleep]
balazs has joined #ruby
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kraljev11 has joined #ruby
francois_ has joined #ruby
chussenot has quit [Quit: chussenot]
blue_deref has quit [Quit: bbn]
bronson has joined #ruby
woodruffw has quit [Ping timeout: 256 seconds]
Lucky__ has joined #ruby
balazs has quit [Ping timeout: 252 seconds]
balazs has joined #ruby
francois_ has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
niemc2 has quit [Ping timeout: 264 seconds]
phat4life has quit [Quit: ZNC - 1.6.0 - http://znc.in]
timonv has joined #ruby
dagda1 has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
mleung has quit [Quit: mleung]
dopie has joined #ruby
futilegames has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
vdamewood has joined #ruby
xxneolithicxx has joined #ruby
f3lp has joined #ruby
balazs has quit [Remote host closed the connection]
awwaiid has quit [Quit: leaving]
woodruffw has joined #ruby
Cache_Money has joined #ruby
ebbflowgo has joined #ruby
Levvy has joined #ruby
acke has quit [Remote host closed the connection]
futilegames has quit [Client Quit]
ebbflowgo has left #ruby [#ruby]
atomical has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ruby
<Levvy>
Hello. Is anyone active?
swgillespie has quit [Max SendQ exceeded]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
failshell has joined #ruby
swgillespie has joined #ruby
commondream has joined #ruby
Gaelan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Levvy>
I wann execute this line of Ruby in Java but also got this error: org.jruby.embed.ParseFailedException: (SyntaxError) <script>:1: syntax error, unexpected tUMINUS rvpacker -V -f -d P:\temp-workspace\RPGTestProject1 -t ace -a unpack
<jhass>
do you embed C when you want to run, say, the ls command?
failshell has quit [Ping timeout: 246 seconds]
pontiki has joined #ruby
<Levvy>
when I run this command in cmd it works fine
DLSteve has quit [Quit: Leaving]
<jhass>
yes
<jhass>
because your cmd is not a ruby interpreter
cytoskeletor has joined #ruby
commondream has quit [Ping timeout: 265 seconds]
krisquigley has joined #ruby
_ht has quit [Quit: Konversation terminated!]
<Levvy>
so I cannot exec this code from ruby?
Rollabunna has quit [Remote host closed the connection]
<jhass>
sure you can, but why not just invoke the command from java directly?
<jhass>
if you're going to shellout anyhow?
A205B064 has quit [Ping timeout: 240 seconds]
<Levvy>
cause I got Cannot run program "rvpacker": CreateProcess error=2, The system cannot find the file specified
<jhass>
well, then fix the path
allomov has quit [Remote host closed the connection]
jcaho has quit [Read error: Connection reset by peer]
kraljev11 has quit [Quit: kraljev11]
jcaho has joined #ruby
kraljev11 has joined #ruby
kraljev11 has quit [Client Quit]
kraljev11 has joined #ruby
<Levvy>
in cmd it works well so path is ok
<jhass>
not it java apparently
<jhass>
but this ain't #java nor #windows, so there's that
<jhass>
all I can assure you that going through jruby is a quite insane idea
<Levvy>
ok so I will go there and thanks for help
krisquigley has quit [Ping timeout: 276 seconds]
platzhirsch has left #ruby [#ruby]
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
j4cknewt has quit [Remote host closed the connection]
malconis has joined #ruby
someword has joined #ruby
rubie has joined #ruby
hotpancakes has quit [Remote host closed the connection]
Jackneill has quit [Remote host closed the connection]
sarkyniin has joined #ruby
mdz_ has quit [Remote host closed the connection]
hotpancakes has joined #ruby
rgb-one has joined #ruby
schy has joined #ruby
platzhirsch has joined #ruby
hedgecore has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
millerti has joined #ruby
dgutierrez1287 has joined #ruby
MatthewsFace has joined #ruby
DEA7TH has quit [Ping timeout: 276 seconds]
eggoez has quit [Ping timeout: 265 seconds]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
mleung has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
gianlucadv has quit [Ping timeout: 264 seconds]
dagda1 has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
dgutierrez1287 has joined #ruby
havenwood has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruv has joined #ruby
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegoviola has quit [Quit: WeeChat 1.2]
Musashi007 has quit [Quit: Musashi007]
dopie has joined #ruby
Musashi007 has joined #ruby
kraljev11 has quit [Quit: kraljev11]
kraljev11 has joined #ruby
Ox0dea has quit [Read error: Connection reset by peer]
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mleung has quit [Quit: mleung]
x1337807x has joined #ruby
Levvy has quit [Quit: Page closed]
platzhirsch has left #ruby [#ruby]
MatthewsFace has quit [Read error: Connection reset by peer]
eggoez has joined #ruby
hololeap has joined #ruby
<hololeap>
i've got another question about coding best practices. what do you guys think about "if some_var" vs "unless some_var.nil?". i've seen the latter and wondered why bother, but it does seem more readable in a way
<pontiki>
readability is what it's all about
dgutierrez1287 has quit [Remote host closed the connection]
MatthewsFace has joined #ruby
<pontiki>
there are some general feeling that if you have an 'else' clause, you should use the 'if' form (no elses with unlesses)
JamesDH has joined #ruby
Rickmasta has joined #ruby
<pontiki>
more specifically to your exact question, unless some_var.nil? is running two comparisons
mleung has joined #ruby
<hololeap>
would there ever be a time when you would need to differentiate between nil and false on a returned value?
<pontiki>
and for me, if some_var is way more readable in that situation
Scroff has joined #ruby
<pontiki>
i've seen people do that, that somehow a tri-state boolean is being used
<pontiki>
there probably is a use case for tri-state logic
<hololeap>
good grief. i feel like people return nil too much as it is
<pontiki>
i don't disagree
<pontiki>
there are times when using a null object would be a much better choice
finisherr has joined #ruby
RegulationD has joined #ruby
kraljev11 has quit [Quit: kraljev11]
kraljev11 has joined #ruby
<hololeap>
is there a reason why so many methods in ruby avoid raising an exception and return nil instead?
wildroman2 has joined #ruby
balazs has joined #ruby
<pontiki>
idk
workmad3 has joined #ruby
<pontiki>
there is an oft-spoken phrase "don't use exceptions for flow control". i can't disagree with that either
MatthewsFace has quit [Ping timeout: 252 seconds]
Musashi007 has quit [Quit: Musashi007]
mleung has quit [Quit: mleung]
acke has joined #ruby
<pontiki>
using exceptions that way is essentially doing a GOTO
<bhaak>
i hate unless with a passion. it's so often runs into double negatives.
<hololeap>
hmm... ruby is so flexible sometimes i have a hard time wrapping my head around which way is "better"
<pontiki>
"better" isn't an absolute
Ox0dea has joined #ruby
<Ox0dea>
hololeap: "A puppet is free so long as he loves his strings."
Pupeno has quit [Remote host closed the connection]
<pontiki>
and it's a matter also of practicing and getting feedback
<bhaak>
and you can't ever be sure the programmer was sane enough to choose if or unless according to how likely it returns true
<Ox0dea>
bhaak: Is that "sanity" or premature optimization?
RegulationD has quit [Ping timeout: 264 seconds]
balazs has quit [Ping timeout: 265 seconds]
<pontiki>
over the years, i've seen 2 schools of thought. one is get all the error conditions out of the way up at the top. the other is do the main thing the method is responsible for at the top
acke has quit [Ping timeout: 250 seconds]
workmad3 has quit [Ping timeout: 272 seconds]
<pontiki>
i don't know that i have a specific preference in that regard. i want to be able to write a method so it's apparent what's going on
<Ox0dea>
I prefer the former, but I probably couldn't articulate exactly why.
<bhaak>
Ox0dea: it can't be premature optimization as the condition to the if/unless has to be evaluated anyway :)
<hololeap>
are there any good gems for basic type checking (like if there is only one parameter and it should only accept one type of object)
<Ox0dea>
pontiki: I like that it frees mental space for focusing on the happy path rather than dreading how things might be about to go wrong.
JamesDH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
decoponyo has quit [Read error: Connection reset by peer]
matled has quit [Remote host closed the connection]
<Ox0dea>
You really should step back and reconsider if you find yourself defining a method like "def bar a, b = String, c = [Numeric], d = :to_h | Hash | :keys, e", but it's nice to know you could.
kraljev11 has quit [Read error: Connection reset by peer]
kraljev11 has joined #ruby
<Ox0dea>
All that said, you really ought to embrace duck typing.
weszlem has joined #ruby
<hololeap>
yeah, i probably tend to do more type checking than is necessary
<hololeap>
isn't there going to be some kind of loose type checking for methods in the next ruby version?
weszlem has quit [Client Quit]
weszlem has joined #ruby
<Ox0dea>
It's all going to be JavaScript by then.
weszlem has quit [Client Quit]
<hololeap>
what do you mean?
<bhaak>
if that were true, I guess 80% of all programmers shoot themselves
<Ox0dea>
hololeap: Native is dying.
commondream has quit [Ping timeout: 252 seconds]
<Ox0dea>
Glacially, to be sure, but it's happening.
<pontiki>
Ox0dea: you mean native as in mobile apps?
<hololeap>
i'm still confused. what is "native"?
<Ox0dea>
pontiki: I'm using "native" to mean "non-Web" here.
<pontiki>
oh, sure
decoponio has joined #ruby
<Ox0dea>
JavaScript is permanently rooted as the language for the browser, and it's just going to keep getting faster.
<pontiki>
indeed
<pontiki>
they're into deep voodoo mad science now
<bhaak>
until it hurts so much that it will be changed
<hololeap>
i doubt i will ever ditch having a desktop or a hard drive
<pontiki>
it's only going to get better, or worse, depending on your pov on such things
ta has quit [Quit: Leaving...]
<Ox0dea>
hololeap: You would have asked for faster horses.
havenn has joined #ruby
<pontiki>
the browser is becoming the desktop, is becoming the OS
autrilla has quit [Quit: Connection closed for inactivity]
<Ox0dea>
That's about the size of it, yep.
<shevy>
javascript will kill everything
matled has joined #ruby
finisherr has quit [Quit: finisherr]
<pontiki>
wouldn't you say it's on the same trajectory as the guy who said "the network is the operating system"
havenwood has quit [Ping timeout: 265 seconds]
<pontiki>
sorry, brain farting on him
<Ox0dea>
Engelbart, maybe?
<pontiki>
and his company that got bought out by oracle
<pontiki>
well, he probably said it too
<pontiki>
sun
ta has joined #ruby
<pontiki>
mcnealy
allcentury has quit [Ping timeout: 250 seconds]
weszlem has joined #ruby
Scroff has quit [Remote host closed the connection]
<hololeap>
so are web servers going to be run on javascript too?
havenn has quit [Ping timeout: 245 seconds]
vifino has quit [Read error: Connection reset by peer]
baweaver has joined #ruby
wt has joined #ruby
<pontiki>
probably not entirely, but it will be more and more
wt is now known as Guest6422
j4cknewt has joined #ruby
<pontiki>
even so, a lot of that is dependent on developers
<pontiki>
java is still like 40% of web software
Guest6422 has quit [Remote host closed the connection]
<Ox0dea>
adaedra: I'm nearly done with my gem that lets you write "#{SNOWMAN} #{BLACK SNOWMAN} #{SNOWMAN WITHOUT SNOW}".
<jhass>
just because nobody pointed it out, one thing to keep in mind is that if foo and unless foo.nil? are only equivalent if false is not valid value
maletor has joined #ruby
<pontiki>
OMG I NEED THAT!!!
idafyaid has left #ruby [#ruby]
bronson has joined #ruby
wt_ has joined #ruby
Scroff has joined #ruby
mdz_ has joined #ruby
wt_ has quit [Read error: Connection reset by peer]
<Ox0dea>
adaedra: It's the good kind of blame.
bb010g has joined #ruby
<adaedra>
oh ok
<Ox0dea>
I managed to work around IO and TRUE, but these damned hyphens are mucking things up.
<pontiki>
the kind that means "i'm giving credit for my work to.."
bruno- has joined #ruby
<pontiki>
definitely starring that
skade has joined #ruby
aapole has quit [Ping timeout: 252 seconds]
j4cknewt has quit [Ping timeout: 256 seconds]
<Ox0dea>
Most of the time the hyphens create syntax errors, but there's a hack to handle them if they occur in the last word.
<Ox0dea>
For the sake of consistency, I decided to replace all the hyphens with underscores.
someword has quit [Quit: Leaving.]
<Ox0dea>
But now the hyphen-prefixed final words become locals instead of negated constants. :(
<pontiki>
that's the usual inflection, isn't it?
<Ox0dea>
pontiki: Well, Python, Perl, and even LOLCODE all support named unicode literals as the spec defines them. :/
<Ox0dea>
On the plus (?) side, ours don't actually have to be interpolated.
<Ox0dea>
`bad = PILE OF POO` will work just fine.
bronson has quit [Ping timeout: 276 seconds]
<Ox0dea>
Has anybody ever needed unary minus on Symbol?
Maxed has joined #ruby
mdz_ has quit [Ping timeout: 255 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has quit [Ping timeout: 265 seconds]
<pontiki>
not deliberately that i recall
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mleung has quit [Quit: mleung]
<adaedra>
Wait
Maxed has quit [Client Quit]
<adaedra>
Why do I have 93 gem downloads for a gem just providing UNICODE_SNOWMAN
<Ox0dea>
Why wouldn't you?
bruno- has joined #ruby
x1337807x has joined #ruby
<jhass>
bots
<shevy>
:)
<adaedra>
It's late, let's stop trying to understand the internet
<shevy>
95% of the downloads are scripted!
Scroff has quit [Remote host closed the connection]
<shevy>
I have had two people write emails to me about my gems; one complained that my gems lack documentation (he was right), the other reported a bug
balazs has joined #ruby
<shevy>
so there are real people out there too
<Ox0dea>
> real people
Azure has quit [Quit: Oops.]
<adaedra>
I'll have to add this gem to my résumé then
<Ox0dea>
Erm... should I release this as version 8.0.0 in accordance with the current Unicode standard?
allcentury has joined #ruby
<Ox0dea>
Rather, the upcoming standard, but that's the one whose characters I've included.
kraljev11_ has joined #ruby
kraljev11 has quit [Read error: Connection reset by peer]
<shevy>
adaedra perhaps someone wants to make a gem out of it...
<hololeap>
bots can complain too
<shevy>
"The Revenge of the Snowman" [splatter]
Azure has joined #ruby
<shevy>
I meant
<bhaak>
don't bind the version of your code to an external body
<shevy>
*game
<bhaak>
if you need to update it while the unicode standard hasn't been update, you would desync anyway
<Ox0dea>
bhaak: Fair point.
f3lp has quit [Ping timeout: 265 seconds]
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby
jenrzzz has joined #ruby
triangles has quit [Quit: Leaving]
malconis has joined #ruby
<shevy>
adaedra you can try to trick the bots and reach a million downloads
bosma has joined #ruby
ogpastaling has joined #ruby
<adaedra>
What would I do with a million downloads
Scroff has joined #ruby
Scroff has quit [Remote host closed the connection]
Scroff has joined #ruby
Scroff has quit [Remote host closed the connection]
<shevy>
get rich
mrmargolis has joined #ruby
<jhass>
reminds me, I should update the gems wordlist for the hangman bot
Scroff has joined #ruby
Scroff has quit [Remote host closed the connection]
diegoviola has joined #ruby
mleung has joined #ruby
<adaedra>
shevy: give me a million euros then
<jhass>
I just counted, I get ~65k then
<shevy>
adaedra I didn't download anything!
<adaedra>
jhass: you don't use /etc/words?
<jhass>
no
jenrzzz has quit [Ping timeout: 276 seconds]
<adaedra>
shevy: you don't have to
<Ox0dea>
My `wc -l /usr/share/dict/words` is 662952...
nertzy has joined #ruby
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wildroman2 has quit [Remote host closed the connection]
<adaedra>
mmh, I don't find a dictionnary on this machine
<jhass>
98105 gem_names
<jhass>
5947 ruby
<jhass>
1524 wordlist
<shevy>
huh
<shevy>
we have only 100.000 different gems?
starfox_sf has joined #ruby
<Ox0dea>
Seems reasonable enough?
andikr has quit [Remote host closed the connection]
<shevy>
if there are 1 million ruby users worldwide
<shevy>
only every 10 will have one gem
<adaedra>
102,914 according to rubygems.org
failshell has joined #ruby
<jhass>
yeah I should update it, now remember how I got it...
mrmargolis has quit [Remote host closed the connection]
blue_deref has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
hardlin3r has joined #ruby
wildroman2 has joined #ruby
<Ox0dea>
`gem search | wc -l` is 101628 for me.
failshell has quit [Ping timeout: 256 seconds]
<jhass>
latest_specs.4.8.gz has 102666
chouhoulis has joined #ruby
mrmargolis has joined #ruby
ebbflowgo has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
Scroff has joined #ruby
krisquigley has joined #ruby
sabayonuser2 has joined #ruby
ramfjord has joined #ruby
benlovell has quit [Ping timeout: 264 seconds]
chouhoulis has quit [Ping timeout: 265 seconds]
EllisTAA has joined #ruby
sabayonuser2 has quit [Client Quit]
rubie has joined #ruby
Scroff has quit [Remote host closed the connection]
<Ox0dea>
My kingdom for anybody who can work out the significance of the name.
krisquigley has quit [Ping timeout: 276 seconds]
sandstrom has joined #ruby
dseitz has joined #ruby
mrmargolis has quit [Remote host closed the connection]
weszlem has joined #ruby
whoami has joined #ruby
whoami is now known as Guest10032
<meph>
Ox0dea: lovely repo
<Ox0dea>
meph: Feel better?
pengin has joined #ruby
starfox_sf has quit [Quit: Lost terminal]
balazs has quit [Remote host closed the connection]
centrx has joined #ruby
Musashi007 has joined #ruby
Rollabunna has joined #ruby
endash has quit [Quit: endash]
<meph>
love that literal way
marr has quit []
x1337807x has joined #ruby
ReK2 has quit [Ping timeout: 265 seconds]
kraljev11_ has quit [Quit: kraljev11_]
kraljev11 has joined #ruby
kraljev11 is now known as kraljev11_
Scroff has joined #ruby
platzhirsch has joined #ruby
Takasm has joined #ruby
Rollabunna has quit [Ping timeout: 264 seconds]
ReK2 has joined #ruby
ReK2 has quit [Changing host]
ReK2 has joined #ruby
towski_ has joined #ruby
roolo_ has quit [Remote host closed the connection]
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Takasm has quit [Client Quit]
pengin has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
allcentury has quit [Ping timeout: 244 seconds]
jonr22 has joined #ruby
ferr has quit [Quit: WeeChat 1.2]
CustosLimen has quit [Ping timeout: 252 seconds]
wildroman2 has quit [Remote host closed the connection]
bzb has joined #ruby
bzb has quit [Read error: Connection reset by peer]
x1337807x has joined #ruby
CustosLimen has joined #ruby
pontiki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dented42 has joined #ruby
dfockler has joined #ruby
jonr22 has quit [Ping timeout: 255 seconds]
platzhirsch has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
jphenow has joined #ruby
Scroff has quit [Remote host closed the connection]
symbol has joined #ruby
Nahra` has joined #ruby
bhaak_ has joined #ruby
jpfuentes2 has joined #ruby
ebbflowgo has quit [Quit: ebbflowgo]
rgb-one has quit [Ping timeout: 264 seconds]
Nahra has quit [Ping timeout: 264 seconds]
bhaak has quit [Ping timeout: 264 seconds]
bihi has quit [Ping timeout: 264 seconds]
stylus has quit [Ping timeout: 264 seconds]
A124 has quit [Ping timeout: 264 seconds]
aep has quit [Ping timeout: 264 seconds]
gagrio has quit [Ping timeout: 264 seconds]
Liothen has quit [Ping timeout: 264 seconds]
bjornar has quit [Ping timeout: 264 seconds]
Affix has quit [Ping timeout: 264 seconds]
quarcu has quit [Ping timeout: 264 seconds]
M-Technic has quit [Ping timeout: 264 seconds]
patrick_star has quit [Ping timeout: 255 seconds]
quarcu_ has joined #ruby
dfockler has quit [Ping timeout: 265 seconds]
dudedudeman has quit [Ping timeout: 264 seconds]
rgb-one has joined #ruby
kraljev11_ has quit [Ping timeout: 246 seconds]
Liothen has joined #ruby
A124 has joined #ruby
bjornar has joined #ruby
bihi has joined #ruby
stylus has joined #ruby
aep has joined #ruby
Affix has joined #ruby
M-Technic has joined #ruby
gagrio has joined #ruby
michael_mbp has quit [Excess Flood]
Affix is now known as Guest80919
dudedudeman has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
sarkyniin has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
starfox_sf has joined #ruby
bhaak_ is now known as bhaak
<starfox_sf>
I am trying to connecto to a SMTP server using the net/smtp library but I am getting a Net::OpenTimeout every time... here is what I'm doing -> https://gist.github.com/5c3d062eb4fb28ca22e8