drbrain has quit [Remote host closed the connection]
JoelMcCracken has joined #ruby-lang
<elico>
havenn: Thanks for that. I have tried to think of a way to use it but my problem is that I am trying to implement A transparent proxy which needs special sockets and I am not sure if at can or cannot be done using it.
dankest has quit [Quit: Leaving...]
<elico>
it*
seanstickle has joined #ruby-lang
guns has joined #ruby-lang
apeiros_ has quit [Ping timeout: 244 seconds]
io_syl has quit [Ping timeout: 265 seconds]
bryno has joined #ruby-lang
mjio has quit []
Briney has quit [Quit: Briney]
<elico>
havenn: my sockets have special properties ...
sn0wb1rd has quit [Quit: sn0wb1rd]
alvaro_o has quit [Quit: Ex-Chat]
mjio has joined #ruby-lang
krohrbaugh1 has quit [Quit: Leaving.]
chessguy has joined #ruby-lang
intellitech has joined #ruby-lang
tris has quit [Excess Flood]
drbrain has joined #ruby-lang
apeiros_ has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
tris has joined #ruby-lang
drbrain has quit [Read error: Connection reset by peer]
drbrain has joined #ruby-lang
nertzy2 has joined #ruby-lang
nertzy has quit [Ping timeout: 256 seconds]
apeiros_ has quit [Ping timeout: 264 seconds]
havenn has quit [Remote host closed the connection]
mwjcomputing has joined #ruby-lang
agarie has quit [Remote host closed the connection]
havenn has joined #ruby-lang
headius has joined #ruby-lang
glebm has joined #ruby-lang
havenn has quit [Ping timeout: 265 seconds]
loladiro has joined #ruby-lang
headius_ has joined #ruby-lang
headius has quit [Ping timeout: 250 seconds]
headius_ is now known as headius
krohrbaugh has joined #ruby-lang
headius has left #ruby-lang [#ruby-lang]
srbaker has quit [Quit: Computer has gone to sleep.]
briantrust has quit [Remote host closed the connection]
sepp2k1 has quit [Read error: Connection reset by peer]
imajes has quit [Excess Flood]
seanstickle has quit [Quit: seanstickle]
imajes has joined #ruby-lang
joast has joined #ruby-lang
CaptainJet has quit [Ping timeout: 256 seconds]
CaptainJet has joined #ruby-lang
lagzilla has quit [Ping timeout: 272 seconds]
apeiros_ has joined #ruby-lang
lagzilla has joined #ruby-lang
intellitech has quit [Quit: intellitech]
stonerfish has quit [Quit: Leaving.]
brianpWins has joined #ruby-lang
apeiros_ has quit [Ping timeout: 260 seconds]
wyhaines has joined #ruby-lang
seydar has joined #ruby-lang
<seydar>
i just had a thought. should i care about making things explicitly SINGLE THREADED?
<seydar>
like, i'm just writing some non-threaded code, and i need to iterate through an array in order
<seydar>
how would i communicate my need for that code to be run consecutively to the interpreter?
<seydar>
obviously it's not necessary
<seydar>
but... fuck i can't articulate myself. does someone get what i'm saying?
elico has quit [Ping timeout: 255 seconds]
srbaker has joined #ruby-lang
agarie has joined #ruby-lang
ryanf_ has joined #ruby-lang
pototo has joined #ruby-lang
hakunin has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 265 seconds]
hakunin has joined #ruby-lang
CaptainJet has quit []
xalei has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
havenn has joined #ruby-lang
mwjcomputing has quit [Quit: Leaving]
chessguy has quit [Remote host closed the connection]
briantrust has joined #ruby-lang
apeiros_ has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
rohit has joined #ruby-lang
tdy has quit [Read error: Connection reset by peer]
tdy has joined #ruby-lang
pototo has quit [Quit: pototo]
apeiros_ has quit [Ping timeout: 250 seconds]
esad has joined #ruby-lang
ebouchut has joined #ruby-lang
dankest has joined #ruby-lang
Jayje_Atrhavein has joined #ruby-lang
rohit has quit [Quit: Leaving]
Jayje_Atrhavein has left #ruby-lang [#ruby-lang]
kurko_ has quit [Ping timeout: 256 seconds]
seydar has quit [Quit: leaving]
linc01n has quit [Ping timeout: 246 seconds]
linc01n has joined #ruby-lang
guns has quit [Ping timeout: 252 seconds]
xyzodiac has joined #ruby-lang
chessguy has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
bluepojo has quit [Ping timeout: 250 seconds]
rippa has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
apeiros_ has joined #ruby-lang
guns has joined #ruby-lang
apeiros_ has quit [Ping timeout: 256 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
anannie has quit [Remote host closed the connection]
xyzodiac has joined #ruby-lang
xyzodiac has quit [Client Quit]
spinagon has joined #ruby-lang
rippa has quit [Read error: Connection reset by peer]
srbaker has joined #ruby-lang
JoelMcCracken has quit [Ping timeout: 265 seconds]
apeiros_ has joined #ruby-lang
havenn has quit [Remote host closed the connection]
headius has joined #ruby-lang
headius has quit [Client Quit]
apeiros_ has quit [Ping timeout: 246 seconds]
headius has joined #ruby-lang
loladiro has quit [Quit: loladiro]
xyzodiac has joined #ruby-lang
chessguy has quit [Remote host closed the connection]
jobicoppola has joined #ruby-lang
jobicoppola has quit [Client Quit]
intellitech has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 265 seconds]
Spaceghostc2c has quit [Excess Flood]
Spaceghostc2c_ has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
mjio has quit []
briantrust has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
ebouchut has quit [Quit: This computer has gone to sleep]
vlad_sta_ has quit [Ping timeout: 256 seconds]
gregmoreno has joined #ruby-lang
imperator2 has joined #ruby-lang
Spaceghostc2c_ is now known as Spaceghostc2c
molly has joined #ruby-lang
molly has left #ruby-lang [#ruby-lang]
gregmoreno has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
mistym has quit [Remote host closed the connection]
brianpWins has joined #ruby-lang
apeiros_ has joined #ruby-lang
ryanf has joined #ruby-lang
guns has quit [Quit: guns]
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
apeiros_ has quit [Ping timeout: 244 seconds]
<whitequark>
yorickpeterse: re
<whitequark>
that does make sense, indeed
<whitequark>
especially the bit about nested classes and such
<whitequark>
you likely want to collect them across a lot of loaded files
JohnBat26 has joined #ruby-lang
<whitequark>
I'd recommend making this not only a lightweight wrapper around the AST, but also the collection classes to keep the entire working set in
srbaker has quit [Quit: Computer has gone to sleep.]
<whitequark>
well, not sure about that last part. I tend to look at everything as a language implementor, linter might need a different approach
imajes has quit [Excess Flood]
apeiros_ has joined #ruby-lang
imajes has joined #ruby-lang
nXqd has joined #ruby-lang
imperator2 has quit [Ping timeout: 244 seconds]
Boohbah has joined #ruby-lang
charliesome has joined #ruby-lang
dankest has quit [Quit: Leaving...]
apeiros_ has quit [Remote host closed the connection]
gregmoreno has quit [Remote host closed the connection]
dankest has joined #ruby-lang
nXqd has quit [Ping timeout: 256 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
nXqd has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
xyzodiac has joined #ruby-lang
nXqd has quit [Remote host closed the connection]
xyzodiac has quit [Client Quit]
kitallis has joined #ruby-lang
kitallis has quit [Excess Flood]
kitallis has joined #ruby-lang
kitallis has quit [Excess Flood]
kitallis has joined #ruby-lang
kitallis has quit [Excess Flood]
kitallis has joined #ruby-lang
kitallis has quit [Excess Flood]
qwerxy has joined #ruby-lang
kitallis has joined #ruby-lang
kitallis has quit [Excess Flood]
kitallis has joined #ruby-lang
kitallis has quit [Excess Flood]
headius has quit [Quit: headius]
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
esad has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
Morning
<yorickpeterse>
whitequark: hmm, I do intend to keep it lightweight. Yesterday I can up with a few things that I'd want such as RubyLint::RubyMethod#calls() which would return a list of all methods called by this particular method
<yorickpeterse>
Just to give an example
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
dc5ala has joined #ruby-lang
dankest is now known as dankest|away
gnufied has joined #ruby-lang
zmack has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
anannie has joined #ruby-lang
sush24 has joined #ruby-lang
nXqd has joined #ruby-lang
spinagon has quit [Ping timeout: 272 seconds]
dankest|away is now known as dankest
esad has joined #ruby-lang
judofyr has joined #ruby-lang
rue|w has joined #ruby-lang
intellitech has quit [Quit: intellitech]
robotmay has joined #ruby-lang
<whitequark>
yorickpeterse: I'm not sure
<whitequark>
you will probably want to resolve those method calls, will you?
<whitequark>
this one, and similar more advanced features, would require storing more than just AST-dependent, file-local information
qwerxy has quit [Quit: offski]
dr_bob has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
toretore has joined #ruby-lang
esad has quit [Quit: Computer has gone to sleep.]
dankest is now known as dankest|away
esad has joined #ruby-lang
<yorickpeterse>
Which is why I want these "middleware" between the AST and analysis bits
kain has quit [Quit: exit]
tenderlove has joined #ruby-lang
<yorickpeterse>
The statistics I'd collect for third-party devs/analysis code would be fairly raw data though. I'm not going to retrieve entire call stacks for them
andrewhl has quit [Remote host closed the connection]
<yorickpeterse>
Think method callers/calls, amount of statements, that kind of stuff
<yorickpeterse>
as well as some helpers to check the method arity, maybe validate the parameter (types)
io_syl has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
This all popped in my head yesterday so the idea is still very raw
<yorickpeterse>
which is why I didn't touch Vim last night because I'd otherwise end up with some half-assed implementation
<yorickpeterse>
What I don't want to end up with is N analysis classes basically doing the same stuff over and over again
<injekt>
oddmunds: no it was changed in 3.0 though, it needs work but I need a lot of feedback on it
imajes has quit [Excess Flood]
<judofyr>
data structures are hard
imajes has joined #ruby-lang
Axsuul has quit [Ping timeout: 255 seconds]
Averna has quit [Quit: Leaving.]
judofyr has quit [Ping timeout: 264 seconds]
<yorickpeterse>
giggity
solars has joined #ruby-lang
marr has joined #ruby-lang
dankest|away is now known as dankest
<injekt>
ruby hurts my face sometimes
lagzilla has quit [Ping timeout: 250 seconds]
<tockitj_>
is there a tool that will generate ruby method usage cross-reference for vim (something like ctags, only for method usage)
agarcia has joined #ruby-lang
lagzilla has joined #ruby-lang
blacktulip has joined #ruby-lang
stoneyq2 has joined #ruby-lang
<tockitj_>
hmmmz.. it would be nice to make ruby capable of running code (and generating cross-reference information along the way)
<tockitj_>
like this method is called here, this method is defined here, etc..
<yorickpeterse>
heh, wait a month or two and that might be possible
<yorickpeterse>
s/might/will be
<tockitj_>
there is new feature in plan ? (:
<yorickpeterse>
Not in Ruby itself but I'm working on a linter/code analysis tool. One of the plans I have with it is to provide info about method callers/calls, etc
<yorickpeterse>
That way you could build a dependency graph, do complexity analysis, etc
<tockitj_>
this x-reference database could be used by editors (like vim) to navigate code
<yorickpeterse>
But that won't be available until at least the end of january
<tockitj_>
niceee
<tockitj_>
how will you parse ruby code ? (:
dankest is now known as dankest|away
<yorickpeterse>
Currently I'm using Ripper but in the future I might use a different parser
<tockitj_>
it would be cool if ruby would parse ruby
<yorickpeterse>
plenty of parsers can already do that
<yorickpeterse>
Ripper and ruby_parser just to name two of them
apeiros_ has joined #ruby-lang
<tockitj_>
hmmz.. maybe ruby itself could do it (for example it could account for this information while running tests)
<Mon_Ouie>
Ripper being a wrapper on the parser that's actually used by Ruby itself
<tockitj_>
nice
<yorickpeterse>
The Ruby runtime itself does provide information about the source code but in a lot of cases it's quite limited
ryanf has quit [Quit: leaving]
adambeynon has joined #ruby-lang
<oddmunds>
injekt: i want to make a command line program that takes commands (like git), and the command thing seemed like the perfect fit
<injekt>
oddmunds: yeah it works (check out the docs in command.rb) but it needs some modification to makes things easier. If you do use it i'd welcome any feedback or improvements you can think of
sush24 has quit [Read error: Connection reset by peer]
faustman has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
sush24 has joined #ruby-lang
esad has quit [Quit: Computer has gone to sleep.]
agarie has quit [Remote host closed the connection]
agarie has joined #ruby-lang
anannie has quit [Remote host closed the connection]
agarie has quit [Ping timeout: 272 seconds]
Guest90418 has joined #ruby-lang
stiang has joined #ruby-lang
tbuehlmann has joined #ruby-lang
swav has quit [Remote host closed the connection]
Nisstyre-laptop has quit [Ping timeout: 255 seconds]
faustman has quit [Ping timeout: 246 seconds]
thone has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
thone_ has quit [Ping timeout: 255 seconds]
s3mi0 has quit [Remote host closed the connection]
faustman has joined #ruby-lang
madish has joined #ruby-lang
esad has joined #ruby-lang
<oddmunds>
injekt: thanks. do i use Slop::Commands.new instead of Slop.new? Or do i combine them?
<oddmunds>
from the looks of it, i could just use Commands
<oddmunds>
for all my sloppy needs
elico has joined #ruby-lang
zmack_ has joined #ruby-lang
GarethAdams has joined #ruby-lang
zmack has quit [Read error: Operation timed out]
imajes has quit [Excess Flood]
faustman has quit [Ping timeout: 250 seconds]
Croms has quit [Quit: Croms]
Assurbanipal has joined #ruby-lang
imajes has joined #ruby-lang
<injekt>
oddmunds: yup, Commands handles creating instances of slop
swav has joined #ruby-lang
cultureulterior_ has joined #ruby-lang
rcvalle has quit [Quit: Leaving]
stiang has quit [Quit: stiang]
faustman has joined #ruby-lang
kain has joined #ruby-lang
swav has quit [Remote host closed the connection]
toretore has quit [Quit: Leaving]
<GarethAdams>
d'oh. URI.encode_www_form isn't quite as intuitive as I need it to be
<GarethAdams>
> URI.encode_www_form(foo: 23, bar: [], baz: 'abc')
<GarethAdams>
=> "foo=23&&baz=abc"
<GarethAdams>
bar disappears completely
benanne has joined #ruby-lang
agarie has joined #ruby-lang
francisfish has joined #ruby-lang
faustman has quit [Read error: Operation timed out]
<injekt>
GarethAdams: turn any empty arrays into strings
<injekt>
GarethAdams: you should just send all the values as strings anyway, an array isn't useful
agarie has quit [Ping timeout: 252 seconds]
<GarethAdams>
injekt: right, but:
<GarethAdams>
> URI.encode_www_form(foo: 23, bar: ['first', 'second'], baz: 'abc')
<injekt>
or #{receiver}.#{method_type}(#{method_name})
benanne has quit [Quit: kbai]
<banisterfiend>
Injekt it's paranoid in case method or instance_method is overriden by a class
robotmay has quit [Remote host closed the connection]
anannie has joined #ruby-lang
<injekt>
banisterfiend: right but wouldn't that call reciever.instance_method(:instance_method).bind(obj).call(:foo) ?
postmodern has quit [Quit: Leaving]
zz_chrismcg is now known as chrismcg
<injekt>
banisterfiend: which would raise an exception on the target which would always fail?
chessguy has joined #ruby-lang
sush24 has quit [Ping timeout: 255 seconds]
faustman has quit [Ping timeout: 260 seconds]
<banisterfiend>
Injekt one sec I'll try to switch to computer, too hard to discuss on my phone ;)
<injekt>
banisterfiend: sure thanks :P
schaerli has joined #ruby-lang
sush24 has joined #ruby-lang
banisterfiend is now known as hgh
banisterfiend has joined #ruby-lang
rsl has joined #ruby-lang
chessguy has quit [Ping timeout: 264 seconds]
gjaldon has joined #ruby-lang
<injekt>
ah ok I've worked it out
<injekt>
banisterfiend: instance_method is a method on module but that wont work on Kernel so that line will ALWAYS fail if the reciever is Kernel
faustman has joined #ruby-lang
<injekt>
banisterfiend: maybe if it's Kernel we could use method() and re-bind it to the target?
<banisterfiend>
injekt: so it's equivalent to this: Module.instance_method(:instance_method).bind(Pry).call(:repl) #=> gives us a method object to Pry#repl
<injekt>
right
<banisterfiend>
injekt: what is it crashing for u?
<injekt>
which works on Module
<banisterfiend>
wait*
<injekt>
but not Kernel
<injekt>
that code will never work on Kernel, banisterfiend
<banisterfiend>
injekt: yeah, but i think in the case of Kernel we always pass in a method_type of :method don't we?
<banisterfiend>
are you getting actual crashes as a result of Kernel + instance_method ?
<banisterfiend>
or is it just hypothetical? cos even though lookup_method_from_binding() could be given broken arguments (i.e Kernel + method) i think we ensure we don't do that in any of the callsites
<banisterfiend>
but if you're getting crashes as a result of this, i must be wrong
<injekt>
banisterfiend: it doesn't crash, but that line fails when I try and do a show-source for String() or any Kernel method, I think I can fix it though, let me write a patch and show you
<banisterfiend>
injekt: shows-source String works for me
<injekt>
banisterfiend: that shows the class String source?
<banisterfiend>
injekt: no, it shows the source for the String method
<banisterfiend>
in my case
<banisterfiend>
but i'm on HEAD
<injekt>
ah ok yeah it does on HEAD, but String() should work
<injekt>
banisterfiend: how is it searching for the 'String' method on Kernel?
thisirs has joined #ruby-lang
<injekt>
I'm looking down the method chain but can't pinpoint it
<banisterfiend>
String() is not a syntax we currently accept
<injekt>
that makes sense
<injekt>
that said
<banisterfiend>
injekt: we differentiate between methods/classes using this syntax
<banisterfiend>
$ ::String <--- top-level String class
<banisterfiend>
but with no disambiguating syntax, it looks up top-level String method by default
<injekt>
banisterfiend: that makes sense, that's what I wanted returned anyway I was just using String() that's all fine, though.. my issue now is that if I want to look up Kernel methods I need to specific Kernel eh?
<injekt>
nope I'm getting undefined methods on that, too
<banisterfiend>
injekt: what kernel method are you trying to look up?
leopard_me has joined #ruby-lang
<banisterfiend>
btw the show-source code is undergoing a big refactor on HEAD currently, the code in the gem is damn nasty
sepp2k has joined #ruby-lang
gjaldon has quit [Ping timeout: 245 seconds]
<injekt>
banisterfiend: haha my bad the methods I was choosing were all -p/-n specific methods :( my fault
<banisterfiend>
what's -p/-n method?
<injekt>
banisterfiend: ruby -p/-n adds the Kernel methods 'gsub/chop/etc' which work on $_
<Nitrodist>
judofyr: I can't access private foo=(x) from within the class in 1.9
<judofyr>
Nitrodist: that is true. (because you can only access foo= with self)
<whitequark>
Nitrodist: you shouldn't often need that
<yorickpeterse>
Personally I see them as a way of saying "Use this and your shit will most likely break without notice"
<andrewvos>
Ahh what the hell I missed crappy jokes again
<whitequark>
use instance variables instead
sush24 has joined #ruby-lang
<judofyr>
yorickpeterse: personally I prefer to write that in the documentation
<whitequark>
judofyr: I'm considering doing the send/private_send trick in my dialect.
<andrewvos>
judofyr: Personally, I just like writing gems that do that.
gnufied has quit [Quit: Leaving.]
<injekt>
meh, methods aren't 'private' nor 'protected' in any true sense of the word anyway
<judofyr>
whitequark: you'll break a bunch of code though :)
agile has joined #ruby-lang
<Nitrodist>
judofyr: that's shitty :P do you have a link where it says that you can only access methods with equals in the method name through with a receiver?
cjs226 has joined #ruby-lang
<injekt>
Nitrodist: foo = "bar" is a variable assignment
<whitequark>
judofyr: I don't have/mostly do not want compatibility with existing code
<injekt>
Nitrodist: are you using self.foo = ?
<whitequark>
judofyr: I want compatibility with existing programmers through
thisirs has quit [Remote host closed the connection]
outoftime has joined #ruby-lang
<whitequark>
judofyr: *some* ruby tricks are perfectly acceptable in embedded environment. but only that much. if, for example, you change codepaths depending on self.class.name =~ /18/, you're fucking doing it wrong
<Nitrodist>
injekt: I am and upgrading to 1.9 raises nomethoderror even though I'm using it within the defining class :P
<whitequark>
I do not want compatibility with such code. It won't work anyway, but if there'd be an impression that it does, you'll shoot yourself in the leg.
<whitequark>
this is exactly why I chose to add static typing. I _could_ add some clever tricks and infer types from other places, but it'd be much more error-prone.
Assurbanipal has quit [Quit: Konversation terminated!]
faustman has joined #ruby-lang
kith_ has joined #ruby-lang
<andrewvos>
whitequark: What is this thing you're working on?
<judofyr>
in other news: I started working on a C-implementation of the data-structure I talked about yesterday (Leonardo Fractals) and I think it could be practical
kith has quit [Disconnected by services]
kith_ is now known as kith
headius has joined #ruby-lang
<judofyr>
insert performance is great, but now it's log(n)^2 search-time. if I change it to log(n) search-time I need to do more stuff at insert, so yeah
gaveen has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
<darix>
judofyr: didnt the article link an implementation of it?
<darix>
judofyr: and i saw some ruby port of it on github^^
<judofyr>
darix: that was an implementation of smoothsort + Leonardo Heap
<darix>
ah
<judofyr>
darix: I've implemented a regular tree
<darix>
then i missed the other link
<judofyr>
with insert, search, range queries, removals
<judofyr>
darix: Leonardo Fractals are structured similary to Heaps. but instead of maintaining the heap-property I maintain the sorted-tree-property
<judofyr>
so when merging, I just merge the two (already sorted) trees and add the node
sush24 has quit [Quit: This computer has gone to sleep]
rue|w has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
<judofyr>
8 elements are stored in 2 trees: [1, 4, 6, 8, 10], [4, 7, 9]. when you then add another node, I merge it into a Leonardo tree of order (n+1)
<andrewvos>
whitequark: hahahahahaha "If you know just one thing about Ruby, chances that it has to do something with performance."
<andrewvos>
whitequark: So true man, so true. Ask any .NET developer why they don't like Ruby.
<judofyr>
darix: some inserts are constant (if the two last trees are not consecutive Leonardo numbers) because it just appends to the right. and when merging happens, it has good cache locality
<judofyr>
darix: I don't have a proof, but I hope that inserts are O(lg n) regardless of the cache locality
faustman has quit [Ping timeout: 252 seconds]
<judofyr>
darix: however, by having several trees, searching needs to do a binary search into multiple trees. that is obviously not O(lg n)
faustman has joined #ruby-lang
<judofyr>
darix: but you can add pointers to a location in the next tree (this is called Fractal Cascading) so when the binary search in one tree is done, it has limited the next tree to search
LordEntro has quit [Quit: Leaving.]
<judofyr>
darix: but then I'll have to maintain these pointers when I merge
<judofyr>
also, I haven't tackled removals yet
pxjorge has joined #ruby-lang
<judofyr>
oh, and right now it's fixed size. it needs to be able to grow/shrink
<andrewvos>
That's what she said.
intellitech has joined #ruby-lang
<andrewvos>
Sorry
<judofyr>
:)
wyhaines has joined #ruby-lang
<judofyr>
yorickpeterse: so yeah. what I wrote above is what I call a Leonard Fractal
faustman has quit [Ping timeout: 252 seconds]
<judofyr>
basically just a list of lists that are always kept sorted and occasionally merged
carloslopes has quit [Remote host closed the connection]
faustman has joined #ruby-lang
pxjorge has quit [Quit: Leaving]
pxjorge has joined #ruby-lang
<andrewvos>
Sounds exciting :)
kitallis has joined #ruby-lang
kitallis has quit [Excess Flood]
<andrewvos>
judofyr: Is there a wikipedia page? I can't find one.
<andrewvos>
(I was being sarcastic above, but now I kind of want to know more)
<judofyr>
andrewvos: don't know if there's a wikipedia page. I just derived it from smoothsort's Leonardo Heap
<judofyr>
I've probably just rediscovered something, but I don't know what it's called :(
MaddinXx has joined #ruby-lang
marr has quit [Ping timeout: 252 seconds]
<andrewvos>
judofyr: Where is code?
jbwiv has joined #ruby-lang
<judofyr>
it's similar to the cache-oblivious lookahead array (http://alum.cs.sunysb.edu/~bender/newpub/BenderFaFi07.pdf), but that is only optimized for disk usage, and seems to have O(log(n)^2) inserts if you use it in-memory only
<judofyr>
err
<judofyr>
O(n*log(n))
<judofyr>
andrewvos: only locally so far
<judofyr>
no, log(n)^2 was right :P
davidbalber|away is now known as davidbalbert
<andrewvos>
judofyr: I just googled "log".
<judofyr>
andrewvos: I googled "log log" yesterday
rippa has joined #ruby-lang
<judofyr>
andrewvos: I'll try to publish something. I need to start using git anyway as I need to experiment a bit
<danneu>
I could pass that $array structure in to every instance, but is there a better solution?
Nisstyre-laptop has quit [Read error: Connection reset by peer]
sush24_ has joined #ruby-lang
sharma__ has quit [Ping timeout: 272 seconds]
<injekt>
danneu: I dont really understand why youd need the method, it doesn't do anything interesting. Just do TwitterFetcher.new(user).tweets + (stuff in array)
ulisescab has quit [Read error: No route to host]
sent-hil has quit [Remote host closed the connection]
imperator2 has joined #ruby-lang
gaveen has quit [Remote host closed the connection]
<danneu>
injekt: Yeah, my fault for making the example so contrived. I used $array only to try to explain that I want to share a data structure. I can't really post my code. But basically the data structure in my code is a lookup table (hashmap) that the TwitterFetcher object uses internally in a few places
gregmoreno has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 264 seconds]
<injekt>
danneu: in that case, you should pass it to the instance of your fetcher :P
<injekt>
(as you mentioned)
<kith>
i did that: sum = 0; 1.upto(999) { |i| sum + i if i % 3 == 0 || i % 5 == 0 }; p sum
<kith>
it says sum is 0
<kith>
why is that?
<danneu>
kith: you're just doing sum + i
<injekt>
+=
<danneu>
you're not assigning anything to sum
<kith>
goddamn
<kith>
i such a loser
schroedinbug1 has quit [Ping timeout: 276 seconds]
<danneu>
nah bro
<kith>
danneu: thx
<danneu>
scroll up and check out my question
tenderlove has quit [Remote host closed the connection]
<danneu>
injekt: Cool, I'll just do that. For some reason, it felt like the naive way to do it. especially with all the copies of a large data structure
<danneu>
Well, I guess that's the "for some reason"
zmack has joined #ruby-lang
sulo has joined #ruby-lang
schroedinbug1 has joined #ruby-lang
sush24_ has quit [Quit: This computer has gone to sleep]
Banistergalaxy has joined #ruby-lang
danneu has quit [Quit: WeeChat 0.3.8]
<matti>
zzak: :)
jbwiv has quit [Remote host closed the connection]
jbwiv has joined #ruby-lang
dabradley has quit [Ping timeout: 248 seconds]
imperator2 has quit [Ping timeout: 265 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
cirenyc has joined #ruby-lang
cirenyc has quit [Excess Flood]
ddfreyne has quit [Excess Flood]
ddfreyne has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 272 seconds]
hahuang65 has joined #ruby-lang
drbrain has joined #ruby-lang
tenderlove has joined #ruby-lang
db1382 has quit [Quit: Leaving]
hahuang65 has quit [Client Quit]
hahuang65 has joined #ruby-lang
db1382 has joined #ruby-lang
dabradley has joined #ruby-lang
sailias has quit [Quit: Leaving.]
slyphon__ has quit [Ping timeout: 245 seconds]
schaerli has quit [Remote host closed the connection]
mjbamford has quit [Quit: Leaving...]
lcdhoffman has quit [Quit: lcdhoffman]
slyphon__ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 265 seconds]
methods has joined #ruby-lang
methods has quit [Client Quit]
havenn has quit [Remote host closed the connection]