fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
<RubyPanther>
A124: Not a very well-formed question
<A124>
RubyPanther: RubyPanther: How could I rewrite C code in ruby extension binding to pass data as strings instead as file descriptors?
<RubyPanther>
depends on the code
sent-hil has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
<RubyPanther>
One of the great things about Ruby is that C extensions are just plain C, there is no special glue language needed, just a ruby.h
<sent-hil>
if I've Monday, Oct 8 8:00p"
<RubyPanther>
The chapter on C extensions is the chapter of the "Pickaxe" book they give away free as a sample, too, so you can get the current version
<sent-hil>
if I do Time.parse("Monday, Oct 8 8:00p"), I get 0000 time zone, how do I make it parse in -0700 time zone
<sent-hil>
I tried adding -0700 to string, but that didn't work
<RubyPanther>
That walks you through everything you need to do basics of creating strings and passing to/from an extension
lggr has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
irleif has joined #ruby
kstephens has quit [Read error: Connection reset by peer]
irleif has quit [Client Quit]
ohdae has joined #ruby
samphippen has joined #ruby
sent-hil has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
samphippen has quit [Client Quit]
karneisada has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
sent-hil has joined #ruby
<A124>
RubyPanther: Thanks.
yoklov has joined #ruby
kstephens has joined #ruby
AndChat| has joined #ruby
AndChat- has joined #ruby
lggr has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
no_worries has quit [Remote host closed the connection]
awarner has joined #ruby
ledao has quit [Quit: Leaving.]
Banistergalaxy has quit [Ping timeout: 256 seconds]
ledao has joined #ruby
AndChat| has quit [Ping timeout: 256 seconds]
mwilson` has quit [Excess Flood]
mwilson` has joined #ruby
jimeh2 has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 246 seconds]
c0rn_ has joined #ruby
lggr has joined #ruby
murz has quit [Quit: Leaving...]
mengu has quit [Remote host closed the connection]
kitofr has quit [Read error: Connection reset by peer]
<A124>
Same as wednativ's in_groups_of, just using ruby method
<werdnativ>
_bart: yeah… that's what I mean. I think it's odd that Range's concept of last (an Enumerable method) is different from when you run .each on the range.
awarner has joined #ruby
Bosma has quit [Quit: leaving]
lggr has quit [Ping timeout: 264 seconds]
<werdnativ>
it's just one of those heads-up things I guess. :)
g-ram has quit [Quit: Computer has gone to sleep.]
<blazes816>
lol
Ruler_Of_Heaven_ has joined #ruby
<blazes816>
you should use !my_var.is_a? Class instead
cburyta has quit [Remote host closed the connection]
<blazes816>
because unless you're soley wanting to know if it's an A
<blazes816>
- because
aharris_ has joined #ruby
<A124>
Ok. so it's not. Damn. Sorry, I'm a little out of my head.
notVert has quit [Remote host closed the connection]
<A124>
Damn. Somehow I manages to mangle the output, so I did not managed to figure out right return values. Yes blazes816, you're right. Also, sent-hil's idea will get useful too.
<bperry>
I prefer .responds_to(:method_name)
<A124>
Now I have a boolean question: If I define private method open, and use open in initialize, would get the public or private method called?
<bperry>
usually I don't care about the type, only that I can call a specific method
<A124>
I use responds_to for another purpose as well.
<bperry>
it could go either way
<bperry>
your preference
<A124>
I'm making a modular class and I'm not yet familiar with theese.
lggr has quit [Ping timeout: 260 seconds]
<bperry>
just giving you another option
Ruler_Of_Heaven_ has quit [Ping timeout: 246 seconds]
<A124>
Yes, thanks. But it's not adequate as an asnwer.
ryanf has joined #ruby
<A124>
To answer self: the private method get's called even in initialize.
lggr has joined #ruby
pipopopo has joined #ruby
<AndChat->
A124 of course, if private method can't be called there, then it can't be called anywhere:)
<A124>
AndChat-: I meant if the private overloads the public even in initialize :)
<AndChat->
A124 I dont know what you mean by that:)
g-ram has joined #ruby
<williamherry>
sent-hil: it still prompt me to install ruby-debug
lagzilla has joined #ruby
daniel_hinojosa has joined #ruby
<A124>
AndChat-: I'm coming from procedural programming, so I have some things newcomers would not ask. Just discard that question.
Meon has quit [Read error: Connection reset by peer]
dfmoser has quit [Quit: dfmoser]
whackatre has joined #ruby
whackatre has quit [Changing host]
whackatre has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
lggr has joined #ruby
tsd_usa has joined #ruby
radic has joined #ruby
krz has joined #ruby
irleif has joined #ruby
SegFaultAX|work has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 248 seconds]
radic_ has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
aharris_ has quit [Quit: aharris_]
c0rn_ has quit []
hadees has quit [Quit: hadees]
kain has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 246 seconds]
Synthead has quit [Quit: p33 ba115]
Banistergalaxy has joined #ruby
c0rn_ has joined #ruby
AndChat- has quit [Ping timeout: 255 seconds]
lggr has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
hadees has joined #ruby
duracrisis has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
wpaulson has joined #ruby
lggr has joined #ruby
freeayu has joined #ruby
vitoravelino`afk is now known as vitoravelino
sent-hil has quit [Remote host closed the connection]
FifthWall has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
zastern has joined #ruby
<zastern>
Any idea why in this code/function - https://gist.github.com/3850497 - the first invocation of my function works fine, but the second returns a blank for the number of meters on the third line of the function?
colinbm has quit [Quit: colinbm]
awojo has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
a_a_g has joined #ruby
justinmcp has quit [Remote host closed the connection]
vitoravelino is now known as vitoravelino`afk
tsd_usa has quit [Remote host closed the connection]
g-ram has quit [Quit: Computer has gone to sleep.]
<zastern>
ah because its a string not an integer or float. i get it
kain has joined #ruby
grizlo42 has joined #ruby
CodeFriar has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 260 seconds]
jellosea has quit [Quit: jellosea]
xorgnak has joined #ruby
lggr has joined #ruby
a_a_g has quit [Quit: Leaving.]
awarner has quit [Remote host closed the connection]
<Cool_Fire>
burgestrand: That fixed it yeah. Thanks a lot
burgestrand has quit [Quit: Leaving.]
<drowningchild>
noob here, was suggested ruby to learn, anyone have any suggestions for books/media for someone who knows -nothing- about any language?
<rking>
(That is, I want to see more of the file, so run that from the shell so it will upload bot.rb to a public place. When it's done copy the URL and paste it here.)
<shammancer>
Oh ok
<rking>
(Also note that the jist command accepts the "-c" flag so you can skip the copy step)
lggr has joined #ruby
Takehiro has quit [Remote host closed the connection]
Playb3yond has quit [Quit: Colloquy for iPhone]
irleif has quit [Quit: Computer has gone to sleep.]
Forevernade has joined #ruby
<shammancer>
Never mind forgot to make it global
duracrisis has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 248 seconds]
<shammancer>
Is it appropriate to have global variables in ruby?
<burgestrand>
Yes no
<rking>
But mostly no.
<shammancer>
When then?
<burgestrand>
When appropriate but never otherwise.
<burgestrand>
Frowned upon, no less.
<rking>
Not til your 2nd month of programming.
answer_42 has joined #ruby
<_Mon_Ouie_>
I'd actually say you shouldn't even define new ones, because even when you need global state, you can use a class instance variable equivalently, minus the name collisions
lggr has joined #ruby
<rking>
There are many mechanisms to get code over ʜᴇʀᴇ to be able to see the data from over ᴛʜᴇʀᴇ. Start by simple args passing, then look at instance variables, then learn about closures, etc.
irleif has joined #ruby
tagrudev has joined #ruby
kain has joined #ruby
rippa has joined #ruby
<shammancer>
Admin in this case...
daniel_hinojosa has quit [Ping timeout: 256 seconds]
<shammancer>
I guess I could put it in a class and pass the class around...
<rking>
Oops, there should be a "::Bot" before KnownOptions
<rking>
Anyway it's getting messy so I'm not sure if it's worth a hoot.
<shammancer>
Ok
<rking>
(After that you'd access it like config.admin, I think. But yeah, a pain and no clear win.)
lggr has joined #ruby
<shammancer>
Bah oh well
mikepack has joined #ruby
<shammancer>
Ok is there a way to load seperate files into a ruby program while it is running... I know there is require but lets say I want to reload a module after an admin says reload or something how would I go about the reloading?
samuel02 has joined #ruby
<rking>
shammancer: Use `load` not `require`.
<shammancer>
At the top?
<rking>
Wherever you want.
<rking>
Like the handler for when the admin says "reload"
<shammancer>
yah
<shammancer>
Ok
mildfate has joined #ruby
mildfate has left #ruby [#ruby]
cj3kim has quit [Quit: This computer has gone to sleep]
awestroke has quit [Remote host closed the connection]
<shammancer>
What extension (.rb?) and what directory (Can it be in the same one as bot.rb or does it need to be in the ruby one like require?)
lggr has quit [Ping timeout: 260 seconds]
lolmaus has joined #ruby
lggr has joined #ruby
senny has joined #ruby
_marvin_ is now known as _marvin
_Mon_Ouie_ has quit [Ping timeout: 246 seconds]
arturaz has joined #ruby
mikepack has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 255 seconds]
<shammancer>
Would that be safe?
lggr has joined #ruby
_mak has joined #ruby
<shammancer>
What directory does it need to be in?
kain has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
AlbireoX has joined #ruby
<burgestrand>
shammancer: load takes the path to a file to load, and it will be loaded regardless if it has been loaded already or not
<burgestrand>
shammancer: require does the same, but will append the file extension if not present (e.g. ".rb"), and will not load files that have been required previously
<shammancer>
Ok. But what directory does it need to be in?
<burgestrand>
shammancer: if they receive a relative path to a file, both will search for the file in the directories listed in the $LOAD_PATH array
<burgestrand>
shammancer: if they receive an absolute path, they will look only in that path
<burgestrand>
shammancer: apart from that, place the files wherever you want
<shammancer>
Ok how do you specify an absolute path?
irleif has quit [Quit: Computer has gone to sleep.]
maesbn has joined #ruby
c0rn_ has quit []
iori has joined #ruby
saschagehlich has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
sagax has joined #ruby
iori has quit [Read error: No route to host]
c0rn_ has joined #ruby
lggr has joined #ruby
c0rn_ has quit [Client Quit]
iori has joined #ruby
jellosea has joined #ruby
<shammancer>
Does include work the same way?
khakimov has joined #ruby
fantazo has quit [Remote host closed the connection]
reset has joined #ruby
monkegjinni has joined #ruby
kain has quit [Ping timeout: 264 seconds]
futilegames has joined #ruby
joeycarmello has joined #ruby
yshh has quit [Read error: Connection reset by peer]
aganov has joined #ruby
yshh has joined #ruby
timonv has joined #ruby
jellosea__ has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
jellosea has quit [Read error: Connection reset by peer]
jellosea__ is now known as jellosea
joeycarmello has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
Takehiro has joined #ruby
arturaz has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
<burgestrand>
shammancer: no, include is an entirely different thing.
<shammancer>
Ok thanks
<burgestrand>
shammancer: include is related to inheritance (but not the same thing), and more specifically something called mixins. It is a way to extend the functionality of objects without inheritance.
<burgestrand>
I say without inheritance but that is not *entirely* true.
Morkel has joined #ruby
dr_bob has joined #ruby
<shammancer>
I was just wondering if the directory things worked the same way
a_a_g1 has joined #ruby
Takehiro has quit [Remote host closed the connection]
CodeFriar has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 252 seconds]
daniel_hinojosa has quit [Quit: Leaving.]
a_a_g has quit [Read error: Connection reset by peer]
reset has quit [Ping timeout: 248 seconds]
gry has joined #ruby
AlbireoX has quit [Remote host closed the connection]
lggr has joined #ruby
AlbireoX has joined #ruby
icooba has joined #ruby
theplanet has joined #ruby
eikko has quit [Read error: Connection reset by peer]
<theplanet>
if 1.9.3 latest?
<theplanet>
-p194
eikko has joined #ruby
<theplanet>
i don't know what p194 is but i'll assume 1.9.3 is the latest
<bnagy>
close enough
<bnagy>
p == patchlevel
<theplanet>
are they buggy?
<theplanet>
does 194 imply 194 bad bugs were patched?
AlbireoX has quit [Ping timeout: 255 seconds]
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
<bnagy>
theplanet: no actually it was just one bug
<bnagy>
we are so stupid it took us 194 tries to fix it
<rking>
I guess it's like C's preprocessor and sticks the pieces of adjacent strings together.
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
<rking>
Not sure what the use of the feature is, though. (in cpp it's necessary for some macros)
<rking>
Oh, hehe, there's a comment: "# you don't have to do like this. just write in single string."
gregorg_taf has quit [Quit: Quitte]
jgrevich has quit [Quit: jgrevich]
<rking>
Seems more like a FIXME comment for the docs, but hey.
arturaz has joined #ruby
kain has joined #ruby
lggr has joined #ruby
`Mew has joined #ruby
reset has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
alectaylor1 has joined #ruby
AlecTaylor has quit [Ping timeout: 240 seconds]
saschagehlich has quit [Quit: saschagehlich]
leehambley has joined #ruby
skogis has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
alectaylor1 has quit [Client Quit]
<RubyPanther>
rking: it is a rarely used Ruby feature so you can break strings up into multiple lines but still have it parse as one string without needing to concatenate
rakunHo has joined #ruby
xpen has joined #ruby
nilg has joined #ruby
lggr has joined #ruby
<rking>
RubyPanther: What's the advantage?
<rking>
RubyPanther: Oh, right, so it doesn't go over 80 col and doesn't require a runtime concatenation.
kain has quit [Ping timeout: 244 seconds]
red_ has joined #ruby
glyytchy has quit [Quit: Leaving...]
hemanth has quit [Ping timeout: 245 seconds]
CodeFriar has joined #ruby
hemanth has joined #ruby
SegFaultAX|work has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Nanuq has quit [Quit: leaving]
red_ has quit []
CodeFriar has quit [Ping timeout: 256 seconds]
zommi has joined #ruby
lggr has joined #ruby
fixl has joined #ruby
justsee has quit [Quit: Leaving...]
justsee has joined #ruby
zigomir has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
TheFuzzball has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 245 seconds]
tk___ has joined #ruby
JonnieCache has joined #ruby
TheFuzzball has joined #ruby
lggr has joined #ruby
d3vic3 has joined #ruby
SqREL has joined #ruby
sqrel_ has joined #ruby
sqrel_ has quit [Client Quit]
SqREL has quit [Client Quit]
Sou|cutter has quit [Remote host closed the connection]
soulisson has joined #ruby
Hamed-R has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
wallerdev has quit [Quit: wallerdev]
kain has joined #ruby
lggr has joined #ruby
Takehiro has joined #ruby
wallerdev has joined #ruby
soulisson has quit [Ping timeout: 240 seconds]
haxrbyte has joined #ruby
jprovazn has joined #ruby
lolmaus has quit []
elsifaka has joined #ruby
Takehiro has quit [Remote host closed the connection]
und3f has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
piotr_ has joined #ruby
bluOxigen has joined #ruby
lggr has joined #ruby
timonv has quit [Remote host closed the connection]
kain has quit [Ping timeout: 240 seconds]
khakimov has quit [Ping timeout: 256 seconds]
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
cibs has quit [Remote host closed the connection]
leehambley has quit [Quit: leehambley]
eldariof has joined #ruby
flype has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Jork1 has joined #ruby
roadt has joined #ruby
<roadt>
hi, my ruby is 1.9.3 from package manager, but include dir is /usr/include/ruby-1.9.1, is it right?
Eplemosen has joined #ruby
demian`_ has joined #ruby
demian`_ has quit [Client Quit]
<roadt>
gems are put into ~/.gem/ruby/1.9.1 ,too
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
Elhu has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
emergion has joined #ruby
ananthakumaran has joined #ruby
lggr has joined #ruby
charliesome has joined #ruby
saschagehlich has joined #ruby
mahmoudimus has joined #ruby
saschagehlich_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
margle has joined #ruby
jamjam has joined #ruby
reuf has joined #ruby
saschagehlich has quit [Ping timeout: 255 seconds]
saschagehlich_ is now known as saschagehlich
cezar has joined #ruby
haxrbyte_ has joined #ruby
AndChat| has joined #ruby
cezar has quit [Client Quit]
lggr has joined #ruby
hemanth has quit [Ping timeout: 256 seconds]
Banistergalaxy has quit [Ping timeout: 260 seconds]
eikko has quit [Ping timeout: 256 seconds]
prtksxna has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
JonnieCache has quit [Read error: Operation timed out]
Iszak has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
bluenemo has quit [Remote host closed the connection]
timonv has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Nanuq has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
LouisGB has joined #ruby
jimeh2 has joined #ruby
CodeFriar has joined #ruby
kain has joined #ruby
lggr has joined #ruby
ryanf has quit [Quit: leaving]
quazimodo has joined #ruby
mwilson` has quit [Excess Flood]
mwilson` has joined #ruby
xpen has quit [Remote host closed the connection]
tvw has joined #ruby
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
Takehiro has joined #ruby
CodeFriar has quit [Ping timeout: 272 seconds]
cibs has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
bluenemo has joined #ruby
lggr has joined #ruby
bradleyprice has quit [Remote host closed the connection]
kain has quit [Ping timeout: 248 seconds]
Banistergalaxy has joined #ruby
elaptics`away is now known as elaptics
lggr has quit [Ping timeout: 248 seconds]
bluenemo has quit [Remote host closed the connection]
mfridh has joined #ruby
AndChat| has quit [Ping timeout: 260 seconds]
jamjam has quit [Ping timeout: 246 seconds]
c0rn_ has joined #ruby
lggr has joined #ruby
replore_ has joined #ruby
Nisstyre-laptop has quit [Read error: Connection reset by peer]
hemanth has quit [Read error: Connection reset by peer]
lggr has joined #ruby
frogprince has joined #ruby
sunkencityryleh has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
jimeh2 has quit [Ping timeout: 244 seconds]
monkegjinni has joined #ruby
Criztian has joined #ruby
budha has joined #ruby
<budha>
/msg NickServ identify 4517138
budha has left #ruby [#ruby]
lggr has quit [Ping timeout: 240 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
mensvaga has quit [Ping timeout: 240 seconds]
kain has joined #ruby
<kalleth>
sick, budha
<kalleth>
pretty good password too
lggr has joined #ruby
gregorg has joined #ruby
gregorg has joined #ruby
gregorg has quit [Changing host]
dfmoser has joined #ruby
rakunHo_ has joined #ruby
hemanth has joined #ruby
baphled has joined #ruby
vlad_starkov has joined #ruby
rakunHo has quit [Ping timeout: 246 seconds]
fantazo has joined #ruby
bluenemo has joined #ruby
wallerdev has quit [Quit: wallerdev]
lggr has quit [Ping timeout: 264 seconds]
kain has quit [Quit: exit]
bluenemo has quit [Remote host closed the connection]
slainer68 has joined #ruby
Hamed-R has quit [Quit: Leaving]
lggr has joined #ruby
slainer68 has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
icambridge has left #ruby ["Leaving"]
jimeh2 has joined #ruby
F1skr has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
workmad3 has joined #ruby
sunkencityryleh has quit [Quit: sunkencityryleh]
Shrink has joined #ruby
Shrink has joined #ruby
Shrink has quit [Changing host]
zz_chrismcg is now known as chrismcg
lggr has quit [Ping timeout: 256 seconds]
karakedi has joined #ruby
bluenemo has quit [Remote host closed the connection]
lggr has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
samphippen has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
bluenemo has quit [Remote host closed the connection]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
rippa has quit [Ping timeout: 260 seconds]
bluenemo has quit [Remote host closed the connection]
beiter has joined #ruby
josh^ has quit [Ping timeout: 246 seconds]
CodeFriar has joined #ruby
thunderstrike has joined #ruby
JonnieCache has joined #ruby
ephemerian has joined #ruby
thunderstrike has quit [Remote host closed the connection]
ksinkar has joined #ruby
josh^ has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
CodeFriar has quit [Ping timeout: 260 seconds]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
rakl has joined #ruby
lggr has joined #ruby
craigp has joined #ruby
dhruvasagar has joined #ruby
reset has quit [Quit: Leaving...]
dfmoser has quit [Quit: dfmoser]
<_bart>
kalleth, haha
monkegjinni has quit [Read error: Connection reset by peer]
theplanet is now known as eilyx
pitty has joined #ruby
monkegjinni has joined #ruby
hemanth has quit [Ping timeout: 256 seconds]
flype has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 264 seconds]
replore_ has quit [Remote host closed the connection]
flype has joined #ruby
lggr has joined #ruby
sepp2k has joined #ruby
prox|a has quit [Ping timeout: 248 seconds]
Meon_ has quit [Read error: Connection reset by peer]
Meon_ has joined #ruby
jcoglan has joined #ruby
morozovm has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
Eplemosen has quit [Quit: NOPE]
pskosinski has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
replore_ has joined #ruby
zeshan has joined #ruby
lggr has joined #ruby
jlebrech has joined #ruby
zeshan has left #ruby [#ruby]
zeshan has joined #ruby
Takehiro has quit [Remote host closed the connection]
bluenemo has quit [Remote host closed the connection]
_2easy has joined #ruby
_2easy has joined #ruby
_2easy has quit [Changing host]
zeshan has left #ruby [#ruby]
replore_ has quit [Remote host closed the connection]
_2easy has quit [Client Quit]
hemanth has joined #ruby
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
<jlebrech>
how do you guys go about "spiking" a ruby app, cucumber -> rspec -> code -> repeat?
dfmoser has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
<JonnieCache>
dont use cucumber unless you have a need to
karakedi has quit [Ping timeout: 260 seconds]
<JonnieCache>
ie. you have nontech people who need to see the specs
eikko has joined #ruby
<JonnieCache>
you might use rspec if you want. its a spike, the whole point is you do whatever you want and it doesnt matter because youre throwing the code away after youre finished
bluenemo has quit [Remote host closed the connection]
bluenemo has joined #ruby
<JonnieCache>
if youre keeping your spike project and making it into version 0.1 of your actual project, youre doing it wrong
timmow has joined #ruby
<jlebrech>
so against cucumber?
slainer68 has quit [Read error: Connection reset by peer]
<JonnieCache>
personally i think cucumber is far too much like hard work, but if you get real benefits from it then you should use it
slainer6_ has joined #ruby
freeayu__ has joined #ruby
_2easy has quit [Quit: leaving]
<jlebrech>
i'd write test based initial plus lots more tests, then run again and refactor. is that correct?
freeayu has quit [Ping timeout: 260 seconds]
<jlebrech>
based on the initial spike*
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
lggr has joined #ruby
Virunga has joined #ruby
<JonnieCache>
yeah that sounds good
_2easy has quit [Client Quit]
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
<JonnieCache>
to me, a spike is just a test to validate your ideas and generally investigate
triptec has joined #ruby
<jlebrech>
the initial spike should be a "can i do it?" hack, am i right?
<JonnieCache>
like the many pencil sketches one might do and then throw away if one were in the early stages of designing a physical product
pitty has quit [Ping timeout: 260 seconds]
<jlebrech>
i find it impossible to write a spec if i haven't figured out how all the libraries i'm gonna use work
_2easy has quit [Client Quit]
<JonnieCache>
yeah exactly, so doing tests first for a spike doesnt really make sense
_2easy has joined #ruby
<jlebrech>
i might aswell write a spec like this: should "be feature complete" do
<jlebrech>
if you rigidly have to write a spec first
<workmad3>
test-driven spiking is possible
<workmad3>
you basically write tests to check assumptions
<workmad3>
but they aren't tests you'd keep after the spike, so heavyweight acceptance tests like cucumber scenarios are of limited utility
<jlebrech>
it would be nice to have "spec templates" for standard website features, like can i log in, register, etc..
<JonnieCache>
if theyre standard enough that you could build a template for them then thats a clue that maybe you shouldnt be doing them
_2easy has quit [Client Quit]
<JonnieCache>
ie. you could rely on devise's built in test helpers
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
<A124>
How could one check if an object is block?
daniel_- has joined #ruby
_2easy has quit [Client Quit]
<jlebrech>
I see
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<A124>
To answer self: .is_a? Proc
rakunHo_ has quit [Read error: Connection reset by peer]
beiter has quit [Quit: beiter]
rakunHo has joined #ruby
_2easy has quit [Client Quit]
_2easy has joined #ruby
_2easy has quit [Client Quit]
lggr has joined #ruby
c0rn_ has quit []
petrjanda has joined #ruby
petrjanda has quit [Client Quit]
<shevy>
hey
<shevy>
that is shakespeare A124
petrjanda has joined #ruby
<shevy>
To be or: not to_be? true
vlad_starkov has quit [Remote host closed the connection]
<shevy>
ruby is such a highly philosophical language :)
<A124>
Heh.
haxrbyte has joined #ruby
petrjanda has quit [Client Quit]
petrjanda has joined #ruby
Jork1 has quit [Quit: Jork1]
lggr has quit [Ping timeout: 256 seconds]
haxrbyte_ has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
emergion has joined #ruby
josh^ has quit [Ping timeout: 246 seconds]
monkegjinni has quit [Read error: No route to host]
lggr has joined #ruby
emergion has quit [Client Quit]
josh^ has joined #ruby
Jork1 has joined #ruby
emergion has joined #ruby
bwwrd has joined #ruby
Hamed-R has joined #ruby
_mak has quit [Quit: Ex-Chat]
monkegjinni has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
CodeFriar has joined #ruby
lggr has joined #ruby
dfmoser has quit [Quit: dfmoser]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
CodeFriar has quit [Ping timeout: 252 seconds]
arietis has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
_mak has joined #ruby
beiter has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
lggr has quit [Ping timeout: 256 seconds]
rakunHo_ has joined #ruby
lggr has joined #ruby
rakunHo has quit [Ping timeout: 246 seconds]
timonv has quit [Remote host closed the connection]
margle has quit [Quit: Computer has gone to sleep.]
prtksxna has quit [Remote host closed the connection]
mohits has quit [Ping timeout: 260 seconds]
carloslopes has joined #ruby
craigp has quit [Quit: craigp]
Virunga has joined #ruby
burgestrand has joined #ruby
lggr has joined #ruby
awojo has quit [Ping timeout: 240 seconds]
mark_locklear has joined #ruby
_JamieD_ has joined #ruby
_JamieD__ has joined #ruby
m_3 has joined #ruby
etehtsea has joined #ruby
craigp has joined #ruby
mohits has joined #ruby
klip has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
cakehero has joined #ruby
Jork1 has quit [Quit: Jork1]
eikko is now known as akemEikko
_bart has joined #ruby
ZubKonst_ has joined #ruby
rakunHo_ has quit [Remote host closed the connection]
lggr has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
_JamieD_ has quit [Quit: _JamieD_]
_JamieD__ is now known as _JamieD_
timonv has quit [Remote host closed the connection]
MikeyV27 has joined #ruby
ZubKonst has quit [Ping timeout: 246 seconds]
RJ3000_ has joined #ruby
timonv has joined #ruby
josh^ has quit [Remote host closed the connection]
Meon__ has joined #ruby
haxrbyte has joined #ruby
cdzombak has joined #ruby
nwest has quit [Quit: Computer has gone to sleep.]
awojo has joined #ruby
iamjarvo has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
snearch has joined #ruby
<awestroke>
is there any way to do this?: [@opcode, _, @id] = str.unpack("CCn")
xyzodiac has joined #ruby
Meon_ has quit [Ping timeout: 256 seconds]
jrajav has joined #ruby
lggr has joined #ruby
Takehiro has joined #ruby
bwwrd has joined #ruby
<waxjar>
awestroke, assuming that str.unpack returns a three part array: @opcode, _, @id = str.unpack("CCn")
<awestroke>
waxjar: oooh. Thanks!
xorgnak has quit [Remote host closed the connection]
a_a_g1 has quit [Quit: Leaving.]
monkegjinni has quit [Read error: No route to host]
lavaca has joined #ruby
matthewrobbins has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
tommyvyo has joined #ruby
mrbrdo has joined #ruby
_bart has quit [Quit: _bart]
<mrbrdo>
hey guys. I have a script where i'm using some parts of a Rails app (AR models more or less). I'm having a problem with comparing TimeWithZone with Time… I required 'active_support/core_ext' and 'active_support/all' too, but the comparison still doesn't take into account the time zone
zenformatics1 has quit [Quit: Leaving.]
monkegjinni has joined #ruby
aquaranto has joined #ruby
lggr has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
mrbrdo has quit [Quit: mrbrdo]
samphippen has quit [Quit: Computer has gone to sleep.]
clocKwize has quit [Read error: Connection reset by peer]
invisime has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<matti>
Um.
<matti>
shevy shevy shevy shevy
mucker has quit [Quit: leaving]
zenformatics1 has joined #ruby
mucker has joined #ruby
<invisime>
matti: you have to do it in front of a mirror with the lights out.
mohits has quit [Ping timeout: 260 seconds]
<shevy>
matti I work on my ruby build tools
chrisja has joined #ruby
RJ3000_ has quit [Remote host closed the connection]
fir_ed has quit [Ping timeout: 240 seconds]
w2f2 has quit []
lggr has joined #ruby
RJ3000_ has joined #ruby
nowhere_man has joined #ruby
<nowhere_man>
hi all
haxrbyte has quit [Remote host closed the connection]
bend66 has joined #ruby
<nowhere_man>
I'm new to ruby and trying rails, and there's something I don't understand with gem
samphippen has joined #ruby
<bend66>
ask
haxrbyte has joined #ruby
<nowhere_man>
when I do `bundle install`, it ends with "Your bundle is complete!"
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
bend66 has left #ruby [#ruby]
<nowhere_man>
but if I do `bundle show` with some dependencies, they are not found
<nowhere_man>
"Could not find daemons-1.1.9 in any of the sources"
<nowhere_man>
also, bundle install says "Installing eventmachine (1.0.0) with native extensions" when I run it as a user, but just "Using eventmachine (1.0.0)" when run as root
<nowhere_man>
I apt-get installed ruby-daemons, ruby-eventmachine and thin, but bundle show still doesn't find them, even after bundle install
<nowhere_man>
did I do something wrong?
nopper has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 240 seconds]
GoGoGarrett has joined #ruby
<shevy>
sadly, bundler never worked for me
lggr has joined #ruby
<shevy>
there can be one problem though
Axsuul has quit [Ping timeout: 240 seconds]
<shevy>
remember that debian changes lots of things, including gem default paths
<shevy>
"gem env" to show where your gems are
nopper has joined #ruby
<shevy>
I myself would not use both apt-get and bundler, debian hates all sorts of non-debian solutions to manage dependencies
darthdeus has joined #ruby
Puck6633 has quit [Ping timeout: 246 seconds]
jeffreybaird has joined #ruby
<kalleth>
hmmm
<kalleth>
what's an accepted/good way of doing a weighted probability for true/false in ruby?
<kalleth>
or any other language, actually
iamjarvo has quit [Ping timeout: 245 seconds]
freeayu__ has quit [Read error: Connection reset by peer]
<kalleth>
so i have a 10% 'true' win potential
<kalleth>
or 0.1 or however you want to deal with it
wuzzzzaah has quit [Ping timeout: 240 seconds]
<kalleth>
and when i call 'is_winner?' i want to return true 10% of the time and false the other 90%
cakehero has joined #ruby
jgarvey has joined #ruby
ewag has quit [Ping timeout: 248 seconds]
<nowhere_man>
kalleth: take a random number and see if it's in a certain range
FND has joined #ruby
joofsh has joined #ruby
<shevy>
kalleth I usually try to put this into a percentage
<FND>
hi - using Net::HTTP for PUT, is there a way to suppress the Content-Type header in the request?
Rydefalk_ has quit [Remote host closed the connection]
Rydefalk has joined #ruby
<kalleth>
shevy: so i have a 'probability' attribute on my object which is set to '10' (as a percentage)
<kalleth>
so i've got a 10% win rate
<shevy>
puts 'Yup, is smaller than 10.' if rand(100) < 10
<kalleth>
nowhere_man: I can do that, and that's actually the first thing i thought
<kalleth>
yeah, ok
<kalleth>
thats simple enough :)
<shevy>
well a range is possible too
<kalleth>
i guess i was wondering if there was a more rubyist
krawchyk has joined #ruby
<shevy>
(1..100).shuffle[0]
<kalleth>
if rand(100) in 0..10 or smth
<shevy>
oops
wuzzzzaah has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
<shevy>
(1..100).to_a.shuffle[0]
<shevy>
that should return a random element too
replore_ has quit [Remote host closed the connection]
<kalleth>
haha
<shevy>
but rand() seems easier
<kalleth>
yaeh, rand is fine
<shevy>
and probably faster
<shevy>
and responds to seed
<kalleth>
just FSR it seemed a bit hackier
<kalleth>
is all
<shevy>
hehe
tuxaddicted has joined #ruby
<kalleth>
i was hoping there was a Random.weighted(10%, [true, false])
<kalleth>
but yeah i think rand(0.0..100.0) < win_probability (10.0) is the only real way of doing it
monkegjinni has quit [Read error: No route to host]
justinmcp has quit [Remote host closed the connection]
mohits has quit [Ping timeout: 260 seconds]
gmurphey has quit [Ping timeout: 240 seconds]
<kalleth>
(to give extra precision)
<shevy>
hmm
<kalleth>
(as 100 levels of probability isn't enough :))
<shevy>
I think I need to read a book on statistics again
<shevy>
then I could use fancy terms
<kalleth>
well, i'm writing a test that will call this method 100,000 times and give me the output to show if a 10% win percentage wins 10% of the time
<shevy>
"Here we will use the randomly weighted win probability of anyone of you folks going to Las Vegas."
<kalleth>
lol
dhruvasagar has quit [Ping timeout: 260 seconds]
<heftig>
kalleth: def rand_weighted(weight_hash); target = rand(weight_hash.values.inject(:+)); weight_hash.each { |x, weight| target -= weight; return x if weight < 0 }; end
<shevy>
100.000 times... 10 %percet... 10.000
<shevy>
percent
<kalleth>
heftig: duh
<kalleth>
what
<heftig>
takes a hash like { false => 90, true => 10 }
<heftig>
integer weights only
Jork1 has joined #ruby
yalue has joined #ruby
<kalleth>
interesting
* kalleth
expands into a gist to understand it better
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<kalleth>
target = rand(total of true/false)
replore has joined #ruby
<kalleth>
heftig: interesting
* kalleth
simulates
<heftig>
kalleth: ah whoops
<heftig>
made an error, should be target < 0
krawchyk has quit [Ping timeout: 260 seconds]
matthewrobbins has quit [Ping timeout: 245 seconds]
freeayu has joined #ruby
<kaleido>
numbers
<kaleido>
makes me wish id paid attention in math years ago
ksinkar has joined #ruby
Takehiro has quit [Remote host closed the connection]
leehambley has joined #ruby
ffranz has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
robustus has joined #ruby
<workmad3>
kaleido: if you need more than 1% granularity with heftig's solution, change the target to 'target = rand * weight_hash.values.inject(:+)' although I don't know that it will significantly alter the distribution of 'wins'
duracrisis has joined #ruby
duracrisis has quit [Changing host]
duracrisis has joined #ruby
<heftig>
workmad3: why is this limited to 1% granularity?
Rydefalk has quit [Remote host closed the connection]
haxrbyte has quit [Remote host closed the connection]
<kalleth>
irb(main):045:0> results.select{|a| a == :true}.size
<kalleth>
=> 90056
<kalleth>
=> 9944
<kalleth>
irb(main):046:0> results.select{|a| a == :false}.size
<kalleth>
not bad, heftig
haxrbyte has joined #ruby
Takehiro has joined #ruby
<workmad3>
heftig: ah, good point, can just use 9000 and 1000 as values
<heftig>
or 9 and 1
<shevy>
sometimes I'd wish everyone would speak english
Rochefort has joined #ruby
<shevy>
half the time I seem to write in english, half the time in german
<heftig>
nah, klingon
lggr has joined #ruby
MikeyV27 has quit [Quit: MikeyV27]
daniel_- has quit [Ping timeout: 246 seconds]
<workmad3>
kaleido: one other thing to note - you should be careful with writing your test for this method as it's entirely possible (although unlikely) that some runs of your method will produce 0% wins, or 100% wins... that being the 'fun' of randomness after all ;)
<kalleth>
workmad3: press tab more than once pls ;p
<kalleth>
but yeah, that's as intended
<workmad3>
kalleth: sorry :)
<kalleth>
the client wants 'random' outcomes rather than 'every 10 times 1 person wins'
<kalleth>
i.e. non-deterministic
xyzodiac has joined #ruby
<workmad3>
kalleth: yeah, just makes testing it more difficult ;)
<kalleth>
well, it's a computer generating randomness, so :)
<workmad3>
kalleth: yeah, which makes it deterministically random if you know the seed and the algorithm
<kalleth>
workmad3: this is to determine if people 'win' when clicking 'give me a prize!'
<jcoglan>
is anyone in here familiar with the openssl module?
<kalleth>
(with flood protection)
<matti>
invisime: You mean, the shevy incantation? ;]
<kalleth>
asked the client if they wanted '1 in 10' and they said they wanted unpredictability, so *shrug*
<workmad3>
kalleth: cool :)
xyzodiac has quit [Client Quit]
<kalleth>
my test is going to be 'simulate someone clicking 100,000 times. show what prizes have been won'
RJ3000_ has quit [Remote host closed the connection]
<kalleth>
and there's a max quantity on prize too
<workmad3>
kalleth: out of curiosity... how 'expensive' would it be if someone figured out how to game the system?
rippa has joined #ruby
<kalleth>
workmad3: there's a top limit
<workmad3>
kalleth: and therefore, is SecureRandom warranted?
<kalleth>
so you have a win_probability, then you have a prize_probability for each prize level
<kalleth>
and each prize level has a quantity_remaining
<kalleth>
and its not automated shipping of prizes, so the admins would just go 'DELETE YOU HACKER'
<kalleth>
physical items mostly
_Mon_Ouie_ has joined #ruby
<workmad3>
:)
MikeyV27 has joined #ruby
<kalleth>
there's flood protection as its an FB app
fir_ed has joined #ruby
pen has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<kalleth>
so we have an fb ID for each user, and we prevent each user clicking more than 10 times
RJ3000_ has joined #ruby
prtksxna has joined #ruby
<kalleth>
its certainly going to be possible to game it but we have the human involvement at the last stage to stop that, so in longhand: no, i don't _think_ secure random is justified :)
<kalleth>
though i will look it up now, workmad3 :)
<kalleth>
interesting
<kalleth>
so its a direct /dev/urandom / openssl feed
<kalleth>
well, 'direct'
Rydefalk has joined #ruby
matthewrobbins has joined #ruby
lggr has joined #ruby
replore has quit [Remote host closed the connection]
CodeFriar has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
linoj has joined #ruby
Criztian_ has joined #ruby
kiyoura has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
Pochacco has joined #ruby
Criztian_ has quit [Read error: Connection reset by peer]
Criztian has joined #ruby
LouisGB has quit [Ping timeout: 245 seconds]
ananthakumaran has quit [Quit: Leaving.]
lggr has joined #ruby
triptec has quit [Quit: triptec]
faitswulff has joined #ruby
rodasc has joined #ruby
crodas has quit [Read error: Connection reset by peer]
Squarepy has quit [Read error: Operation timed out]
monkegji_ has quit [Read error: No route to host]
kpshek has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 260 seconds]
monkegjinni has joined #ruby
nitti has joined #ruby
g-ram has joined #ruby
pen has quit [Remote host closed the connection]
lggr has joined #ruby
blazes816 has quit [Quit: blazes816]
haxrbyte_ has quit [Ping timeout: 260 seconds]
haxrbyte has joined #ruby
mrbrdo has joined #ruby
wuzzzzaah has quit [Ping timeout: 255 seconds]
<ddd>
anyone know if there is a gem available that would graph or show what sections of each gem my code hits exactly. like what methods in what classes in which gems got hit, caused by this line of code I wrote. i have cover_me which just shows what code I wrote was executed by my tests (which gives me percentage of code coverage I have, per file and overall)
haxrbyte_ has joined #ruby
zommi has quit [Quit: Leaving.]
cburyta has joined #ruby
iamjarvo has joined #ruby
eikko has joined #ruby
TheFuzzball has quit [Ping timeout: 248 seconds]
tonini has quit [Remote host closed the connection]
rmillerx has joined #ruby
TheFuzzball has joined #ruby
TheFuzzball has quit [Excess Flood]
haxrbyte has quit [Ping timeout: 256 seconds]
jrajav has quit []
akemEikko has quit [Ping timeout: 256 seconds]
ltsstar has joined #ruby
TheFuzzball has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Vert has joined #ruby
cburyta has quit [Ping timeout: 248 seconds]
kpshek has joined #ruby
TheFuzzball has quit [Excess Flood]
tagrudev has quit [Remote host closed the connection]
<_axx>
matti: i know about the debian/ubuntu specs, but i have the feeling many ruby people prefer ubuntu much more (i use debian for years and found this very strange)
samphippen has quit [Quit: Computer has gone to sleep.]
quest88 has joined #ruby
<_axx>
the thing is, debian is much more restrictive about the packages etc. i don't know if this is a problem for some native extensions ruby gems include
<ddd>
_axx: because Ubuntu uses more recent versions of the libraries and applications by default than debian stable does.
<ddd>
that and their restrictive nature on pacakges
<ddd>
(debian's)
<matti>
_axx: I prefer Debian for lack of retardness.
<matti>
_axx: And simplicity and minimalism.
<_axx>
me too
<matti>
;]
<bigkevmcd>
matti: I'm guessing you know you can install a minimal ubuntu install?
ryanlecompte has joined #ruby
<matti>
With things like FPM, you package whatever you want.
<matti>
bigkevmcd: Sure.
lggr has quit [Ping timeout: 264 seconds]
xorgnak has joined #ruby
<_axx>
but i hear often that people on conferences talk about their stack and talk about ubuntu and my first tought is "ubuntu? that's for desktops!" :D
<bigkevmcd>
matled: so, when you say "simplicity and minimalism." what are you referring to?
<bigkevmcd>
ooops
<bigkevmcd>
matti: ^^^
S1kx has joined #ruby
<csmrfx>
I think that for production debian and ubuntu have some meaningful diffrences
pen has joined #ruby
lggr has joined #ruby
<_axx>
what of the two OSes to you guys think would fit rubys needs better? (because of the newer packages etc.)
<csmrfx>
I believe more on-topic channel would be #linux or #debian, though
<kalleth>
_axx: ubuntu is pretty reasonable, honestly
<kalleth>
just don't use package managers for ruby
<ddd>
I prefer Ubuntu because I like their general layout, default package choices, configuration choices, etc. But I used Debian for years too. Its really a personal choice decision. I'll always use a debian based distribution. I think apt/dpkg is far superior to RPM, so will not use RPM based distributions. Again, its a personal choice thing.
<ddd>
kalleth++
<ddd>
rvm or rbfu for ruby over pkg managers
Hamed-R has quit [Quit: Leaving]
<kalleth>
we use ubuntu for hosting ~200 client sites (1 per custom vps which they pay for and we bank a 'maintenance fee' for each one)
<kalleth>
so we don't have to us rbenv or rbfu or rvm
fridim_ has joined #ruby
<kalleth>
we juts have a system ruby install for each vps
jrajav has joined #ruby
<kalleth>
i use rbenv for local dev though
no_worries has joined #ruby
<ddd>
i'm obviously an rvm guy. however, any of the ruby managers does the trick. use the one most suited to you, is my thinking
cearls has joined #ruby
<matti>
bigkevmcd: JeOS-ish.
asteve has joined #ruby
xyzodiac has joined #ruby
<matti>
I am not willing to have advocacy flame here, so choose whatever works for you ;]
virtualentity has joined #ruby
<bigkevmcd>
indeed
heftig has quit [Quit: leaving]
<bigkevmcd>
not the appropriate place
<ddd>
matti: no no, my comment was specifically about *not* having a flamewar :)
<matti>
+1 ;]
<_axx>
do you see any problems while sticking to the basic ruby that's included in debian/ubuntu? as far as i know does wheezy have 1.9.2 preinstalled
artm has quit [Ping timeout: 256 seconds]
ryanlecompte has quit [Remote host closed the connection]
mrbrdo has quit [Quit: mrbrdo]
<csmrfx>
you wont be able to follow guides, necessarily, _axx
<csmrfx>
debian may have it's own way so complex gems sometimes do now work off the rack (like rails traditionally)
<_axx>
yeah, that's a problem i sometimes encounter with debian
<csmrfx>
otoh in production you may want to customize anyway
<_axx>
especially with eventmachine, debian can sometimes be a pain in the ass
* csmrfx
has used the stock debian 1.9.2 all day actually
quest88 has quit [Quit: quest88]
<csmrfx>
it's run on squeeze with "ruby1.9.1" 8P
<csmrfx>
kinda silly
beneggett has joined #ruby
<csmrfx>
but yes works fine
mohits has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 256 seconds]
<csmrfx>
and in fact debian is moving forward...
jgwong has joined #ruby
erichmenge has quit [Quit: Be back later]
replore_ has joined #ruby
<kalleth>
ddd: i'm not a fan of using version managers in production
<csmrfx>
in Squeeze you actually have both ruby1.8 and ruby1.9.1 by default afaics
<kalleth>
given how cheap cloud is its easier juts to provision a new VPS with systemwide ruby for each site, honestly
<kalleth>
removes a layer of complexity
<kalleth>
imo
lggr has joined #ruby
piotr__ has joined #ruby
blazes816 has quit [Quit: blazes816]
piotr_ has quit [Ping timeout: 260 seconds]
und3f has quit [Quit: Leaving.]
<ddd>
kalleth: yep. i know many in both 'camps'. another personal administrative choice i guess
<kalleth>
idd :)
<kalleth>
we have a puppet config for our boxen, so we just go 'provision new, apt-get install puppet, modify hosts file', 'git push production'
<kalleth>
and our rails/rack apps are running
<ddd>
nice
wuzzzzaah has quit [Ping timeout: 246 seconds]
Takehiro has quit [Remote host closed the connection]
<csmrfx>
you has git post-commit hooks or does puppet do all the footwork, kalleth ?
replore_ has quit [Ping timeout: 240 seconds]
jellosea has joined #ruby
<csmrfx>
uh, i mean post-receive
<_axx>
kalleth: that's also my concern. i don't like version managers on production systems
<_axx>
i have the feeling, that they're not "robust" enough
samphippen has joined #ruby
<kalleth>
csmrfx: puppet sets up the initial clone of the git repo then you push to production and the git repo as setup by puppet has a standard post-recieve hook that recompiles assets and restarts passenger
<kalleth>
if required
<kalleth>
_axx: i just want to be 100% sure i know what i'm using on production is all
<kalleth>
though i am liking rbenv lately
<_axx>
at the moment i'm looking for a nice tool to preinstall a full rails environment (mysql, mongodb, imagemagick etc.) but without something like puppet or chef.
<csmrfx>
mmmkay
<kalleth>
_axx: puppet or chef? :p
<_axx>
nope
<_axx>
without those guys. :)
<kalleth>
honestly though, you could probably use a bash script
<kalleth>
host it somewhere like github
<_axx>
yeah, that would be the best way i guess
<kalleth>
and then do curl github.com/script-url.sh | sh
<_axx>
yep
<csmrfx>
my plan exactly
<kalleth>
its how brew installs itself, f.e.
<csmrfx>
without github, tho
<kalleth>
well, remote url
<kalleth>
can be anything
kiyoura has quit [Quit: Leaving]
<kalleth>
but then again
<csmrfx>
yup, torious
<_axx>
yeah, we maintaine an self-hosted gitlab install
<kalleth>
why re-implement a package manager yourself in bash
lggr has quit [Ping timeout: 256 seconds]
<kalleth>
if you know what env you're going to be using
<kalleth>
just ... uh...
<kalleth>
make a package?
mark_locklear has quit [Remote host closed the connection]
<kalleth>
dpkg -i axx-rails-env.deb
<kalleth>
'depends on: postgres ruby-1.9.3 passenger apache2'
<kalleth>
etc
RJ3000_ has quit [Ping timeout: 264 seconds]
<_axx>
hm, i don't have any experience with creating packages :D
<kalleth>
neither do i
<kalleth>
but i'm told its relatively simple
<_axx>
good!
<_axx>
:D
<kalleth>
(heh, 'simple')
<csmrfx>
dpkg should be reliable
whackatre has quit [Remote host closed the connection]
<kalleth>
anyway
<kalleth>
deadline etc
bradleyprice has joined #ruby
* csmrfx
has installed kernels as packages
<kalleth>
must get back to work :)
<csmrfx>
handy
<_axx>
kalleth: ok, thanks so far! :)
S1kx has quit [Quit: Leaving]
nitti has quit [Remote host closed the connection]
Pochacco has quit [Quit: Pochacco]
<csmrfx>
I must get out of work!
<csmrfx>
8)
whackatre has joined #ruby
<_axx>
i'm just starting
<_axx>
:D
<ddd>
kalleth: debian/rules file for dpkg is rather easy. creating a debian package is dead simple. they also have a guide/book on it in the packages list
Takehiro has joined #ruby
<_axx>
ddd: any links you could provide? :)
<csmrfx>
#linux or #debian
<_axx>
oh, yeah. better place for that
<_axx>
:D
samuel02 has quit [Remote host closed the connection]
nitti has joined #ruby
lggr has joined #ruby
<ddd>
_axx: see msg
bluenemo has quit [Remote host closed the connection]
wuzzzzaah has joined #ruby
tk___ has quit [Quit: ばいばい]
mark_locklear has joined #ruby
ryanlecompte has joined #ruby
Xeoncross has joined #ruby
bluenemo has joined #ruby
kpshek has quit []
prtksxna has quit [Ping timeout: 245 seconds]
murz has joined #ruby
gmurphey has joined #ruby
schronicles47 has joined #ruby
freeayu has quit [Remote host closed the connection]
maesbn has quit [Remote host closed the connection]
schronicles47 has quit [Remote host closed the connection]
J2EE has quit [Ping timeout: 246 seconds]
kiddorails has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 240 seconds]
mikepack has joined #ruby
eldariof has quit [Ping timeout: 264 seconds]
snearch has quit [Quit: Verlassend]
nitti has quit [Ping timeout: 255 seconds]
J2EE has joined #ruby
csmrfx has left #ruby ["latertater"]
elsifaka has quit [Quit: Veloma e!]
beneggett has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
schronicles47 has joined #ruby
schronicles4794 has joined #ruby
schronicles4794 has quit [Remote host closed the connection]
sent-hil has joined #ruby
replore has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
davidcelis has quit [Quit: K-Lined.]
blazes816 has joined #ruby
mvangala has joined #ruby
glupo has quit [Remote host closed the connection]
sspiff has quit [Remote host closed the connection]
anachronistic has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
bbttxu_ has joined #ruby
nitti has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
darthdeus has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
mahmoudimus has joined #ruby
larissa has quit [Quit: Leaving]
beneggett has joined #ruby
maletor has joined #ruby
jprovazn is now known as jprovazn_away
xyzodiac has quit [Quit: Computer has gone to sleep.]
Neomex has quit [Remote host closed the connection]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
nitti has quit [Remote host closed the connection]
Neomex has joined #ruby
lggr has joined #ruby
Xeoncross has quit [Quit: Ex-Chat]
wuzzzzaah has quit [Ping timeout: 246 seconds]
Neomex has quit [Client Quit]
linoj has quit [Quit: linoj]
Rydefalk_ has joined #ruby
maletor has quit [Ping timeout: 245 seconds]
Meon__ has quit [Quit: Leaving]
margle has quit [Quit: Computer has gone to sleep.]
Rydefalk has quit [Ping timeout: 244 seconds]
lampe2 has joined #ruby
naquad has quit [Excess Flood]
nitti has joined #ruby
iamjarvo has joined #ruby
PapaSierra has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
PapaSierra has left #ruby [#ruby]
naquad has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
lggr has joined #ruby
wuzzzzaah has joined #ruby
deadghost has quit [Ping timeout: 244 seconds]
aganov has quit [Quit: aganov]
no_worries has quit [Remote host closed the connection]
artm has joined #ruby
linoj has joined #ruby
xyzodiac has joined #ruby
kuzushi has quit [Ping timeout: 246 seconds]
darthdeus has quit [Read error: Connection reset by peer]
darthdeu has joined #ruby
artm has quit [Client Quit]
lggr has quit [Ping timeout: 264 seconds]
deadghost has joined #ruby
_bart has left #ruby [#ruby]
artm has joined #ruby
leehambley has left #ruby [#ruby]
xorgnak has quit [Remote host closed the connection]
arielpts- has joined #ruby
maesbn has joined #ruby
lggr has joined #ruby
IrishGringo has joined #ruby
murz has quit [Quit: Leaving...]
arielpts has quit [Ping timeout: 245 seconds]
Virunga_ is now known as Virugna
froy has joined #ruby
<rking>
Hrm. There's gotta be something better than this: ['a'..'z', 'A'..'Z', %w(* $ @ !)].inject [] do |a,e| a += e.to_a end
<rking>
(Has to be 1.8-compatible, BTW)
wallerdev has joined #ruby
ananthakumaran has joined #ruby
mahmoudimus has quit [Ping timeout: 246 seconds]
dominikh has quit [Remote host closed the connection]
<asteve>
what's the easiest way to get the date 3 days ago?
cascalheira has joined #ruby
micha_ has joined #ruby
dominikh has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
kuzushi has joined #ruby
<rking>
asteve: AFAIK the easiest thing is to use activesupport stuff.
wuzzzzaah has quit [Ping timeout: 246 seconds]
<oz>
asteve: if you loaded activesupport it's Time.now - 3.days
RJ3000_ has joined #ruby
<rking>
3.days.ago
etehtsea has quit [Quit: Computer has gone to sleep.]
ckrailo has joined #ruby
lggr has joined #ruby
micha_ has quit [Client Quit]
lampe2 has quit [Ping timeout: 260 seconds]
wuzzzzaah has joined #ruby
lampe2 has joined #ruby
<asteve>
rking: oz thanks
irleif has joined #ruby
insulator has joined #ruby
<oz>
rking: indeed :)
burgestrand has quit [Quit: Leaving.]
monkegjinni has quit [Ping timeout: 255 seconds]
devtro has joined #ruby
Synthead has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
spinagon has joined #ruby
rippa has quit [Read error: Connection reset by peer]
nitti has quit [Ping timeout: 245 seconds]
baphled has quit [Ping timeout: 255 seconds]
nitti has joined #ruby
deadghost has quit [Ping timeout: 240 seconds]
wedtm|away is now known as wedtm
lggr has quit [Ping timeout: 245 seconds]
mahmoudimus has joined #ruby
khakimov has joined #ruby
hadees has quit [Quit: hadees]
<rking>
Hrm. Re my previous thing, this works as well: (0..255).map(&:chr).grep /[a-z\d*$@!]/i
<rking>
But that's worse.
monkegjinni has joined #ruby
lggr has joined #ruby
Jeena has joined #ruby
`brendan has joined #ruby
nitti has quit [Remote host closed the connection]
ryanlecompte has joined #ruby
RJ3000_ has quit [Remote host closed the connection]
Criztian has quit [Remote host closed the connection]
darthdeu has quit [Quit: Leaving...]
tuxaddicted has quit [Quit: leaving]
voodoofish430 has joined #ruby
bbttxu_ has quit [Ping timeout: 245 seconds]
nitti has joined #ruby
RJ3000_ has joined #ruby
jgrevich has joined #ruby
artm has quit [Quit: artm]
evilsushi has left #ruby [#ruby]
lggr has quit [Ping timeout: 246 seconds]
<ddd>
ok why can't i do @my_hash = { 1: "one", 2: "two" } but I can do @my_hash = { one: 1, two: 2 }. I get SyntaxError: unexpected ',', expecting $end when I do the first
lggr has joined #ruby
awarner has joined #ruby
wuzzzzaah has quit [Ping timeout: 246 seconds]
<lukaszk>
ddd: :1 is not a valid symbol
<lukaszk>
{ 1: 'one' } is equivalent to { :1 => 'one' }
<ddd>
lukaszk: fails even if I do "1":
AlbireoX has joined #ruby
maesbn has quit [Remote host closed the connection]
frogprince has quit [Ping timeout: 246 seconds]
<ddd>
ahh inability to convert 1.to_s.to_sym? But "1": "one" is the same thing but it still fails
BigFatFatty has joined #ruby
<ddd>
doing "1": is the same thing as 1.to_s.to_sym
<ddd>
still fails
<lukaszk>
I don't think it works like that in hash shorthand syntax
sagax has joined #ruby
daniel_- has joined #ruby
<ddd>
gotcha. thanks
carloslopes has quit [Quit: Leaving.]
JonnieCache has quit [Ping timeout: 246 seconds]
wuzzzzaah has joined #ruby
DrShoggoth has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
daniel_hinojosa has joined #ruby
Rochefortes has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
Rochefort has quit [Read error: Connection reset by peer]
no_worries has joined #ruby
irleif has joined #ruby
Rochefort has joined #ruby
davidcelis has joined #ruby
petrjanda has quit [Quit: petrjanda]
williamherry has quit [Ping timeout: 256 seconds]
theRoUS has quit [Ping timeout: 255 seconds]
davidcelis has quit [Read error: Connection reset by peer]
davidcelis_ has joined #ruby
heftig has joined #ruby
RJ3000_ has quit [Remote host closed the connection]
wuzzzzaah has quit [Ping timeout: 276 seconds]
lggr has joined #ruby
fir_ed has quit [Read error: Connection reset by peer]
mvangala has quit [Read error: Connection reset by peer]
fir_ed has joined #ruby
mvangala has joined #ruby
Rochefortes has quit [Ping timeout: 246 seconds]
stephenjudkins has joined #ruby
wuzzzzaah has joined #ruby
thisirs has quit [Remote host closed the connection]
RJ3000_ has joined #ruby
davidcelis_ is now known as davidcelis
catphish_ has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
ahuman has quit [Quit: No Ping reply in 180 seconds.]
ahuman has joined #ruby
<catphish_>
why would i likely see this: Cannot allocate memory - fork(2)
cearls has quit [Remote host closed the connection]
<catphish_>
isn't fork pretty much memory-free?
samphippen has joined #ruby
<davidcelis>
why would it be memory free
erichmenge has joined #ruby
cburyta has joined #ruby
<catphish_>
linux uses COW for fork
<catphish_>
and the new process has its own virtual space
vjt has quit [Ping timeout: 272 seconds]
wpaulson has joined #ruby
vjt has joined #ruby
<catphish_>
so wouldn't the new fork be the same size as the old one virtually
<davidcelis>
perhaps your script itself has a memory leak
<catphish_>
and pretty much zero physically
<catphish_>
i don't understand why that would cause fork to fail
<davidcelis>
because it runs out of memory?
<catphish_>
fork is a single operation
<Eiam>
the operation it runs requires resources...?
<catphish_>
fork is an operation on its own
<catphish_>
it doesn't run anything else other than itself
<catphish_>
" fork() failed to allocate the necessary kernel structures because memory is tight."
<catphish_>
maybe i just had no memory at that moment
rehat has joined #ruby
<Eiam>
uh
<Eiam>
fork duplicates the calling process
<catphish_>
correct
lggr has quit [Ping timeout: 245 seconds]
frogprince has joined #ruby
<Eiam>
so its going to take as much memory as the calling process did at the time it was called
<rehat>
is there a way to use the permutations method on two different arrays
<catphish_>
incorrect
<rehat>
??
<catphish_>
it allocates the same amount of memory, but the actual usage is very small
<catphish_>
because they share pages
Rochefort has quit [Remote host closed the connection]
Jork1 has quit [Quit: Jork1]
stephenjudkins has quit [Quit: stephenjudkins]
nitti has quit [Remote host closed the connection]
cburyta has quit [Ping timeout: 245 seconds]
<davidcelis>
you just said it allocates the same amount of memory
irleif has quit [Quit: Computer has gone to sleep.]
<davidcelis>
and your error was "Cannot allocate memory"
<Eiam>
^
<rehat>
like [1,2,3,4,5] and [6,7,8,9,0] and get a permutation of two element arrays with one item from array 1 and one item from array 2?
<davidcelis>
even if the memory usage itself is small, it has to allocate it. your script couldn't
<catphish_>
davidcelis: it's hard to explain unless you understand COW and virtual memory
<Eiam>
im worried you may not understand memory? =0
futilegames has quit [Quit: futilegames]
bbttxu_ has joined #ruby
<catphish_>
allocating memory doesn't actually consume it, and forking allocates a duplicate set of memory, but it shares the physical memory with the original process
lggr has joined #ruby
<Eiam>
catphish_: note that even under page sharing, a "copy of all pages to the parent process are created and loaded into a seperate memory location"
skogis has quit [Ping timeout: 256 seconds]
<Eiam>
no
<Eiam>
only in certain cases does it not need to duplicate
<Eiam>
not in all.
<catphish_>
why would that happen
frogprince_mac has joined #ruby
<catphish_>
"Under Linux, fork() is implemented using copy-on-write pages, so the only penalty that it incurs is the time and memory required to duplicate the parent's page tables, and to create a unique task structure for the child. "
nitti has joined #ruby
<catphish_>
where are you reading from?
<Eiam>
COW is only utilized in certain cases, not all
<Eiam>
those cases look like when the child executes an exec or exits very soon after fork()
frogprince has quit [Ping timeout: 240 seconds]
<Eiam>
otherwise, you pay the memory cost
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
snearch has joined #ruby
chrishunt has joined #ruby
faitswulff has quit [Ping timeout: 240 seconds]
<catphish_>
Eiam: afaik linux always uses cow
yshh has quit [Remote host closed the connection]
Jork1 has joined #ruby
thmzlt has joined #ruby
senny has quit [Remote host closed the connection]
<oz>
and goats
ncr100 has joined #ruby
Jeena has left #ruby [#ruby]
Virugna has quit [Remote host closed the connection]
<oz>
(sorry)
snearch has quit [Client Quit]
timonv has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
frogprince has joined #ruby
hadees has joined #ruby
<catphish_>
lol
cantonic_ has joined #ruby
dr_bob has quit [Quit: Leaving.]
sent-hil has quit [Remote host closed the connection]
skogis has joined #ruby
sent-hil has joined #ruby
lggr has joined #ruby
thmzlt has quit []
<rking>
The deal is that Ruby ≤ 1.9 does writes everywhere, wasting copy-on-write benefits.
cantonic has quit [Ping timeout: 246 seconds]
cantonic_ is now known as cantonic
<rking>
REE or Ruby 2.0 fixes that.
Morkel has quit [Quit: Morkel]
deadghost has joined #ruby
<catphish_>
ah ruby 2.0
<catphish_>
does that happen during the fork?
mgates has quit [Quit: mgates]
<rking>
No it's just the GC writes to the locations all over memory
<rking>
So even if you only read 100% of the time, you still get writes to the actual pages, causing the OS to do the on-write copy.
bricker has joined #ruby
<catphish_>
that makes sense, but i'm still confused how fork() itself would fail
<catphish_>
something must be alloc'd during the fork
<catphish_>
or the kernel itself ran out of memory at that moment
<rking>
catphish_: Do you have this reduced down to a gist-sized thing?
<catphish_>
rking: nope, in fact this was a one-off error in a production environment
<catphish_>
so i don't have any background on the state of the system at the time
<rking>
I wonder if maybe the ENOMEM is being reused for having overrun some other limit, like total # of procs or something.
evilsushi has joined #ruby
evilsushi has quit [Changing host]
evilsushi has joined #ruby
<rking>
No, that'd be EAGAIN
<catphish_>
a quick google indicates that it can be caused by file descriptor limits etc, but that may be incorrect
<catphish_>
fork() failed to allocate the necessary kernel structures because memory is tight.
<catphish_>
acording to the linux man page
daniel_hinojosa has quit [Ping timeout: 246 seconds]
<rking>
catphish_: If it happens too much, what I'd do is hunt the exception down stalker style.
<rking>
Like use pry-rescue and wait for it to happen.
<rking>
It's extremely hard to guess without replication.
lggr has quit [Ping timeout: 260 seconds]
<catphish_>
i have a tool that dumps a stack trace if any of my processes use more than 4GB of RAM
<catphish_>
will check those logs
a_a_g has joined #ruby
<rking>
Yeah
<catphish_>
something did get killed at that moment
darthdeus has joined #ruby
<catphish_>
my guess: one process alloc'd all my RAM, and the fork in another process failed as a result
<catphish_>
i really need to work out how to set up proper ulimits
<rking>
Hrm.
shadoi has joined #ruby
lggr has joined #ruby
<catphish_>
ah yes, i have a customer with a 1.2GB file upload to my web app
<catphish_>
which is being buffered instead of streamed
<rking>
Cool customer, bro.
jrajav has quit []
arturaz has quit [Ping timeout: 246 seconds]
<catphish_>
lol
timmow has quit [Ping timeout: 252 seconds]
<rking>
I think you're right re: setting limits being the answer.
<catphish_>
every time they download it, massive memory spike, i guess one of those exhausted my server momentarily
djbender has joined #ruby
Rochefort has joined #ruby
stkowski has joined #ruby
bluenemo has quit [Remote host closed the connection]
evilsushi has quit [Quit: Lost terminal]
Rochefort has left #ruby [#ruby]
jcoglan has quit [Ping timeout: 248 seconds]
<catphish_>
thanks :)
whaley has joined #ruby
chrismcg is now known as zz_chrismcg
lggr has quit [Ping timeout: 260 seconds]
SegFaultAX|work has joined #ruby
<rking>
Urr, that *plus* streaming I mean.
Agis__ has joined #ruby
sent-hil has quit [Remote host closed the connection]
Uranio has joined #ruby
lggr has joined #ruby
<catphish_>
indeed :)
<catphish_>
don't want to break the functionality :)
daniel_hinojosa has joined #ruby
beneggett has quit [Read error: Operation timed out]
<catphish_>
is there a simple way to make File.read an enum?
<catphish_>
that reads blocks
mrsolo has joined #ruby
margle has joined #ruby
<catphish_>
because return [File.read(bigfile)] is just dumb
<Uranio>
there is something for "dialogue" with forms in webpages
lampe2 has quit [Ping timeout: 255 seconds]
<Uranio>
for exmaple, filling form, aquth, get the cookie and go ahead
<RubyPanther>
catphish_: generally you much better off if you can have your webserver accept the file uploads
<Uranio>
exmaple = example
<catphish_>
RubyPanther: lets assume i can't :)
<RubyPanther>
catphish_: then it will most likely be slow for large files
<catphish_>
RubyPanther: it's not
<catphish_>
RubyPanther: ruby is more than capable of processing data at 100Mbps
zigomir has quit [Quit: Leaving]
<RubyPanther>
by "slow" I mean, consume excess resources.
<catphish_>
is is, hence my question
<catphish_>
turning File.read into an enum will fix it
lggr has quit [Ping timeout: 246 seconds]
<RubyPanther>
it is truly unavoidable with a higher level language, if you want it not to do that, write it as a C extension.
<catphish_>
RubyPanther: no, turning File.read into an enum will fix it
<catphish_>
it will simply read the file in suitable blocks
<RubyPanther>
Or better, pass off to a webserver and have it notify a long-running process when it is finished, and have the web app communicate with the long-running-process.
jimeh2 has quit [Ping timeout: 252 seconds]
lampe2 has joined #ruby
gani has joined #ruby
replore has quit [Remote host closed the connection]
shevy2 has joined #ruby
alfism has joined #ruby
sagax has quit [Read error: Operation timed out]
carloslopes has joined #ruby
sneakyness_wk has joined #ruby
lggr has joined #ruby
<catphish_>
isn't there a shortcut way to create an emun with a block?
<catphish_>
Enumerator.new
stkowski_ has joined #ruby
A1241 has joined #ruby
wuzzzzaah has quit [Quit: wuzzzzaah]
shevy has quit [Ping timeout: 264 seconds]
A1241 has quit [Client Quit]
stkowski has quit [Read error: Connection reset by peer]
stkowski_ is now known as stkowski
lampe2 has quit [Ping timeout: 256 seconds]
lukaszk has quit [Ping timeout: 246 seconds]
A124 has quit [Ping timeout: 240 seconds]
<rking>
catphish_: My biggest objection to that approach is the sheer waste of problem-solving. If you can beat nginx at file transfers, I'll give you $#{some_inordinate_number}.00.
sagax has joined #ruby
<rking>
And I'll also pay the taxes.
werdnativ has joined #ruby
<catphish_>
rking: i do agree in principle
<rking>
Just let the frontend server do its job, then handle it within the backend as a solved problem
<catphish_>
especially since i'm streaming from a file
ephemerian has quit [Quit: Leaving.]
atmosx has joined #ruby
apok has joined #ruby
jlebrech has quit [Read error: Operation timed out]
a_a_g has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 255 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
stephenjudkins has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
slainer6_ has quit [Remote host closed the connection]
abstrusenick has quit [Quit: abstrusenick]
Iszak has quit [Quit: User has gone to sleep.]
mucker has quit [Quit: leaving]
lggr has joined #ruby
iamjarvo has joined #ruby
apok has quit [Quit: apok]
apok has joined #ruby
<catphish_>
does nginx have some kind of send_file support by default?
margle has quit [Quit: Computer has gone to sleep.]
<jgspratt>
Sure. I just expected the case of the module to be the same in all references to it.
<TTilus>
jgspratt: require "time" does not refer to module
<TTilus>
jgspratt: it refers to source file
jbw has quit [Read error: Operation timed out]
<jgspratt>
Containing a module?
<TTilus>
jgspratt: might or might not
sarmiena_ has joined #ruby
<jgspratt>
I don't have time to fix that right now.
<TTilus>
jgspratt: it is a convention to have class/module Foo in foo.rb
williamherry has joined #ruby
zefr has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
<jgspratt>
Ok, I'll use that for now.
<jgspratt>
Thanks!
<TTilus>
jgspratt: time.rb is ruby stdlib stuff, and is known to provide Time#iso8601
linoj has joined #ruby
wedtm|away is now known as wedtm
<TTilus>
jgspratt: np
nitti has quit [Remote host closed the connection]
glyytchy has joined #ruby
lggr has joined #ruby
rehat has joined #ruby
Gadgetoid__ is now known as Gadgetoid
Gadgetoid is now known as Gadgetoid_Air
Uranio has quit [Quit: WeeChat 0.3.8]
Gadgetoid_Air is now known as Gadgetoid_mbp
<thinkclay>
is there a gem or standard that the community uses for ACL / auth? I'm using MongoId for my DB
xyzodiac has joined #ruby
jbw has joined #ruby
jrajav has joined #ruby
bradleyprice has quit [Remote host closed the connection]
Gadgetoid_mbp is now known as Gadgetoid
jeeky_ has joined #ruby
steffes has joined #ruby
<nwertman>
Is there a way to simply print a backtrace in ruby without raising an exception? I'm doing some performance tuning on a tool and want to identify all the times a lengthy method is being called.
SegFaultAX|work has quit [Ping timeout: 245 seconds]
chimkan_ has joined #ruby
<Mon_Ouie>
puts caller
devtro has quit [Quit: devtro]
arielpts has joined #ruby
lukaszk has joined #ruby
jeeky has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
arielpts- has quit [Ping timeout: 244 seconds]
devtro has joined #ruby
artm has joined #ruby
sent-hil has quit [Remote host closed the connection]
eikko has joined #ruby
CJNE has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
artnez has quit [Ping timeout: 245 seconds]
sent-hil has joined #ruby
eikko has quit [Max SendQ exceeded]
eikko has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
anachronistic has quit [Quit: anachronistic]
drowningchild has quit [Quit: Leaving]
sent-hil has quit [Remote host closed the connection]
<awestroke>
getting "Segmentation fault: 11" with ruby 1.8.7-p302
anachronistic has joined #ruby
SegFaultAX|work has joined #ruby
<bperry>
Solution: don't use 1.8.7
<davidcelis>
^
xyzodiac has quit [Quit: Computer has gone to sleep.]
sent-hil has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
ananthakumaran has quit [Quit: Leaving.]
devtro has quit [Quit: devtro]
timonv has joined #ruby
wallerdev has joined #ruby
robertotauille has joined #ruby
the_jeebster1 has joined #ruby
lggr has joined #ruby
the_jeebster has quit [Ping timeout: 245 seconds]
replore has joined #ruby
zefr has quit [Quit: zefr]
jhunter has left #ruby [#ruby]
steffes has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
fram has quit [Remote host closed the connection]
vderyagin has quit [Remote host closed the connection]
xorigin has joined #ruby
replore has quit [Ping timeout: 260 seconds]
xorigin has left #ruby [#ruby]
lggr has quit [Ping timeout: 256 seconds]
colinbm has joined #ruby
jeeky_ has quit [Read error: Connection reset by peer]
<pozic>
davidcelis: I fail to see how that takes a string as input, searches for anything which resembles an IP and returns it.
<davidcelis>
ah
<davidcelis>
then no
<matti>
pozic: THen do complex regexp.
<matti>
Problem solved, next.
nanderoo has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 260 seconds]
<davidcelis>
use a regexp
<matti>
;d
gaspar|work has joined #ruby
dhackner has left #ruby [#ruby]
<davidcelis>
the library i linked you to has regexes you can use; just strip them out and do something similar, but scan across a string for a match instead of including \A...\z in the regex.
Sajo444 has joined #ruby
kirun has joined #ruby
sebastianb has quit [Quit: Reconnecting]
sebastianb has joined #ruby
<davidcelis>
really not that difficult to implement
Sajo444 has left #ruby [#ruby]
lggr has quit [Ping timeout: 264 seconds]
<matti>
No! We have to use OCalm to do it.
djbender has joined #ruby
bradhe has joined #ruby
Jork1 has quit [Ping timeout: 246 seconds]
moshee has quit [Ping timeout: 244 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<pozic>
matti: OCaml is fine too.
djbender has left #ruby [#ruby]
<harushimo>
!pastebin
<matti>
harushimo: pastie.org
<pozic>
matti: I don't really care about the language it is implemented in, as long as it has been solved.
<gaspar|work>
Hello! I am using data mapper - how is it possible to select all the Posts that were created today by using automagic field created_at without active_record support?
<matti>
pozic: Regexp + scan?
lggr has joined #ruby
rakl has joined #ruby
answer_42 has quit [Quit: WeeChat 0.3.9]
<Hanmac>
pozic the problem about an regex is that "::" is an valid ipv6 adress ...
<matti>
Hanmac: Make it a special case
jenrzzz has joined #ruby
<davidcelis>
Hanmac: the library i linked to reports '::' as valid
<davidcelis>
or at least it looks as though it would
philcrissman has joined #ruby
<harushimo>
I wrote a count words program but when I look at my sample output, it seems I'm missing something
<ProLoser|Work>
when working with sass, is it possible to extend classes without rendering those classes?
<csmrfx>
22:47 < Hanmac> reactormonk: this may be more cool: str.downcase.to_enum(:scan,/\w+/).with_object(Hash.new(0)) {|s,h| h[s] +=1 }
<ProLoser|Work>
like say i have a primary CSS file, and I want to extend classes in that but I wish to place the results in another file
<csmrfx>
^ harushimo
<harushimo>
I got it
<harushimo>
thank you
insulator has joined #ruby
<harushimo>
would that go where I'm splitting the string
timonv has quit [Remote host closed the connection]
<csmrfx>
see regexp scan for words dont need no splitting
<csmrfx>
also, the counting is in that too
<harushimo>
I got it
<harushimo>
we split the string and then count it
[Neurotic] has joined #ruby
<harushimo>
I even see regular expression in 3 different languages
<csmrfx>
no
keymone has joined #ruby
smw_ has joined #ruby
<csmrfx>
no splitting in Hanmac's example
lggr has quit [Ping timeout: 245 seconds]
<csmrfx>
regexp matches
<csmrfx>
it uses syntax sugar black magic
justinmcp has joined #ruby
<harushimo>
haha
<harushimo>
is that theme now black magic
BMF has quit [Remote host closed the connection]
<harushimo>
hehe
swarley has joined #ruby
<harushimo>
thank you
<csmrfx>
well I thank Hanmac for that nice oneliner
<harushimo>
it is nice one liner
* Hanmac
's code looks often very "funky"
<redbeard0x0a>
When writing a gem that wraps an HTTP api, what works best for handling certain errors (i.e. Authentication)? I know some libraries throw an exception, some may return nil and provide a way to check last error?
vlad_starkov has joined #ruby
jgrevich_ has joined #ruby
<redbeard0x0a>
I have no issues throwing an exception for a 500 type error, but I don't like using exceptions for something like 401 Authentication Required
<redbeard0x0a>
Any good examples out there? Any advice?
vlad_starkov has quit [Remote host closed the connection]
Virunga has quit [Remote host closed the connection]
bwlang has left #ruby [#ruby]
pskosinski has quit [Quit: A few unofficial Red Eclipse 1.3.1 (r4131) servers: http://altred.tk/toggle.rb (and no more global banning for saying that main dev is not very smart, what is truth anyway)]
lggr has joined #ruby
jgrevich has quit [Ping timeout: 246 seconds]
jgrevich_ is now known as jgrevich
fridim_ has joined #ruby
vlad_starkov has joined #ruby
<csmrfx>
why not just str.downcase.scan(/\w+/), btw?
Tombar has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
c0rn_ has quit [Quit: Computer has gone to sleep.]
awestroke has quit [Remote host closed the connection]
<davidcelis>
STR.UPCASE.SCAN(/\W+/)
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
Tombar has quit [Remote host closed the connection]
vlad_sta_ has joined #ruby
<csmrfx>
"423kl 234kl 23".downcase.scan(/\w+/).each(Hash.new(0) {|w,h| h[w] += 1 } ) give wrong number of args
vlad_sta_ has quit [Remote host closed the connection]
Hanmac has quit [Remote host closed the connection]
swarley has quit [Read error: Connection reset by peer]
<workmad3>
csmrfx: yeah... that's not how you call .each ;)