bzalasky has quit [Remote host closed the connection]
tomzx_mac has quit [Ping timeout: 248 seconds]
mossplix has quit [Quit: mossplix]
Rakko has quit [Quit: This computer has gone to sleep]
Nisstyre has quit [Ping timeout: 246 seconds]
<ryanf>
freedrull: lots of people don't like require_relative because it makes your directory structure rigid
<ryanf>
moving a file means rewriting all of its requires in addition to the things that require it
mrsolo has joined #ruby-lang
<ryanf>
but in a case where you'd instead be doing like "require File.expand_path(blah blah __FILE__ blah blah"
<ryanf>
I don't think there's a downside
datanoise has joined #ruby-lang
mossplix has joined #ruby-lang
psycho_one has joined #ruby-lang
Nisstyre has joined #ruby-lang
tms_ has joined #ruby-lang
retro|cz has quit [Remote host closed the connection]
mrsolo has quit [Quit: Leaving]
retro|cz has joined #ruby-lang
headius has quit [Quit: headius]
ramonmaruko has quit [Ping timeout: 252 seconds]
ramonmaruko has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
dkannan has joined #ruby-lang
datanoise has quit [Ping timeout: 260 seconds]
Rakko has joined #ruby-lang
dhruvasagar has joined #ruby-lang
workmad3 has joined #ruby-lang
zmack has joined #ruby-lang
S1kx has joined #ruby-lang
<mfn>
hi
waffleau has joined #ruby-lang
S1kx has quit [Quit: Leaving]
datanoise has joined #ruby-lang
dzhulk has quit [Quit: Leaving.]
andrewhl has quit [Remote host closed the connection]
tonni_ has joined #ruby-lang
chrismcgh has joined #ruby-lang
foca has quit [Ping timeout: 276 seconds]
zz_chrismcg has quit [Ping timeout: 276 seconds]
guilleiguaran has quit [Ping timeout: 276 seconds]
znz_jp has quit [Ping timeout: 276 seconds]
eban has quit [Ping timeout: 276 seconds]
Silex has quit [Ping timeout: 276 seconds]
eban1 has joined #ruby-lang
Silex^^ has joined #ruby-lang
tonni has quit [Ping timeout: 276 seconds]
foca has joined #ruby-lang
znz_jp has joined #ruby-lang
psycho_one has quit [Ping timeout: 240 seconds]
io_syl has quit [Ping timeout: 248 seconds]
datanoise has quit [Ping timeout: 256 seconds]
unlikely_monkey has quit [Remote host closed the connection]
towski has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
dc5ala has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
dhruvasagar has joined #ruby-lang
<Rakko>
hi mfn
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
charliesome has joined #ruby-lang
megha has joined #ruby-lang
bzalasky has joined #ruby-lang
ryanf has quit [Quit: leaving]
tenderlove has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
marr has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
dhsmith has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
yorickpeterse has quit [Quit: Who cares about these quit messages?]
tenderlove has joined #ruby-lang
Silex^^ is now known as Silex
tenderlove has quit [Read error: Connection reset by peer]
yorickpeterse has joined #ruby-lang
tenderlove has joined #ruby-lang
bondar has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
LanceHaig has joined #ruby-lang
dr_bob has joined #ruby-lang
bondar has quit [Ping timeout: 256 seconds]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
S1kx has joined #ruby-lang
Sinestro has quit [Quit: Computer has gone to sleep.]
rue|w has joined #ruby-lang
pbjorklund has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
ten1 has quit [Ping timeout: 252 seconds]
Averna has quit [Quit: Leaving.]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
rue|w has quit [Read error: Connection reset by peer]
rue|w has joined #ruby-lang
ryanf has joined #ruby-lang
dzhulk has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 248 seconds]
havenn has joined #ruby-lang
<manveru>
i try to keep all my requires in one place, not spread through the whole tree
<manveru>
lib/name.rb <- there they belong :)
<manveru>
and then require_relative is no harder than require
pbjorklund has quit [Quit: oh no]
<injekt>
and if its a gem just use require anyway because ./lib is in the load path
<Spaceghost|cloud>
I prefer just adjusting the ruby path.
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
<yorickpeterse>
injekt: not when you don't actually package it as a gem
<manveru>
i don't trust people to not screw up $RUBYLIB
<manveru>
or $LOAD_PATH
<Spaceghost|cloud>
I don't trust people ever.
<injekt>
yorickpeterse: so.. not a gem them :P
<manveru>
i said lib
<Spaceghost|cloud>
I still prefer adjusting the load path.
<manveru>
not all my libs are gems
<yorickpeterse>
injekt: if you make a Gem it doesn't modify $: until you actually create a .gem file and require it. That means that when running tests and such you still have to take care of that
wallerdev has quit [Quit: wallerdev]
<injekt>
mine either, and in those i would do things differently, but there's NEVER any reason to mess with the load path
stardiviner has joined #ruby-lang
<manveru>
tell that to the people that do :P
<injekt>
ruby has an -I switch for a reason
havenn has quit [Ping timeout: 244 seconds]
<Spaceghost|cloud>
Why not?
<injekt>
^^
<manveru>
see
<Spaceghost|cloud>
In code you own and write, what's wrong with adding to the load path?
<yorickpeterse>
tbh I don't really mind it that much as long as it doesn't go beyond `$:.unshift(...) unless $:.include?(...)`
<injekt>
Spaceghost|cloud: it's almost never necessary so i rarely see the point
<Spaceghost|cloud>
Development?
<injekt>
back to ruby -I
<manveru>
export RUBYLIB=/path/to/your/lib
<Spaceghost|cloud>
I guess I can see your point for that.
<injekt>
or that but I rarely use RUBYLIB
<manveru>
or -I, but that's more cumbersome for rake and the like
<injekt>
yeah
<Spaceghost|cloud>
I don't really see the major benefits.
<yorickpeterse>
Yes, lets require people to export variables when they can really just run `ruby whatever.rb` instead. Either way, it's a preference so there's no real point in iscussing it
<yorickpeterse>
* discussing
<injekt>
tbh I dont really care, but I want to punch every person EVER for modifying the load path in their executable files
<Spaceghost|cloud>
I don't do it in the executable so much as the typical gemname.rb file.
<Spaceghost|cloud>
The one I typically require everything else into.
solars has joined #ruby-lang
<injekt>
yeah that's just as pointless :D
<Spaceghost|cloud>
takes less work than dealing with your alternatives. :)
<injekt>
if it's a gem, the lib path is already in your load path so you're just adding a duplicate
<andrewvos>
zenspider: Yeah it is just too enterprisey. Too much code, too little payoff.
<Spaceghost|cloud>
It's in development, so it's not really a gem at that point.
<injekt>
right, I'm talking about published gems
<Spaceghost|cloud>
I don't see the value in not modifying the load path yet. I hear your desire to not do it, but I can't buy into it and join you in your distaste for it without you giving us that information.
zmack has quit [Read error: Connection reset by peer]
zmack has joined #ruby-lang
Rakko has quit [Quit: Bye]
<Spaceghost|cloud>
I understand that a gem is in the load path automatically.
dr_bob has quit [Quit: Leaving.]
jxie has quit [Quit: leaving]
<yorickpeterse>
Hence I said it's fine when you only add it when it's not already there
<yorickpeterse>
Other than that it just feels like one of those "I don't agree with it, thus it's wrong" arguments
<Spaceghost|cloud>
yorickpeterse: I understand your point. I'm kinda curious about injekt's, as I've been reading his stuff for a while now and respect his opinion.
<Spaceghost|cloud>
Not that I don't respect yours. I'm trying to learn more awesome stuff.
eban1 has quit [Quit: WeeChat 0.3.8]
eban has joined #ruby-lang
<yorickpeterse>
Oh I'm not trying to defend myself or anything :)
<Spaceghost|cloud>
yorickpeterse: I personally agree with you.
<manveru>
well, look at it that way, adding to $LOAD_PATH in your lib adds it to every lib that requires it, and ruby has to make one more file lookup for every require
emocakes has joined #ruby-lang
<yorickpeterse>
Correct, but if you do it after loading all your dependencies (= third party gems and such) it doesn't add a lot of overhead
<Spaceghost|cloud>
manveru: So you would suggest using relative_require's as a way to mitigate extra require time?
<manveru>
using require_relative, you don't have to worry whether it's a gem or not, you don't waste time adjusting $LOAD_PATH, you don't add lookup overhead, you just do what you need to
<Spaceghost|cloud>
Even with ruby2's nifty require lookup improvements?
<Spaceghost|cloud>
manveru: Requires a lot of time dealing with stupid stuff with the path to the file I want to require though.
<Spaceghost|cloud>
After it's done though, I guess that's all the time you invest.
<manveru>
you write it once, and you change it if you rename the file, same as normal require
<Spaceghost|cloud>
manveru: And if you move things, you have to change everything that uses it, relative to the file's location.
<manveru>
and just because ruby becomes faster doesn't mean we can do more pointless stuff :P
<manveru>
that's why i say, don't spread your requires all through your codebase
<Spaceghost|cloud>
As opposed to modifying the load path, which is a bit of a sed invcation.
<Spaceghost|cloud>
manveru: I guess. Yeah.
<Spaceghost|cloud>
I wonder, I may go test it in a large app. Add some code in lib/ and do each with benchmarks perhaps.
<manveru>
do so :)
<manveru>
mind you, i'm an old timer, and it was way worse in 1.8
<manveru>
1.9 sped up requires a bit, 1.9.3 even more
<rue|w>
Wait, 1.8 counts as old-timey now?
<Spaceghost|cloud>
manveru: I don't think you're wrong. Maybe it's my lack of zen that makes me not want to care that a file I want may be in ../../ or ../../../whatever
<manveru>
since nobody uses 1.6 anymore, sure
<manveru>
then again, 1.8 has no require_relative
<manveru>
so the point is rather silly :)
emocakes has quit [Quit: emocakes]
judofyr has joined #ruby-lang
chuenjin has joined #ruby-lang
<Spaceghost|cloud>
manveru: So in development only, I would like to think that the cost isn't high enough to deal with require_relative. Is it cheaper to use require_relative in a gem not in development if it's already going to be in the load path?
<manveru>
es
<manveru>
*yes
<Spaceghost|cloud>
So relative_requires are just inherently cheaper to use rather than load path, that makes sense.
<manveru>
because ruby can go directly to the file that needs to be required instead of walking through all the gems and $LOAD_APTH
<manveru>
that's why some rails apps have startup times in the minutes :P
<Spaceghost|cloud>
sorry got that backwards. require_relative
<Spaceghost|cloud>
It's 4am here.
gjaldon has joined #ruby-lang
<manveru>
np
<Spaceghost|cloud>
manveru: True. That makes sense.
tenderlove has joined #ruby-lang
KM|2 has quit [Read error: Connection reset by peer]
blacktulip has joined #ruby-lang
<manveru>
i'm not saying that it's the best thing in every case, it's just what i do
<Spaceghost|cloud>
It makes sense though.
waffleau has quit [Read error: Connection reset by peer]
waffleau has joined #ruby-lang
<Spaceghost|cloud>
injekt: So, you use require_relative a lot then?
waffleau_ has joined #ruby-lang
waffleau has quit [Read error: Connection reset by peer]
<Spaceghost|cloud>
manveru: So the benefits of require_relative would cascade downwards to users of the gem as well, right?
<judofyr>
manveru: the reason Rails apps have startup time in the minutes is that RubyGems is totally retarded when it comes it storing specifications :)
<Spaceghost|cloud>
Cause if that's true. And I think that's what you said, I think I just bought in.
<manveru>
judofyr: ok, that too :P
<Spaceghost|cloud>
Man, just bundle exec on anything sometimes takes forever.
<manveru>
but in general it would help if people wouldn't require dozends of gems
<Spaceghost|cloud>
manveru: The culture in rails is "Look for a gem, then look on the internet, avoid writing anything at all costs, even if it would have taken you less time to write it."
<judofyr>
wnd: or, this doesn't create a Proc object. but other than that, they're exactly the same
<wnd>
ok, thanks
<socialcoder>
what is wnd?
<socialcoder>
oops
<socialcoder>
haha
<socialcoder>
just to clarify
<socialcoder>
each_vowel(&code_block) does the ampersand mean anything?
<socialcoder>
or can it be anything there
<judofyr>
socialcoder: no. the ampersand is special
<socialcoder>
ah, so what is it telling
<judofyr>
`def each_vowel(&foo)` means that it accepts a block: each_vowel { … }
<judofyr>
if it was `def each_vowel(code_block)`, then `each_vowel { … }` would give you an ArgumentError because it accepts 1 argument, but you gave it none
<judofyr>
(blocks are kinda "special arguments" so they're not included in the error messages)
megha has quit [Ping timeout: 252 seconds]
security has joined #ruby-lang
esad has joined #ruby-lang
<judofyr>
(e.g. `each_vowel { … } `calls the method with zero arguments and a block argument,)
<judofyr>
socialcoder: so your original example just has two "levels" of blocks. you call each_vowel with a block (1), each_vowel calls #each with a block (2), the #each method calls the 2nd block and the 2nd block calls the 1st block which puts the vowel
GarethAdams has joined #ruby-lang
nkr has joined #ruby-lang
S1kx has quit [Quit: Leaving]
GarethAdams has quit [Client Quit]
cba has quit [Remote host closed the connection]
pbjorklund has joined #ruby-lang
<socialcoder>
hmm, this is gonna take me sometime to digest :)
<socialcoder>
I guess I will workout some examples of my own
<judofyr>
yeah
<judofyr>
socialcoder: have you done any JavaScript?
esad has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Quit: Lost terminal]
dhruvasagar has joined #ruby-lang
<injekt>
Spaceghost|cloud: no I never use require_relative
<injekt>
I use require everywhere and dont alter the load path except when running my tests
cba has joined #ruby-lang
dhruvasagar has quit [Client Quit]
dhruvasagar has joined #ruby-lang
ruskie has joined #ruby-lang
<Spaceghost|cloud>
interesting.
<Spaceghost|cloud>
I prefer require_relative
dwu1 has quit [Quit: Leaving.]
<injekt>
i never really liked it and I'm not sure why
gjaldon has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
<socialcoder>
Judo, back
<socialcoder>
nope, Ruby is my entry into the world of programming
<socialcoder>
did a bit of html, css before, but I know they are not related
<socialcoder>
why do you ask
<judofyr>
socialcoder: oki. JavaScript uses a lot of callbacks, and they are pretty similar to how blocks work in Ruby :)
<injekt>
wuddup judofry
tenderlove has quit [Read error: Connection reset by peer]
chekcmate has joined #ruby-lang
<socialcoder>
Ah I see
<chekcmate>
hello everyone!
<judofyr>
inkjet: working on some stuff and helping socialcoder with blocks :)
<socialcoder>
I do wish I had that background
rolfb has joined #ruby-lang
tenderlove has joined #ruby-lang
<socialcoder>
haha
<injekt>
judofyr: :)
dhruvasa1ar has joined #ruby-lang
<judofyr>
hello checkmate
<socialcoder>
hey checkm8
<injekt>
min
<injekt>
mon
<injekt>
...
<injekt>
moin
dhruvasa1ar has quit [Client Quit]
<chekcmate>
hey judofyr hey injekt
dhruvasagar has quit [Quit: Lost terminal]
<judofyr>
injekt: you're getting there
<chekcmate>
moin moin heh
<socialcoder>
so judo, proc, lambda, code block al are same right?
<injekt>
judofyr: it's been a long morning
dhruvasagar has joined #ruby-lang
<injekt>
:D
xalei has quit [Remote host closed the connection]
<judofyr>
injekt: also, working on quickload.js in my spare time now.
<injekt>
judofyr: yeah I noticed that, looks interesting
<socialcoder>
so judo, proc, lambda, code block al are same right?
<judofyr>
socialcoder: well, block is the syntax. this is a block: `{ |args| }`
<judofyr>
socialcoder: a proc is an object
<judofyr>
representing a block
<judofyr>
a lambda is a special kind of proc
<judofyr>
a lambda behaves different from a proc when it comes to `return` and such
<Spaceghost|cloud>
We
<chekcmate>
why won't the second one be triggered?
<_tockitj>
how to concatenate two iterators together ?
<andrewvos>
_tockitj: #zip?
<apeiros_>
define 'concatenate iterators'
<_tockitj>
i have two collections and want to iterate them both in one loop - once all elements of one collection are visited - it should continue to the next
<Mon_Ouie>
I don't think there's a method to do it as it is but you could easily define it using Enumerator or your own class (e.g. Enumerator { |y| a.each { |e| y << e }; b.each { |e| y << e } }
<_tockitj>
converting them both to arrays and adding them up might consume too much space
<savagecroc>
"vegetation [vegetation || ved'ten]\nn. , , \n" << seems to be missing half the text in the match
<injekt>
or $&
<savagecroc>
pretty much i want to split the file into an array
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<injekt>
then you probably dont want match
waffleau_ has quit [Quit: waffleau_]
<savagecroc>
first file has somethign bla bla [maybe has this]\nadj. something something\nn. something something\nand now wer are onto the next one[etc]
<savagecroc>
regex works in sublime
<savagecroc>
ahh hmm
<injekt>
savagecroc: these are some very strange things to split a file on
<hagabaka>
isn't sort_by{|i| i.split(" ").first } the same as sort?
mossplix has quit [Quit: mossplix]
GarethAdams has quit [Quit: Leaving...]
<lupine>
not exactly
davidbalber|away is now known as davidbalbert
<lupine>
specifically, it results in the block only being called once per element
<lupine>
(technical term, schwartzian transform)
<lupine>
from the docs: "As of Ruby 1.8, the method Enumerable#sort_by implements a built-in Schwartzian Transform, useful when key computation or comparison is expensive. [...] The current implementation of sort_by generates an array of tuples containing the original collection element and the mapped value. This makes sort_by fairly expensive when the keysets are simple"
<hagabaka>
I'm not talking about sort with a block. I mean since the paste is dealing with words, sort_by{|i| i.split(" ").first } should give the same result as simply sort
tdy has joined #ruby-lang
<lupine>
if you don't give sort a block, it just uses <=>
<lianj>
hagabaka: youre probably right
<lupine>
if that happens to be equivalent to your sort_by block then the result will be the same
banisterfiend has quit [Remote host closed the connection]
unlikely_monkey has quit [Remote host closed the connection]
unlikely_monkey has joined #ruby-lang
unlikely_monkey has quit [Remote host closed the connection]
Zissler has joined #ruby-lang
wallerdev has joined #ruby-lang
glebm has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
GarethAdams has joined #ruby-lang
dr_bob has joined #ruby-lang
dkannan has quit [Quit: dkannan]
havenn has joined #ruby-lang
rdw200169 has joined #ruby-lang
<chekcmate>
can I make this shorther? roarray << line_edit(line) roarray = roarray.uniq
<chekcmate>
roarray.uniq << line_edit(line) is this ok?
<chekcmate>
(that can't work, can it? ^.-)
<chekcmate>
anyways - pleased to read a shorter way :)
<apeiros_>
and people tell me that *nix package managers where heaven…
<apeiros_>
*were
<apeiros_>
it may be less messy than win's DLL hell, but it's still messy.
<Uranio>
apeiros_: I wonder what OS you use...
<apeiros_>
osx, and no, the *nix part inherited there isn't any better.
headius has quit [Quit: headius]
<emocakes>
apeiros_, macports ftw
<apeiros_>
but I do like the self contained .app packages
<Uranio>
and spend a lot of money
<apeiros_>
emocakes: I use brew. even though it does the idiocy of chown'ing /usr/local (awesome, isn't it?)
<apeiros_>
Uranio: so? my time is worth much more than the money I spend.
<apeiros_>
not to speak of my sanity :-p
headius has joined #ruby-lang
<Uranio>
good point...
<apeiros_>
if you want cheap, use paper and pencil ;-)
* Uranio
stop talking about OS before start a flame war
workmad3 has joined #ruby-lang
<emocakes>
thats why I dont use brw
<emocakes>
because it fucks up /usr/local
<emocakes>
*brew
breakingthings has joined #ruby-lang
chris2 has joined #ruby-lang
lun_ has quit [Remote host closed the connection]
kogent has quit [Quit: kogent]
Bearproof has joined #ruby-lang
elux has quit [Quit: Leaving...]
Bearproof has left #ruby-lang [#ruby-lang]
kogent has joined #ruby-lang
maxmanders has joined #ruby-lang
lun_ has joined #ruby-lang
rippa has joined #ruby-lang
adamjleonard has joined #ruby-lang
<whitequark>
/usr/local/ is supposed to be fucked up
<whitequark>
by random tools
<apeiros_>
whitequark: but not to be chowned to a single system user…
<ten1>
^
* apeiros_
should stop using … in inappropriate places
<whitequark>
apeiros_: if the system is indeed owned by a single user, why not?
<apeiros_>
whitequark: if brew knew it was always the case
<apeiros_>
but it isn't
<whitequark>
oh. I see.
<apeiros_>
I'm a fan of user-specific installs. but those should IMO go into ~
<apeiros_>
but that said, I'm not a fan of any current OS design
<apeiros_>
(not speaking about the visual design, in case that's not clear :) )
<ten1>
apeiros_: plan 9 then? :P
towski has quit [Remote host closed the connection]
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby-lang
<apeiros_>
ten1: singularity sounded interesting. but I doubt it'll ever evolve into a public product :(
<apeiros_>
but I haven't looked much at plan 9
<apeiros_>
might well be that it has concepts which I long for
hakunin_ has joined #ruby-lang
<whitequark>
plan 9 is "dhh opinionated" imo
lun_ has quit [Remote host closed the connection]
<whitequark>
the notion that the single true way to make a code editor is to omit syntax highlighting and use mouse chords immediately puts me off.
<apeiros_>
I'm hooked!
* apeiros_
coded without syntax highlighting for a very long period in his life
* chris2
still does
hakunin has quit [Ping timeout: 248 seconds]
<whitequark>
meh.
MaddinXx has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
nik_ has quit [Quit: Leaving]
<chris2>
and sam doesnt need chords :P
kogent has quit [Quit: kogent]
hugobastien has quit [Remote host closed the connection]
bfleischer has joined #ruby-lang
<apeiros_>
whitequark: was a performance issue back then ;-)
rippa has quit [Read error: Connection reset by peer]
<apeiros_>
I wrote faster than the editor with highlighting on.
rippa has joined #ruby-lang
lun_ has joined #ruby-lang
<whitequark>
apeiros_: oh.
<whitequark>
sounds like a PITA.
blazes816 has quit [Quit: blazes816]
<banisterfiend>
apeiros_: what langauge was this? qbasic?
<apeiros_>
well, that's what you get with 25MHz@16bit ;-)
<apeiros_>
banisterfiend: first hypertalk, then perl
<whitequark>
apeiros_: 25MHz@16bit can be a lot
xalei has joined #ruby-lang
<whitequark>
it also depends on ISA, cache size and memory bandwidth ;)
<apeiros_>
68020, you can probably find all relevant information on WP ;-)
<apeiros_>
MacII si
<banisterfiend>
wow the graphics in second life has really improved now
<whitequark>
don't need to, I know about this chip enough already
<whitequark>
heh.
<banisterfiend>
it looks pretty amazing
<apeiros_>
the graphics card might also have been the culprit, no idea really. I just noticed a lag with highlighting on, and it was annoying enough to disable highlighting :)
<Uranio>
sorry... but the compilation still failing :/
<Uranio>
could some body help me
<whitequark>
apeiros_: there's also an important difference between MHz and MIPS.
<whitequark>
apeiros_: eg newer ARMs have 1.25DMIPS/MHz, and your chip IIRC has somewhere around 1/8MIPS/MHz
MaddinXx has quit [Remote host closed the connection]
<whitequark>
and that would only be integer performance. for memory access, multiply by at least 1.5
<ten1>
and MIPS ain't a great measure either
<apeiros_>
whitequark: heh, having had a mac, I've been quite exposed to MHz vs. performance discussion ;-)
kogent has joined #ruby-lang
rippa has quit [Read error: Connection reset by peer]
<whitequark>
ten1: with MIPS, you can at least compare CPUs implementing one ISA or similar ISAs
v0lta has joined #ruby-lang
v0lta has quit [Client Quit]
<Uranio>
look like it can't find parse.h cause is looking for libxml and is named libxml2 in debian... let me make a link
rippa has joined #ruby-lang
v0lta has joined #ruby-lang
<whitequark>
ten1: eg I would argue that DMIPS@MIPS CPU and @ARM CPU are at least somewhat representative of the integer performance.
JohnBat26 has quit [Read error: Operation timed out]
<whitequark>
so that there would be "overflowing" +, "saturating" +, "overflow->exception" +, "modwrap" +
<whitequark>
and possibly "non-overflowing but returning a wider data" +
karasawa has quit [Ping timeout: 255 seconds]
<whitequark>
how do you think this polymorphism should be handled?
<apeiros_>
metadata in the number object?
jonahR has joined #ruby-lang
<apeiros_>
e.g. value.carry_over .overflow? etc.
mj_lk has joined #ruby-lang
<whitequark>
apeiros_: the problem is that this semantics is naturally related to the operation and not the value itself
<whitequark>
i.e. it is perfectly reasonable to do a saturating multiply, but then add the result to accumulator where overflow should result in an error
<whitequark>
as far as I understand it
<apeiros_>
I'm not so sure of that :)
<apeiros_>
that's just how it has been done so far
<apeiros_>
but I see what you mean
bluepojo has joined #ruby-lang
<whitequark>
apeiros_: well, here, the semantics is dictated by the algorithms commonly used and not elegance or whatever
<apeiros_>
have specific methods which return a Int32OpResult struct e.g.?
<apeiros_>
(those are quick shots, so there's quite probably a better solution)
<whitequark>
i.e. you suggest adding #overflowing_add, #saturating_add, #non_overflowing_add, ...?
<apeiros_>
ugly way: have thread locals with those values for the last executed operation
<apeiros_>
whitequark: yes, I'm a fan of "say what you mean"
schaerli has joined #ruby-lang
<whitequark>
well, I should note that I aim for compilation to native code, so thread locals don't really fit
lun_ has quit [Remote host closed the connection]
<whitequark>
once you consider how the compiler could reorder the instructions, etc.
<apeiros_>
that's out of my ballpark of knowledge :-/
adambeynon has joined #ruby-lang
<whitequark>
apeiros_: that might make perfect sense, since I'm not aware of any better way
<whitequark>
C uses pragmas to annotate blocks of code
<whitequark>
that is erm... sub-par
<whitequark>
in fact the only official standard I've seen is written like there was this one vendor who needed something to be certified, and they sponsored it
<soahccc>
Is there a list of special methods I can override? like == + etc
<whitequark>
soahccc: every one of them
<banisterfiend>
whitequark: do you know much about open source hardware movement?
<whitequark>
banisterfiend: kinda
<soahccc>
whitequark: But I can't really add something new, can I?
<whitequark>
soahccc: oh. no.
<whitequark>
I have had a list somewhere.
<banisterfiend>
whitequark: do you think it's viable? or do you think it'll all be killed by patent warfare
<whitequark>
banisterfiend: OSHW isn't affected by patent warfare. what's worse is that there's nothing to kill
<whitequark>
there are some stupid arduino fans who think they did a single pcb and now they know everything
kogent has quit [Quit: kogent]
<banisterfiend>
whitequark: well the 'opencores' initiative was threatened with multiple patent lawsuits by mips
<whitequark>
and there's also folks who either already understand that you cannot make good hardware like you make good OSS, or will understand it
<whitequark>
banisterfiend: meh, who cares. linux was threatened with multiple patent lawsuits by microsoft.
<whitequark>
"threatened"
<banisterfiend>
whitequark: linux is defended by many big companies and the open invention network though, opencores doesnt really have much afaik
<whitequark>
the actual problem with hardware is that it costs awfully lot to produce, and there won't be a helpful pry repl to fix your errors
neocoin has quit [Remote host closed the connection]
<soahccc>
whitequark: hmm doesn't work then I suppose
<whitequark>
soahccc: well, there's no <<! operator and there couln't be
<whitequark>
if we're talking about ruby
Uranio has quit [Quit: while you reading this, a kitty dies]
<blahwoop>
whats a good source to practice and write simple ruby apps?
<whitequark>
you can usually emulate the behavior you want with some hacks, but note that the code above is confusing to those who know that there's no <<! operator.
<banisterfiend>
whitequark: they have multi-million dollar patents, and they exist just to safeguard linux from patent trolls
<banisterfiend>
they either strike deals with the trolls, or threaten litigation
<soahccc>
yeah I know I thought I could just say def <<| which would be a bit more descriptive...
<whitequark>
soahccc: this isn't lisp for you to define your own syntax
<banisterfiend>
soahccc: google for superators
<soahccc>
That seems to work but isn't that pretty, is it? (result ||= []) << "foo"
<banisterfiend>
u can do some crazy stuff with that but i've never used them
<whitequark>
banisterfiend: also, say goodbye to performance
bfreeman_ has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
bfreeman has quit [Read error: Connection reset by peer]
wyhaines has quit [Read error: No route to host]
xalei has quit [Remote host closed the connection]
wyhaines has joined #ruby-lang
glebm has joined #ruby-lang
workmad3 has joined #ruby-lang
davidbalbert is now known as davidbalber|away
fp- has joined #ruby-lang
<fp->
hey guys… i'm in need of some design advice
<fp->
also willing to pay for it
<fp->
i am using rails, but this is more of a design question
<drbrain>
I see only statements
Asher has quit [Ping timeout: 255 seconds]
<fp->
i have 2 types of data (for simplicity's sake)… a domain registration record (containing expiry information, registration date, etc.) and a virtual domain object that is part of a remote API call
ryanv-raptor has joined #ruby-lang
<fp->
if the user goes to their domains page, it combines this information so that one domain (i.e. example.com) shows when it was registered, when it expires, and how much disk space, and bandwidth it has consumed on the server
Nisstyre-laptop has quit [Quit: Leaving]
tenderlove has quit [Remote host closed the connection]
<fp->
so I have one Domain object that is tied to the database and one that is a rest/api client
<fp->
the difficulty is in caching and merging this data on one screen
<fp->
right now I have a Domain object which is just an ActiveModel, with attributes for name, expires_at, registered_at, disk_space_used, bandwidth_used, etc.
<fp->
and in my Client object, I have a method called "domains" which just calls my Registration model and my VirtualDomain API, to populate the Domain collection
<fp->
I make use of memcache caching on the API side so that I'm not polling on every requet.
<apeiros_>
oh, drbrain - any reason Gem::Version is now rubygems/version instead of the (IMO more appropriate) older gem/version ?
<drbrain>
apeiros_: AFAIK it was always implemented in rubygems/version.rb
<drbrain>
if it was once gems/version.rb it was before my time
<fp->
my current approach seems wrong… it's not a real ActiveRecord association
<apeiros_>
drbrain: um, no. I have old code which required 'gem/version' and which doesn't work
christina has quit [Quit: christina]
<apeiros_>
+anymore
<apeiros_>
drbrain: ok, so the switch from gem/version to rubygems/version in that case happened before your time
<fp->
so I got to thinking about refactoring it and thought that it might be better to move my ActiveModel Domain model to an ActiveRecord domain model, where we can use the database to cache the response from each API call to get information about the hosted domain
<drbrain>
I think I first got involved in the mid-0.8 versions
<drbrain>
fp-: then you have to worry about cache invalidation in the DB, if that's acceptable, ok
<fp->
most of this app is completed, but this area seems a little above my comfort with application design
<fp->
i just feel like my current implementation is messy
<fp->
if you want to add a domain, I'm using a presenter to collect the info from the end user, such as whether or not to register the domain, if they want hosting, etc.
<drbrain>
fp-: joining two data sources is often messy. Provided you have a common key, write a method to merge on it.
<apeiros_>
drbrain: hm, then it must have happened during your time actually. because I'm pretty sure with rubygems ~1.3 it still worked
ddv has quit [Changing host]
ddv has joined #ruby-lang
<fp->
and then it will either create a Registration record and/or VirtualDomain
<drbrain>
apeiros_: rubygems never uninstalled old files, so maybe it worked by accident
christina has joined #ruby-lang
<fp->
drbrain: do you know of any open source stuff I can look at for an example on how to do this properly?
<fp->
or a search term i can possibly use to find more… i haven't had any luck
<drbrain>
fp-: "properly" is very dependent upon data sources
<fp->
well even just an example of a similar situation
<drbrain>
nothing comes to mind, maybe someone else will have one
<fp->
the geocoder project seemed somewhat similar, in that ActiveRecord long/lat fields would auto-populate from the API if they were absent or stale
<fp->
but it's more efficient for my app to get a complete list of the customer's hosted domains and update a collection vs requesting info from the server on each domain name when it's iterated over
Bearproof has joined #ruby-lang
Bearproof has left #ruby-lang [#ruby-lang]
rippa has quit [Read error: Connection reset by peer]
rippa has joined #ruby-lang
imajes has quit [Excess Flood]
workmad3 has quit [Ping timeout: 276 seconds]
imajes has joined #ruby-lang
chuenjin has quit [Ping timeout: 260 seconds]
robbyoconnor has quit [Read error: Connection reset by peer]
cddr`` has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby-lang
mj_lk has left #ruby-lang [#ruby-lang]
mjolk has joined #ruby-lang
<mjolk>
i'm referencing an object inside of a class, i can use the global scope by prefixing the inner object with '::' correct?
<fp->
there's a comment on the solution: I'd just add that with a large number of subscriptions this would be pretty slow. More efficient is to retrieve all data by a single request to the API. – RocketR Nov 17 '12 at 10:48
<fp->
if I could figure out how to do that (retrieve all data by a single request) cleanly, then i'd be all set
<fp->
maybe a proxy class?
<apeiros_>
drbrain: ah, that might be an explanation, yes
<mjolk>
I keep getting the error: 'NameError: uninitialized constant Net::SSH::HostKeyUnknown'. gem list --local shows net-ssh (2.6.3, 2.6.2, 2.2.2) and I have "require 'net/ssh'" in my .rb... I'm calling Net::SSH:: from inside of a class, but I have it prepended with ::, what gives?
christina has quit [Quit: christina]
pbjorklund has quit [Quit: oh no]
fp- has left #ruby-lang [#ruby-lang]
crudson has joined #ruby-lang
maxmanders has joined #ruby-lang
zmack has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
<manveru>
you have your own class called Net ?
<blazes816>
bust open pry and do Net::SSH.constants or Net::SSH.source_location to try and grasp where you are
<blazes816>
and ensure you're hitting what you think you are
<mjolk>
manveru: I don't have a local class called net
<mjolk>
what's pry ?
<injekt>
mjolk: it's a Ruby REPL
<mjolk>
nevermind, found it on github (git://github.com/pry/pry.git)
__BigO__ has joined #ruby-lang
<manveru>
gem i pry
<manveru>
i'd say irb is enough though :)
<banisterfiend>
manveru: upgrade yourself
<banisterfiend>
:D
<bougyman>
for srs.
<bougyman>
pry is quite nice.
<banisterfiend>
bougyman: r u on the most recent release?
<banisterfiend>
(0.9.11)
<banisterfiend>
that has pimped out tab completion and a few other cute things
<injekt>
:)
__BigO__ has quit [Remote host closed the connection]
<manveru>
i still don't know what pry is good for, it acts like irb, so why use it instead?
<banisterfiend>
and an updated slop gem for extra cool :)
<banisterfiend>
manveru: show-source MyClass
<banisterfiend>
manveru: it'll pull the source of your class and show it to you prettily syntax highlighted in a pager
<andrewvos>
manveru:Why uses themes in your terminal?
<manveru>
themes?
<banisterfiend>
manveru: further, u can edit MyClass#my_method it'll drop u in the editor at the file/line you can modify the code, quit, it'll auto-reload it
__BigO__ has joined #ruby-lang
<banisterfiend>
manveru: also, pry isn't just an irb replacemtn, it's a debugger replacment, u can call it in the middle of a running process, explore your runtime state, pull source on methods, classes, edit method, save them
<manveru>
i think i just need to get around fixing those urxvt colors
<manveru>
they are really unreadable
<banisterfiend>
manveru: my favorite thing is: show-source MyClass -a the '-a' will attempt to show u the source for every monkeypatch of the class
<banisterfiend>
(*attempt* :)
<injekt>
heh
carloslopes has quit [Remote host closed the connection]
<whitequark>
banisterfiend: I've implemented several features of pry in my ruby dialect/impl
<whitequark>
(it doesn't make sense to run pry as-is or any subset of it there)
<banisterfiend>
whitequark: so you keep the source around ?
<whitequark>
banisterfiend: the source of what?
<banisterfiend>
methods/classes (im just guessing)
<mjolk>
ugh pry
<whitequark>
banisterfiend: oh. no. first, this is the part which I didn't get to implement yet
<mjolk>
ugh ruby packaging
<mjolk>
this is all besides the pint
solars has quit [Ping timeout: 248 seconds]
<mjolk>
*point
<whitequark>
banisterfiend: second, when I will, I'll just follow the way gdb and friends work
<whitequark>
ie fetch the source directly from the filesystem
<manveru>
banisterfiend: i might just add it to my gemset defaults
<injekt>
ugh gemsets
<banisterfiend>
manveru: cool
karasawa has joined #ruby-lang
yfeldblum has joined #ruby-lang
<banisterfiend>
whitequark: your implementation is closed source right?
chris2_ has joined #ruby-lang
<manveru>
banisterfiend: so how do you differentiate between commands and methods or vars?
karasawa has quit [Ping timeout: 276 seconds]
ryanf has joined #ruby-lang
<banisterfiend>
manveru: commands get precedence, but in case of conflict you have a few options: 1. prepend a space (commands only execute if they're hard against the margin) 2. you can define a e.g Pry.config.command_prefix = "%", that will force all commands to only execute if they have a symbol like % before them
<manveru>
great, thanks
<banisterfiend>
manveru: but generally command names are chosen so that they wont conflict (they often have hyphens, like show-source)
<manveru>
yeah, wish empty tab-complete would show them :)
<manveru>
but not sure if that even triggers the readline completion
<banisterfiend>
manveru: our 'help' system is pretty good, u can type 'help show' and it'll show all commands that start with show, etc, or u can pass a command group name along, and it'll show you all commands that belong to that group
<banisterfiend>
'help' by itself just shows everything
<banisterfiend>
manveru: show-source also works on commands, btw. So if yur'e curious how commands are implemented you can do something like: show-source edit for example
<injekt>
funny i didn't even know that
chuenjin has joined #ruby-lang
<banisterfiend>
injekt: yeah i just added that in the last release
<injekt>
banisterfiend: neat
<banisterfiend>
show-source should be able to work on almost anything, methods, classes, modules, objects, commands, the only thing i didnt add support for is files, and im tempted to do that too
<banisterfiend>
to add symmetry to 'edit' comamnd which can edit everything, including files
<injekt>
makes sense, maybe only if the extension is included (knowing they definitely dont want anything BUT the file)
<manveru>
well, it can't find Date.today :)
<manveru>
but it does find Time.now
<banisterfiend>
manveru: yeah, tha'ts a problem with our YARD database, i can never get it to scrape all source from stdlib/core for some reason
<banisterfiend>
it always leaves things out
<manveru>
yeah, not blaming you, i didn't expect it to find Time.now either
runeb has joined #ruby-lang
chris2 has quit [Quit: und wech...]
<banisterfiend>
manveru: but (i assume u have pry-doc and the debugger gems installed) try this: $ Debugger#add_breakpoint
chris2_ is now known as chris2
imajes has quit [Excess Flood]
<banisterfiend>
it guesses where the *.c files are stored for C extensions, and tries to extract the source
<banisterfiend>
ond emand
<banisterfiend>
demand*
imajes has joined #ruby-lang
<banisterfiend>
use ? for reading docs, and $ for reading source